bihactl — create a high-availability cluster in Postgres Pro
bihactl add [options]
bihactl init [options]
bihactl status [options]
bihactl -V | --version
bihactl -? | --help
bihactl is a utility that allows you to create, manage, and monitor a high-availability cluster in Postgres Pro by means of the following commands:
bihactl init used to
initialize a cluster and set the leader node. When this command is
executed, bihactl accesses the
initdb utility, at this stage you can also
specify its parameters with the -o option.
bihactl add used to add
follower nodes to the configured leader node. When this command is
executed, a backup of the leader node is created by means of
pg_basebackup or pg_probackup.
The backup utility can be set with the -m option,
while the parameters of the selected backup are specified with the
-O option.
bihactl status used to
check the status of cluster nodes.
The follower node can be added using a magic string saved after the
bihactl init command by adding
the -s option to the bihactl
add command.
Syntax:
bihactl add [-c | --convert-standby]
[-D | --pgdata=datadir]
[-f | --magic-file=magic_file]
[-h | --host=host]
[-I | --biha-node-id=node_id]
[-l | --use-leader=conn_info]
[-m | --backup-method=backup_method]
[-O | --backup-options=backup_options]
[-p | --port=port]
[-P | --biha-port=biha_port]
[-s | --magic-string=magic_string]
Add a follower node to the initialized cluster. This command can take the following options:
-c--convert-standbyConverts an existing node to make it a follower node in the high-availability cluster. The node should be a leader node replica prior to the conversion.
-D datadir--pgdata=datadirSpecifies the directory where the database cluster should be stored.
-f magic_file--magic-file=magic_fileUses a magic file that contains encoded data to connect to the leader node.
-h host--host=hostSpecifies the node host for incoming connections.
-I node_id--biha-node-id=node_idSpecifies the unique ID of the node.
-l conn_info--use-leader=conn_infoSpecifies parameters to connect to the leader node in the following format:
host=leader_hostport=leader_portbiha-port=leader_biha_port
-m backup_method--backup-method=backup_method
Specifies the backup utility. The allowed values are
pg_basebackup and pg_probackup.
The default value is pg_basebackup.
-O backup_options--backup-options=backup_options
Specifies additional options of pg_basebackup or
pg_probackup depending on the backup utility
specified in the --backup-method option.
-p port--port=port
Specifies the node port for incoming connections. If the port is not
specified, it is taken from postgresql.conf
or set to default. The default value is 5432.
-P biha_port--biha-port=biha_port
Specifies the port used to exchange service information between nodes.
If not specified, the value is set to .
port
+ 1
-s magic_string--magic-string=magic_stringUses a magic string that contains encoded data to connect to the leader node.
Syntax:
bihactl init [-C | --convert]
[-D | --pgdata=datadir]
[-f | --magic-file=magic_file]
[-h | --host=host]
[-I | --biha-node-id=node_id]
[-M | --minnodes=min_node_num]
[-N | --nquorum=quorum_value]
[-o | --options=initdb_options]
[-p | --port=port]
[-P | --biha-port=biha_port]
[-S | --use-ssl]
[-Y | --sync-standbys=sync_standbys_num]
Initialize a cluster and set the leader node. This command can take the following options:
-C--convertConverts an existing node to make it the leader node in the high-availability cluster.
-D datadir--pgdata=datadirSpecifies the directory where the database cluster should be stored.
-f magic_file--magic-file=magic_fileUses a magic file that contains encoded data to connect to the leader node.
-h host--host=hostSpecifies the node host for incoming connections.
-I node_id--biha-node-id=node_idSpecifies the unique ID of the node.
-M min_node_num--minnodes=min_node_num
Specifies the minimum number of operational nodes for the leader node
to be open for write transactions. If not specified, the
nquorum value is used.
-N quorum_value--nquorum=quorum_valueSpecifies the number of operational nodes participating in the leader election. It is recommended that this value should be greater than a half of the number of nodes in the cluster so that the leader node can be elected by simple majority. For example, if you intend to have a cluster with 5 nodes, set the quorum value to 3.
-o initdb_options--options=initdb_optionsSpecifies additional options of initdb.
-p port--port=port
Specifies the node port for incoming connections. If the port is not
specified, it is taken from postgresql.conf
or set to default. The default value is 5432.
-P biha_port--biha-port=biha_port
Specifies the port used to exchange service information between nodes.
If not specified, the value is set to .
port
+ 1
-S--use-sslEnables the protected mode of the service information exchange between cluster nodes with SSL/TLS over the biha control channel.
-Y sync_standbys_num--sync-standbys=sync_standbys_num
Specifies the number of synchronous follower nodes to connect to the
leader node. It is recommended that this value should be less than
the value of the --minnodes option.
Syntax:
bihactl status [-f | --magic-file=magic_file] [-h | --host=host] [-p | --port=port] [-s | --magic-string=magic_string]
Check the node status. This command can take the following options:
-f magic_file--magic-file=magic_fileUses a magic file that contains encoded data to connect to the leader node.
-h host--host=hostSpecifies the node host for incoming connections.
-p port--port=port
Specifies the node port for incoming connections. If the port is not
specified, it is be taken from postgresql.conf
or set to default. The default value is 5432.
-s magic_string--magic-string=magic_stringUses a magic string that contains encoded data to connect to the leader node.
Syntax:
bihactl -V bihactl --version
Display the current version of the high-availability cluster.
Syntax:
bihactl -? bihactl --help
Display command-line help.