2.5. Preparing the standby

On the standby, do not create a LightDB instance (i.e. do not execute initdb or any database creation scripts provided by packages), but do ensure the destination data directory (and any other directories which you want LightDB to use) exist and are owned by the lightdb system user. Permissions must be set to 0700 (drwx------).

Tip

ltcluster will place a copy of the primary's database files in this directory. It will however refuse to run if a LightDB instance has already been created there.

Check the primary database is reachable from the standby using ltsql:

    ltsql 'host=node1 user=ltcluster dbname=ltcluster connect_timeout=2'

Note

ltcluster stores connection information as libpq connection strings throughout. This documentation refers to them as conninfo strings; an alternative name is DSN (data source name). We'll use these in place of the -h hostname -d databasename -U username syntax.