Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

test

sudo dnfAll commands, unless otherwise noted, must be run as root.
Panel
titleBefore you start
  • Provision the necessary hardware to support your implementation plan.
  • Select one of the recommended operating systems from the options listed on the server recommendations page. You will need to know which operating system you are using before you begin the installation. We do not support Ubuntu or any operating system not explicitly listed.
  • The server, either directly or indirectly, must be able to access the internet on ports 80 and 443./or 443 (preferably both)
  • Ensure that the machine and the data directory location of the PostgreSQL installation have sufficient disk space by running the df -h command. Requirements and recommendations for disk layout can be seen here: PostgreSQL.
  • Ensure that SELinux is disabled.
  • Ensure that firewalld  is disabled or the necessary ports must be opened (postgresql: 5432; client tools: 80 and 443).
  • We recommend restricting the root alexandria user to the database administrator only. For all other uses, we suggest creating a separate user which has only SELECT permissions in the core schema.
  • Install the CLAIMS Direct yum repository:

Distribution

URL

RHEL/CentOS 7
sudo yum -y install \
https://repo.ificlaims.com/ifi-claims-direct/centos/7/x86_64/ifi-claims-direct-1.0-1.el7.x86_64.rpm
RHEL/Rocky 8


Note

Note: It is recommended to copy and paste the code provided in these instructions.

1. Notify support@ificlaims.com when your equipment is prepared. Please provide IFI with the name, address, and telephone number of the person who is to receive a copy of the compressed PostgreSQL database. IFI will replicate a copy of the PostgreSQL database on a USB drive and ship it to you.

2. When you receive the USB, connect it to your intended PostgreSQL machine and mount the drive so that it can be read.

3. Use yum to install PostgreSQL.

Code Block
yum -y install \
    postgresql postgresql-contrib \
    postgresql-odbc postgresql-plperl \
    postgresql-server

4. If you are using CentOS, add the epel repository.

Code Block
languagetext
yum -y install epel-release

If you are using RHEL, use the following code to add the epel repository. Otherwise, continue to step 5.

Code Block
languagetext
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-$(rpm -E '%{rhel}').noarch.rpm

5. Install the appropriate repository for your operating system using the command listed in the Repository column below. If necessary, adjust the code to reflect the version you are using.

Operating SystemRepository
RHEL/CentOS 7
yum -y install \

...

...

...

...

...

...

...

yum -y install \

...

...

...

...

Note

Note: It is recommended to copy and paste the code provided in these instructions.

1. If you received the data as a tar.gz file, extract it into your local environment. The receiving drive requires approximately 4TB of free space to download and extract the file. The extracted file will consist of a number of smaller tar.gz files. There is no need to extract each of these smaller files.

2. Prepare repositories and run a 6. After installing the repository, run a yum update to pull in the patched version of libxml2 from the IFI CLAIMS repository and any other pending updates. Adjust the code if you are using a different version of PostgreSQL.

Code Block
languagebash
# Amazon Linux 2
sudo amazon-linux-extras install epel
sudo amazon-linux-extras enable postgresql14
sudo yum clean all
sudo yum update

# RHEL/CentOS 7
sudo yum -y install epel-release
sudo yum clean all
sudo yum update

# Rocky
sudo dnf -y install epel-release
sudo dnf config-manager --set-enabled powertools
sudo dnf clean all
sudo dnf update

# RHEL
sudo subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms
sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo dnf clean all
sudo dnf update
Note

Note: Reboot if kernel was upgraded.

3. CLAIMS Direct requires a working PostgreSQL cluster. If you have a working cluster, skip to step 5. If you do not have an initialized cluster, the following commands install PostgreSQL and initialize the cluster. The initdb command has to be run by the user who owns PostgreSQL (user postgres).

Install:

Code Block
languagebash
# Note: this installs the default version of your distribution. If you would like a higher version,
#       please see: https://www.postgresql.org/download/linux/redhat/
sudo yum -y install postgresql postgresql-contrib postgresql-plperl postgresql-server

Initialize:

Code Block
languagebash
sudo -u postgres initdb -A trust -D /var/lib/pgsql/data -E utf8
Note

Note: PostgreSQL, by default, only allows local connections. If you would like to open access to network clients or are installing the Client Tools on a separate server, please see Allowing Remote Access to PostgreSQL Alexandria.

4. Enable .

Code Block
yum update


Note

Note: Reboot if kernel was upgraded.

7. CLAIMS Direct requires a working PostgreSQL cluster. If you do not have an initialized cluster, the following commands will initialize the cluster and give you rudimentary authentication and access levels needed to run CLAIMS Direct. Note that the initdb command has to be run by the user who owns PostgreSQL (user postgres). Enter:

Code Block
su - postgres

followed by:

Code Block
initdb -A trust \
       -D /var/lib/pgsql/data \
       -E utf8

8. Using a text editor, modify the IP addresses in the following configuration files.

Note

