This page in other versions: 0.9 / 1.0 / 1.0.3

6.1. bdr_init_copy

The bdr_init_copy command is used to initialize a new UDR/BDR node by making physical copy of an existing node and establishing a connection to the node that the clone was made from.

Note: Using bdr_init_copy will clone all databases from the origin server, but only connect one database as a subscriber.

See Node management for more information about node creation.

bdr_init_copy [option...]

6.1.1. Options

The following command-line options control the behaviour of bdr_init_copy.

-D directory
--pgdata=directory

Data directory of the new node.

This can be either directory made using pg_basebackup of the source node or empty directory. In case of empty directory, the full backup of the source node will be made.

-n nodename
--node-name=nodename

Name of the new node.

--replication_sets=sets

Comma separated list of replication set names to use.

-s

Stop the node after creation. The default behavior is to start the new node once it's setup.

--postgresql-conf=postgresql.conf

Path to postgresql.conf file which will be used by the new node. If not specified, the postgresql.conf will be copied from the source node.

--hba-conf=hba.conf

Path to hba.conf file which will be used by the new node. If not specified, the hba.conf will be copied from the source node.

--recovery-conf=recovery.conf

Path to recovery.conf template file which will be used during the physical initialization of the node.

This parameter is useful if you can't use streaming replication for initial synchronization and you want to use archive_command instead.

The following command-line options specify the source node to connect to.

-d dbname
--remote-dbname=dbname

Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line.

If this parameter contains an = sign or starts with a valid URI prefix (postgresql:// or postgres://), it is treated as a conninfo string.

-h host
--remote-host=host

Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.

-p port
--remote-port=port

Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.

-U username
--remote-user=username

User name to connect as.

The following command-line options specify local connection to the newly created node.

--local-dbname=dbname

Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line.

If this parameter contains an = sign or starts with a valid URI prefix (postgresql:// or postgres://), it is treated as a conninfo string.

--local-host=host

Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.

--local-port=port

Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.

--local-user=username

User name to connect as.