ltcluster witness register — add a witness node's information to the ltcluster metadata
ltcluster witness register
adds a witness server's node
record to the ltcluster metadata, and if necessary initialises the witness
node by installing the ltcluster extension and copying the ltcluster metadata
to the witness server. This command needs to be executed to enable
use of the witness server with ltclusterd.
When executing ltcluster witness register
, database connection
information for the cluster primary server must also be provided.
In most cases it's only necessary to provide the primary's hostname with
the -h
/--host
option; ltcluster will
automatically use the user
and dbname
values defined in the conninfo
string defined in the
witness node's ltcluster.conf
, unless these are explicitly
provided as command line options.
The primary server must be registered with ltcluster primary register
before the witness
server can be registered.
Execute with the --dry-run
option to check what would happen
without actually registering the witness server.
$ ltcluster -f /etc/ltcluster.conf witness register -h node1 INFO: connecting to witness node "node3" (ID: 3) INFO: connecting to primary node NOTICE: attempting to install extension "ltcluster" NOTICE: "ltcluster" extension successfully installed INFO: witness registration complete NOTICE: witness node "node3" (ID: 3) successfully registered
--dry-run
Check prerequisites but don't actually register the witness
-F
/--force
Overwrite an existing node record
A witness_register
event notification will be generated.