Note: If you are installing the client tools on a separate machine, other hosts will be required. Be sure to remove the hash (#) at the start of the ‘other hosts’ entry if you need to enable access for other hosts or subnets.

/var/lib/pgsql/data/pg_hba.conf

Code Block
languagetext
# Allow trusted local access

local   all             all                                     trust
 
# IPv4 local connections
host    all             all             127.0.0.1/32            trust
 
# Other hosts on subnets that may require access, for example
# host    all             all             xxx.xxx.xxx.xxx/xx         trust

/var/lib/pgsql/data/postgresql.conf

Code Block
listen_addresses = '*'                  # what IP address(es) to listen on;


Note

Note: If you already have an initialized cluster, please be certain that local access is enabled for stand-alone installation. In either distributed install, if a separate services machine is created, its IP address needs access. This is imperative for the client update procedures.

9. Enable and restart the PostgreSQL cluster.

bash
Code Block
language
sudo systemctl enable postgresql.service ; sudo systemctl startrestart postgresql.service

510. Create the role alexandria and load the SQL via psql into the instance.

Code Block
languagebashtext
echo "create role alexandria with superuser login;" \
  | psql -U postgres postgres

Install the schema and tools.

Code Block
languagebash
sudo yum -y install alexandria-schema-tools

Create the database.11. Change the directory to the mounted USB file system and create the database. If desired, you can redirect errors (if any) to LOG.2.

Code Block
languagebashtext
cat /usr/share/alexandria/alexandria-schema-xml/alexandria-schema-xml-dwh.sql | psql -U alexandria postgres

...

 2>/tmp/LOG.2

12. To ensure that the database has been created, run:

bash
Code Block
language
psql -U alexandria --list

The results should show the alexandria database.

Code Block
languagetext
                 List of databases      
Name       |  Owner    | Encoding |   Collate  |    Ctype    |  Access privileges
-----------------+------------+----------+-------------+-------------+-----------------------
alexandria |alexandria | UTF8     | en_US.UTF-8| en_US.UTF-8 |                                		                                                                                                 
postgres   |postgres   | UTF8     | en_US.UTF-8| en_US.UTF-8 |  
template0  |postgres   | UTF8     | en_US.UTF-8| en_US.UTF-8 |=c/postgres          +      
 		   |           |          |            |             | postgres=CTc/postgres
template1  |postgres   | UTF8     | en_US.UTF-8| en_US.UTF-8 |=c/postgres          +       
           |           |          |            |             | postgres=CTc/postgres

7. Tune the database before loading.

In postgresql.conf, adjust the autovacuum settings as follows:

...

Setting

...

Recommended

...

Notes

...

This is the recommended setting for a 16-core machine.

For a 4-core machine, a setting of 2 is recommended.

...

For other performance tuning, use the online tool 13. Run pgtuneNote that this requires Python. You can also use the online tool https://pgtune.leopard.in.ua/#/. Fill and fill in the required values as well as those that correspond to your system. Add the suggested changes to the bottom of postgresql.conf.

...

or change the appropriate settings and restart PostgreSQL.

Code Block
languagetext
sudo systemctl restart postgresql.service

...

yum -y install pgtune
  pgtune -i postgresql.conf  -T DW -c 500
  [ paste added configuration options at end of postgres.conf ]

14. Run the pre-flight check script to check script to confirm that your system is properly configured to load the data.

cd-
Code Block
languagebash
Note

Note: The scripts used in these instructions are located on the mounted USB file system.


Code Block
./pre-flight-check.sh 

The sample output of a properly configured system looks would look like this:

Code Block
languagetext
# Testing localhost/alexandria ...
#   OK    : procedual language sql
#   OK    : procedual language plpgsql
#   OK    : procedual language plperl
#   OK    : procedual language plperlu
#   OK    : XML capability (test 1/libxml):
#   OK    : XML capability (test 2/libxml):

Resolve any recognized errors. For unfamiliar errors, please contact support@ificlaims.com.

...

15. Use the load script to load the CLAIMS Direct data into PostgreSQL tables. Since

...

the loading process will

...

take 1-2 days, we recommend that you use the

...

nohup command to detach the script from the terminal and allow it to run in the background. Edit the IP address in the command to reflect the IP address where postgres is installed.

Code Block
language
nohup bash
nohup cd-./load.sh xxx.xxx.xxx.xxx alexandria &

10. You can monitor the load using pg_stat_activity.

Code Block
languagesql
select query_start, state, query from pg_stat_activity where datname = 'alexandria';

1116. Use the ps command periodically to check whether the load.sh process has completed.

Note

Note: If you want to check on the process while it is running, use the following command to show the progress of the tables which are being copied:

Code Block
ps -eaf |grep COPY


17. Once the loading process is complete, you  you can run the cd-the count.sh script script, a simple QA of table counts, to ensure that the tables have loaded correctly. Modify the IP address to reflect the postgresql server. This may take an hour or more to run.

language
Code Block
bash
cd- ./count.sh xxx.xxx.xxx.xxx alexandria

The results should show that 39 xml tables and 4 cdws tables have loaded. The following tables are deprecated and will show a count of 0:

...

xml.t_revision_history
xml.t_rule_47_flag
xml.t_technical_data 
xml.t_us_sir_flag

...

More information about the tables can be seen in Data Warehouse Design.

1218. Optional: you may want to run a simple SQL query as an additional test to confirm that the data is present.

note
Code Block
languagesqltext
echo "select * from xml.t_patent_document_values where ucid = 'US-5551212-A'" | psql -U alexandria


Note: For new installations as well as any changes to your subscription, it may take 24 hours for full synchronization of your on-site instance.

Panel
titleNext Steps

Once the data has been loaded, proceed to Client Tools Installation.Familiarize yourself with the PostgreSQL Schema and Tools.