Creating subscriber nodes with base backups
In addition to the SQL-level node and subscription creation, Spock also
supports creating a subscriber node by cloning the provider with pg_basebackup
and
starting it up as a Spock subscriber. Use the spock_create_subscriber
tool
(located in the bin
directory of your pgEdge platform installation) to register the node.
Synopsis:
spock_create_subscriber [OPTION]...
Options
Specify the following options as needed.
Option | Description |
---|---|
-D , --pgdata=DIRECTORY | data directory to be used for new node. This can be either empty/non-existing directory, or directory populated using the pg_basebackup -X stream command. |
--databases | optional list of databases to replicate |
-n , --subscriber-name=NAME | name of the newly created subscriber |
--subscriber-dsn=CONNSTR | connection string to the newly created subscriber |
--provider-dsn=CONNSTR | connection string to the provider |
--replication-sets=SETS | comma separated list of replication set names |
--apply-delay=DELAY | apply delay in seconds (by default 0) |
--drop-slot-if-exists | drop replication slot of conflicting name |
-s , --stop | stop the server once the initialization is done |
-v | increase logging verbosity |
--extra-basebackup-args | Additional arguments to pass to pg_basebackup . Safe options: -T , -c , --xlogdir /--waldir |
Configuration files overrides
You can use the following options to override the location of the configuration files.
Option | Description |
---|---|
--hba-conf | path to the new pg_hba.conf |
--postgresql-conf | path to the new postgresql.conf |
--recovery-conf | path to the template recovery configuration |
Unlike spock.sub_create
's data sync options, this clone ignores
replication sets and copies all tables on all databases. However, it's often
much faster, especially over high-bandwidth links.