Skip to content

Instantly share code, notes, and snippets.

@begriffs
Created March 22, 2017 00:37
Show Gist options
  • Select an option

  • Save begriffs/938e762145395bcbbe7891ef564efdc3 to your computer and use it in GitHub Desktop.

Select an option

Save begriffs/938e762145395bcbbe7891ef564efdc3 to your computer and use it in GitHub Desktop.
Quick single-machine cluster
pg_dropcluster --stop 9.6 main
alias forall="echo -n 'master worker1 worker2' | xargs -d ' ' -n 1 -I '{}'"
forall pg_createcluster --locale en_US.UTF-8 --start 9.6 {}
forall pg_conftool 9.6 {} set shared_preload_libraries citus
forall pg_conftool 9.6 {} set listen_addresses '*'
forall pg_ctlcluster 9.6 {} restart
forall psql --cluster 9.6/{} -c "CREATE EXTENSION citus;"
psql -c "SELECT * from master_add_node('localhost', 5433);"
psql -c "SELECT * from master_add_node('localhost', 5434);"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment