Skip to end of metadata
Go to start of metadata

Before Upgrading

Before upgrading, make sure you have backups that you can recover from. When you're ready to proceed, stop the chef-server, chef-server-webui, chef-solr, and chef-solr-indexer on the server, and chef-client on the clients.

Make sure the 'merb' processes for the chef-server and chef-server-webui are no longer running. They will look like this when running (port 4000 is the chef-server, port 4040 is the chef-server-webui):

Install gecode on the Servers

Gecode is a pre-requisite of dep_selector gem, which Chef Server depends on. It's only needed on the server side.


Install Using Deb Package

On Ubuntu lucid, maverick, or Debian lenny release, you can install gecode deb package from the Opscode APT repository.

Add the Opscode APT Repository

Create /etc/apt/sources.list.d/opscode.list.

/etc/apt/sources.list.d/opscode.list
  • For Chef 0.9.x, replace codename with the supported distribution codename, such as "lucid".
  • For Chef 0.10.x, replace codename with the codename, suffixed with "-0.10", for example, "lucid-0.10".

If you would like to be able to download source packages, add an additional identical line, but change deb to deb-src line.

You can copy and paste these examples to create the necessary sources.list entry:

Ubuntu for Chef 0.9.x
Ubuntu for Chef 0.10.x

Debian users will likely need to run 'apt-get install sudo wget lsb-release' as root before pasting the examples.

Add the GPG Key and Update Index

Before you install the packages, make sure you add the Opscode GPG key to apt.

Issues downloading from gnupg.net?
If you get an error when trying to download the key that states that the "keyserver timed out", try downloading the key directly from our apt repository instead:

Afterwards you'll also want to run this command again:

Now, we update apt-get with the newly added Opscode repository:

Installing the opscode-keyring package will keep the key up-to-date:

Upgrade Existing Packages

To ensure you are using the latest versions of libraries that chef depends on, you may wish to update your existing packages:

Install deb package

Build and Install from Source

Upgrade Chef Server

For RubyGems installation:

For a Debian/Ubuntu installation:

Upgrade Chef Solr and Install Chef Expander

Chef 0.10 includes an upgraded version of Solr and uses a different schema with Solr, so you will need to upgrade Solr and then rebuild the index. Before doing anything, make sure to back up your Solr Data directory. By default the data directory is located at /var/chef/solr/data, though it may be located elsewhere if you've installed from packages or customized the installation. You can backup your Solr data by stopping Solr and making a copy of the data directory and its contents.

Upgrade Solr

For a Debian/Ubuntu installation:

Skip chef-solr-installer on Ubuntu/Debian
Skip this section on upgrading Solr if you're upgrading using debs on Ubuntu/Debian. The deb packages automatically install this for you. If you get complaints about "start.config" not being found when launching chef-solr after the upgrade, try running:

You will need to rebuild your indexes after the upgrade. To do so, run:

Once your data is backed up, run chef-solr-installer to upgrade your Chef Solr installation. Answer "yes" when prompted for confirmation. The process should look like this:

yourshell> chef-solr-installer 
Configuration setting solr_heap_size is unknown and will be ignored

Chef Solr is already installed in /var/chef/solr
Do you want to overwrite the current install? All existing Solr data will be lost. [y/n] y
Removing the existing Chef Solr installation
  rm -rf /var/chef/solr
  rm -rf /var/chef/solr-jetty
  rm -rf /var/chef/solr/data
Creating Solr Home Directory
  mkdir -p /var/chef/solr
  entering /var/chef/solr
  tar zxvf /Users/ddeleo/opscode/chef/chef-solr/solr/solr-home.tar.gz
Creating Solr Data Directory
  mkdir -p /var/chef/solr/data
Unpacking Solr Jetty
  mkdir -p /var/chef/solr-jetty
  entering /var/chef/solr-jetty
  tar zxvf /Users/ddeleo/opscode/chef/chef-solr/solr/solr-jetty.tar.gz

Successfully installed Chef Solr.
You can restore your search index using `knife index rebuild`

Replace Chef Solr Indexer with Chef Expander

In Chef 0.10+, chef-solr-indexer is replaced by Chef Expander. Complete documentation for Chef Expander is provided on the Chef Indexer architecture page.. To start Chef Expander using your existing solr.rb configuration:

shell> chef-expander -n 1

If you wish to use a configuration file other than /etc/chef/solr.rb, pass the config file with -c:

shell> chef-expander -n 1 -c /etc/custom-location/config-file.rb

Make Chef Expander a runit Service

If you manage the Chef-Server with chef-solo, you can use the update your cookbook that manages the server to add Chef Expander as a runit service.

For example:

In the recipe you use through chef-solo to manage your server

Add templates sv-chef-expander-run.erb

Add template sv-chef-expander-log-run.erb

Make sure you remove chef-server-indexer from your recipe before running chef-solo.

Remove Chef-Solr-Indexer Service

Delete chef-solr-indexer in /etc/sv, /etc/service/ and /etc/init.d.

Start the Services

This is handled by the deb packaging for you.

Upgrade Clients

Upgrading the clients can now be done. Simply install the new gem or package and restart the chef-client service.

Debian packaging; the service will be stopped and started for you.

Rebuild Your Index

Once Solr has been upgraded and you have chef-expander and all other chef-server services running, you can rebuild your index by running knife index rebuild from whatever machine you normally run knife from.

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Apr 29, 2011

    chef-expander-cluster is no longer there apparently. May I replace it with chef-expander -n1 to launch it?

    Running chef-expander-0.10.0.rc1

    1. Apr 29, 2011

      Yes, we changed the names to be less confusing and missed a few spots when we updated the documentation. Now chef-expander is the recommended way to run it, and chef-expander-vnode is there for very advanced use cases.

  2. May 04, 2011

    Additionally, the --pre flag passed to 'gem install chef chef-server' is also unnecessary now

  3. May 19, 2011

    Impatient as I was I wanted to upgrade before the Ubuntu deb's were released. So I wiped the deb install and did the ruby gem install.

    Once the chef-solo bootstrap was complete I started up all the services and tried things out. Didn't work. Couldn't do the


    Additionally rabbitmq started filling up the disk quickly.

    The solution was to simply update the rabbitmq password:

    . After that all seems to be okay.

  4. Jul 13, 2011

    Before i did my upgrade I put an iptables rule in place to stop connections. We have recipes that depend on search and they would have failed while the index was being rebuilt. It also allowed the index to rebuild faster as it wasn't competing with the clients for cpu time.

    Blocks connections (You may need to adjust your interface to match)
    iptables -A INPUT -p tcp -i eth0 --dport 4000 -j DROP

    Re-enables connections
    iptables -D INPUT -p tcp -i eth0 --dport 4000 -j DROP

    I also found I needed to restart couchdb and the rabbitmq-server for it to work. Not sure if that is normal but it was my experience, ymmv