JPC HA Installation Guide¶
Simple JChem PostgreSQL Cartridge highly available step by step setup (as of 2021 December) is available here. It does not contain any specific configuration related to database size (e.g. number of structures), or performance tuning. Use it as a starting point for highly available setup followed by custom settings.
General HA installation guide¶
Installation on master¶
Requirements: have PostgreSQL and Java installed. (See JChem PostgreSQL Cartridge requirements.)
-
Download jchem-psql .deb or .rpm package and run package installation and license file setting as required by your operating system.
-
Add a user that is going to have access and a database that stores the JPC index data (in our example both are
jpc) to the PostgreSQL database. -
Before running service init set the following parameter values in the
/etc/chemaxon/jchem-psql.conffile (URL, user and password should be modified according to your JPC index data user and database created beforehand):
-
The file hazelcast.xml should be already available in the /etc/chemaxon/ directory. (If not, you can download it from here. In the given file hazelcast discovery is set to TCP/IP, which means that hazelcast instances that are listed with their IP address in the member list will find each other and form a cluster. Change the IP addresses to your current cluster (master and slave) IP address.
<member-list> <member>172.31.1.8</member> <member>172.31.10.238</member> </member-list>
To change hazelcast behavior modify the network settings in the file. -
Change the
postgresql.conffile:
-
Set up synchronization mode to synchronous or asynchronous by setting the parameters
synchronous_commitandsynchronous_standby_names.
To make it synchronous setsynchronous_committo on andsynchronous_standby_namesto a valid value different than empty string, we tried ‘*’ which means that all slaves will have synchronous commits. By settingsynchronous_committo off or settingsynchronous_standby_namesto empty string the commits become asynchronous. -
Set up the allowed replication connections in the
pg_hba.conffile as required in your system so that the slave PostgreSQL node can reach the master. -
Restart PostgreSQL server.
-
Init jchem-psql service:
-
Start jchem-psql service:
sudo service jchem-psql startlisten_addresses = ‘*’ recovery_target_timeline = ‘latest’ hot_standby = onsudo su postgres rm -rf /var/lib/postgresql/12/main pg_basebackup -D /var/lib/postgresql/12/main -h 172.31.1.8 -X stream -c fast -R sudo service jchem-psql start