Skip to content

Instantly share code, notes, and snippets.

@Zak-Kent
Last active February 13, 2019 00:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zak-Kent/6d24c7aa892c0602dd34953a0e0dbbe5 to your computer and use it in GitHub Desktop.
Save Zak-Kent/6d24c7aa892c0602dd34953a0e0dbbe5 to your computer and use it in GitHub Desktop.
sync-stuff-locally

setting up pgcrypto, rbac and pdb_activity dbs

give superuser to puppetdb

- ext/dep/puppetdb/ext/bin/pdbbox-env psql -d puppetdb -U postgres
- ALTER USER puppetdb WITH SUPERUSER;

create aux dbs that pdbext needs

- ext/dep/puppetdb/ext/bin/pdbbox-env createdb -U puppetdb -E UTF8 -O puppetdb puppetdb_rbac
- ext/dep/puppetdb/ext/bin/pdbbox-env createdb -U puppetdb -E UTF8 -O puppetdb puppetdb_activity

add pgcrypto extension

- ext/dep/puppetdb/ext/bin/pdbbox-env psql -d puppetdb -U puppetdb
- CREATE EXTENSION pgcrypto; 

may need to add cinext extension

! if you hit: Postgresql: ERROR: type “citext” does not exist ! - add the cinext extension to puppetdb_activity and puppetdb_rbac dbs


changes needed in .conf files

  • add sync section (may only need this in one .conf file)

    sync {
         server_urls: "http://localhost:8080"
         allow-unsafe-cleartext-sync: true
       }
    
  • change any passwords to use the puppetdb password found in sandbox/pg/pgpass

  • change subname to use pg port specified when making sandbox

  • make sure any ports used are different between the two .conf files

running pdbext locally with sandbox

  • ext/dep/puppetdb/ext/bin/pdbbox-env lein run services --config dev-resources/example.conf --bootstrap-config dev-resources/bootstrap.cfg
  • run some version of the command above for both instances
  • run benchmark against the instance listening on 8080, sync will then be triggered with the other
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment