#!/bin/sh
slonik << _END_
#
# Define cluster namespace and node connection information
#
cluster name = gb;
node 1 admin conninfo = 'dbname=gb host=localhost port=5434 user=postgres';
node 2 admin conninfo = 'dbname=gb host=localhost port=5430 user=postgres';
node 3 admin conninfo = 'dbname=gb_replica host=localhost port=5430 user=postgres';
echo 'Cluster defined, nodes identified';

#
# Initialize the cluster and create the second node
#
store node (id=3, comment='gb_replica 8.0 5430');

#
# create paths
#
store path (server=1, client=3, conninfo='dbname=gb host=localhost port=5434 user=postgres');
store path (server=2, client=3, conninfo='dbname=gb host=localhost port=5430 user=postgres');
store path (server=3, client=1, conninfo='dbname=gb_replica host=localhost port=5430 user=postgres');
store path (server=3, client=2, conninfo='dbname=gb_replica host=localhost port=5430 user=postgres');

#
# Enable listening along each path
#
store listen (origin=1, receiver=3, provider=1);
store listen (origin=2, receiver=3, provider=2);
store listen (origin=3, receiver=1, provider=3);
store listen (origin=3, receiver=2, provider=3);

_END_

