Replicate two Chef Servers


#1

Hi, we have to setup multiple Chef Servers in different regions and we have to make them sync to share same cookbooks, roles, etc.

https://docs.chef.io/server_replication.html - this topic is DEPRECATED

any idea how we can achieve this by using chef Automate ?


#3

Many if not most chef admins publish all roles, cookbookse, etc. from an active git repo, which is easy to replicate and upload. The tricky part is that there can be multiple cookbooks with the same name and different versions. That takes some attention to load, correctly, because the “knife cookbook load” command has no support for simply saying “load this cookbook from this directory”. It insists on looking inside a parent directory, for no good reason I’ve ever been able to detect, and that means that downloading all the cookbooks into the same directory and simply loading them one after another does not work. The “I think I’m smarter than you could possibly be” approach of insisting that the “cookbooks” directory could only have one copy of any particular cookbook is a mistaken and unnecessary practice.

That said, you can look into my backup tool at https://github.com/nkadel/nkadel-chef-local-wrapper/blob/master/backup-chef.sh for a very lightweight tool, usable for getting pretty full backups to feed to another server. It doesn’t touch the “chef server” attributes of organizations an dusers. That would be another exercise.


#4

Oh, yes. I realized. Is one server considered canonical, and all changes happen there first for publication to the other? If you make changes to the other server locally, such as modifying roles or environments, you’ll need to resolve the split-brain to match changes from the other.


#5

yes, we have one primary Chef server where we will deploy all our development activities to this primary/master server. and other regional Chef servers should be replicated by Chef Automate.
all cookbooks, roles etc to be sync with primary server