If the initdb command is not found, refer to this StackOverflow answer. For PostgreSQL 9.3, the command was found in: /usr/lib/postgresql/9.3/bin/initdb
We also had to create the directory that holds the database cluster:
sudo -p mkdir /usr/local/var/postgres
When we ran initdb, we got this error:
The files belonging to this database system will be owned by user "kevin".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /usr/local/var/postgres ... initdb: could not change permissions of directory "/usr/local/var/postgres": Operation not permitted
So I then ran: sudo apt-get install postgres-xc postgres-xc-client
I tried to pg_ctl again, but got an error: pg_ctl: Coordinator or Datanode option not specified (-Z)
This just means we need to make a data node.
Run:
sudo mkdir -p /usr/local/pgsql/data3
initdb -D /usr/local/pgsql/data3 --nodename data_node_3