Checking the replication
If all nodes are up and running, we can already run our first operations on the cluster. In our example, we will simply connect to pgpool and create a new database. The createdb
tool is a command-line tool that serves as abstraction for the CREATE DATABASE
command, which can be replicated by pgpool nicely. In our example, we simply create a database called xy
to see if replication works:
$ createdb xy -p 9999
To see if the command has been replicated as expected, we suggest connecting to both databases and seeing if the new database is present or not. In our example, everything has been working as expected:
$ psql xy -p 5433 -c "SELECT 1 AS x" x --- 1 (1 row)
Doing this basic check is highly recommended to make sure that nothing has been forgotten and everything has been configured properly.
One more thing, which can be highly beneficial when it comes to checking a running setup, is the pcp_pool_status
parameter. It will extract information about the current setup...