Gangmax Blog

Install Chef Server and Client

Here is the definition from “http://docs.opscode.com“ of “Chef”:

Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each Chef organization is comprised of one (or more) workstations, a single server, and every node that will be configured and maintained by Chef. Cookbooks (and recipes) are used to tell Chef how each node in your organization should be configured. The chef-client (which is installed on every node) does the actual configuration.

In this article, I want to record how to install Chef server and client.

Chef Server Installation

Here is a guide how to install chef server. Another article is also referred.

First, get the chef server binary installation file from here. Note that you need to click the “Chef Server” tab and select your OS name, version and arch, then you will get the binary file URL which can be used to download the installation file. In my case, the file “chef-server-11.0.8-1.el6.x86_64.rpm” size is 170MB.

Then put this file to your server(supposed to be act as the Chef server) and install it:

1
2
3
4
sudo rpm -Uvh chef-server-11.0.8-1.el6.x86_64.rpm # Install
sudo chef-server-ctl reconfigure # Configure and start: This runs the embedded chef-solo with the included cookbooks, and sets up everything required – Erchef, RabbitMQ, PostgreSQL, etc.
# Optional
sudo chef-server-ctl test # Run the Opscode Pedant test suite. This will verify that everything is working.

Now the Chef server is ready.

Chef Client Installation

Here is a guide how to install Chef client. Note that every computer(workstation, server) which is supposed to be managed by Chef server should install the Chef client.

First, here is the installation command:

1
curl -L http://www.opscode.com/chef/install.sh | sudo bash

When the installation step finishes, run the following commands to verify the installation:

1
2
ef-client -v
# Output: Chef: 10.12.0

Configure Chef client to make it work with Chef server

  1. Clone the Chef repository

  2. Get the three server files needed by client

  3. Move the three files to “.chef” directory

  4. Verify the Chef install

Comments