OpenSource For You

Installing the Chef client

-

The Chef client needs to be installed in the client VM which we created using virt-manager. This process of preparing the Chef client is called bootstrapp­ing. We can install Chef client by downloadin­g it from https://downloads.Chef.io/Chef-client/redhat/.

Then, we need to install a tool called Ohai, which is used to synchronis­e various attributes to the nodes (client) at the start-up of the Chef client. Ohai collects data attributes from platform details, network usage, memory statistics, CPU usage, kernel health-check, host informatio­n including FQDN (fully qualified domain names) and statistica­l informatio­n. The private key created in Chef Server should be copied to all Chef clients so that two-way authentica­tion (a handshake) happens between server (public key) and client (private key) when there is any communicat­ion between Chef Server and the client.

To download the certificat­e key from the server to all connected Chef clients, we need to run the knife command as follows:

Now, when we bring up the Chef client, the following basic steps (also shown in Figure 6) happen in the background during client start-up. Please note that these are major steps in the client start-up, though there are many smaller steps involved in between these steps. This stage is explained in Figure 6.

run_ohai: This is the first step when we start the Chef client, where it loads the configurat­ion data as listed earlier. This is collected for each node of the Chef environmen­t and starts the Chef client.

Authentica­te/Register: This step is most important to bring up the Chef client into the secured environmen­t of the Chef set-up. If the authentica­tion is successful through the two-way handshake (public/private key authentica­tion), the client node is registered to the Chef Server so that it is entered into the Chef environmen­t and is available in the reporting UI of the Chef management console.

Load and run node: Here, the configurat­ion is loaded, and the client is authentica­ted and registered to the Chef Server environmen­t. The next step is to load the node and start the node machine.

Synchroniz­ecookbooks: This synchronis­es the cookbooks from the Chef Server. The cookbooks are stored in the storage of the Chef Server and loaded into the client machines through the Knife tool (pushed to all client nodes).

After this, the set-up is finalised. This saves the node state and finalises the client set-up. If any of these steps fail, the Chef client moves to start-up run_failed state and stops abnormally. We need to look into the log file to analyse the reason for the failure and fix it.

Now, run runs list to get the list of RUN_ID of the Chef client which is successful­ly running. This is done by executing the following command:

 ??  ?? Figure 6: Chef client start-up steps
Figure 6: Chef client start-up steps

Newspapers in English

Newspapers from India