Chef – couchdb migration

So turned out to be pretty easy to move my chef info from my old CentOS system to the new Ubuntu host once chef was installed

So turned out to be pretty easy to move my chef info from my old CentOS system to the new Ubuntu host once chef was installed (see http://mrmiller.nonesensedomains.com/2009/11/18/ubuntu-9-10-karmic-and-chef/ )

On the CentOS 5.3 host running Chef: 0.7.8 and couchdb – Apache CouchDB 0.9.0:

/etc/init.d/couchdb stop

I then copied /var/lib/couchdb/chef.couch to my admin nfs share, so I could pull it over to the new host.

On the Ubuntu host running Chef: 0.7.14 and couchdb – Apache CouchDB 0.10.0:

/etc/init.d/couchdb stop
/etc/init.d/chef-server stop
# backup old DB ..
cp /var/lib/couchdb/0.10.0/chef.couch /tmp/
cp /myadminmount/chef.couch to /var/lib/couchdb/0.10.0/chef.couch
chown couchdb:couchdb /var/lib/couchdb/0.10.0/chef.couch
/etc/init.d/couchdb start
/etc/init.d/chef-server start

So during the move I went from couch 0.9 to 0.10 and based on my reading it the DB is updated by simply running a compact.

curl -X POST http://localhost:5984/chef/_compact

At this point I just had to copy my cookbooks and site-cookbooks over to the Ubuntu host, which did bring up one problem. The default install of opscode chef does not enable site cookbooks so I had to edit /etc/chef/server.rb and update the cookbook_path and restart chef-server.

#cookbook_path [ “/srv/chef/site-cookbooks”, “/srv/chef/cookbooks” ]
cookbook_path [ “/srv/chef/cookbooks” ]

to

cookbook_path [ “/srv/chef/site-cookbooks”, “/srv/chef/cookbooks” ]
#cookbook_path [ “/srv/chef/cookbooks” ]

Then:

/etc/init.d/chef-server restart

When I logged into the interface and saw my roles and did a successful chef-client run on the system, WOOT.

I am still having a problem on the other clients but just need to figure out whats going on.

/usr/lib/ruby/1.8/net/http.rb:2097:in `error!’: 400 “Bad Request” (Net::HTTPServerException)

Leave a Reply

Your email address will not be published. Required fields are marked *