gsandie online notebook

Replicated chef

Starting a work project to replicate the chef servers. I’ve done some POC in the lab, now to out it in practice.

Notes, thoughts, ramblings are below:

  • start off with a clean and fresh chef server, setup knife and your repo

  • use git for the repo

  • use couchdb 0.11

  • config couch to bind to a remotely accessible ip, not strictly needed, but could be handy

  • add a couchdb_url (check syntax) and set to the ip/port that couch is on (else failure will occur!!)


  • rinse and repeat the above on a second box


  • use ntp on both!!

At this state you have two working chef instances. Remember that the chef bootstrap install will define a random admin password that is set in the server.rb

  • on your second machine remove the client.pem and validate.pem files

  • copy the validate.pem from machine one onto machine two (you need this to register machine two as a client)


  • make sure you have curl installed


  • create a file with the following json:

{“source”:”http://:”,”target”:”http://:”,”continuous”:true}

  • setup replication by feeding the json to couch:

$ curl -d @json-file -H “Content-Type: application/json” http://:/_replicate

  • replication should now be working, you can test it by hitting http://:/_utils you’ll get the web interface


  • ensure your repo is available on both of the hosts - outstanding task is to sort out automatic pulls to the slaves when there is an update on the master


You should now be able to register a client against the master and then update that master against the master or the slave.

Still need some further testing and work on getting the repos being synced out. Also need to setup git/svn gateways as most the debs are using svn.