Getting started with chef

Set up a ubuntu node and run recipe on it

Predication:

  1. a running ubuntu node which accessiable via SSH from your labtop(workstation)
  2. cd to chef-repo directory.

    Steps:


    Bootstrap ububtu:
knife bootstrap IP_ADDRESS -x USERNAME -P PASSWORD --sudo


Verify the installation completed
knife client list

you will see your nodename in the client list

Download cookbooks from community site
knife cookbook site install getting-started

the cookbook named “getting-started” will be downloaded into chef-repo/cookbooks/

Upload the recipe to Hosted Chef so it is available for our nodes
knife cookbook upload getting-started 


Add this new recipe to the new nodes run list
knife node run_list add NODENAME 'recipe[getting-started]'


Run the added recipe remotely via ssh
knife ssh name:NODENAME -x USERNAME -P PASSWORD "sudo chef-client" -a ipaddress


Runnig chef-client as a deamon
knife cookbook site install chef-client
knife cookbook upload chef-client
knife node run_list add NODENAME 'recipe[chef-client]'
knife ssh name:NODENAME -x USERNAME -P PASSWORD "sudo chef-client" -a ipaddress


Advanced tips:

  • add recipe when bootstrap node
knife bootstrap IP_ADDRESS -r 'recipe[chef-client]' -x USERNAME -P PASSWORD --sudo

using pyinvoke for task automation

The main activities for developers to work in a codebase are the following: make some changes, run tests, package and upload some artifac...… Continue reading

Implementing CorrelationID In Kafka Stream

Published on October 20, 2024