12/7/2023 0 Comments Ubuntu configure postgresql![]() ![]() Here we use systemctl edit pgpool2 command to modify the unit file and add the following configuration: ![]() If you want to ignore the pgpool_status file at startup, modify ExecStart in systemd unit file. $ ssh-copy-id -i id_rsa_pgpool.pub starting Pgpool-II, if the pgpool_status file exists, Pgpool-II will read the PostgreSQL servers status (up/down) from the pgpool_status file. # ssh-copy-id -i id_rsa_pgpool.pub su - postgres To run the failover script, you must allow passwordless SSH to all PostgreSQL servers.īecause in this tutorial the PostgreSQL servers and Pgpool-II are running on the local machine, run the following commands to allow passwordless SSH to localhost. If you installed PostgreSQL using PostgreSQL APT repository, PostgreSQL should be installed under /usr/lib/postgresql/14 directory. # cp -p /usr/share/doc/pgpool2/examples/scripts/failover.sh.sample /etc/pgpool2/failover.shīasically, it should work if you replace PGHOME using your PostgreSQL installation directory. The sample scripts are installed under /usr/share/doc/pgpool2/examples/scripts/ directory. # apt-get -y install pgpool2 libpgpool2 postgresql-14-pgpool2 Configure Pgpool-IIĮdit /etc/pgpool2/nf and add your PostgreSQL servers configurations:īackend_data_directory0 = '/var/lib/postgresql/main'īackend_data_directory1 = '/var/lib/postgresql/standby'įailover_command = '/etc/pgpool2/failover.sh %d %h %p %D %m %H %M %P %r %R %N %S' ![]() Specify the specific version of PostgreSQL which you are using, e.g. # apt-get updateInstall the latest version of Pgpool-II. # wget -quiet -O - | sudo apt-key add -Update the package lists: # echo "deb $(lsb_release -cs)-pgdg main" > /etc/apt//pgdg.listImport the repository signing key: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |