Showing posts with label chef-install. Show all posts
Showing posts with label chef-install. Show all posts

Tuesday, February 2, 2016

CHEF – Installing a Standalone CHEF Server


Hosted CHEF is a common practice and is a good way to start learning CHEF. But at times you don’t have access to the internet and hence that makes it difficult to keep working. I am getting my hands across CHEF these days and wanted to setup my own (standalone) CHEF server. I have the following setup:
A MAC machine that is my desktop – I’ll be installing the CHEF DK here and this will be my workstation.
A Linux VirtualBox server (mychef.mydomain.com) – This will be the CHEF server.
A Linux VirtualBox server (oel1.mydomain.com) – This will be the CHEF client.
This post will cover installing the standalone CHEF server. From here download the CHEF server RPM. In my case it was chef-server-core-12.3.1-1.el6.x86_64.rpm. From here download the CHEF manage rpm (chef-manage-2.1.1-1.el6.x86_64.rpm). And finally from here download the CHEF reporting rpm (opscode-reporting-1.5.6-1.el6.x86_64.rpm).  Place all the RPMs in a location that is accessible from the VirtualBox servers. I have setup a shared folder on my MAC and I share that across all my VirtualBox servers over NFS. In this example, all rpms are located at /oracle/stage.
Step 1: Install CHEF Core
From the command prompt on the CHEF server (mychef), execute the following:
[root@mychef ~]rpm -iv /oracle/stage/chef-server-core-12.3.1-1.el6.x86_64.rpm
Preparing packages for installation...
chef-server-core-12.3.1-1.el6
[root@mychef ~]#
Step 2: Install CHEF Manage
[root@mychef ~]# rpm -iv /oracle/stage/chef-manage-2.1.1-1.el6.x86_64.rpm
Preparing packages for installation...
chef-manage-2.1.1-1.el6
Thank you for installing the Chef Management Console add-on!
The next step in the process is to run:
chef-manage-ctl reconfigure
[root@mychef ~]#
Don’t run the reconfigure command just yet.
Step 3: Install CHEF Reporting
root@mychef ~]# rpm -iv /oracle/stage/opscode-reporting-1.5.6-1.el6.x86_64.rpm
Preparing packages for installation...
opscode-reporting-1.5.6-1.el6
Thank you for installing the Opscode reporting addon!
[root@mychef ~]#
Step 4: Configure CHEF Core
[root@mychef ~]# chef-server-ctl reconfigure
Starting Chef Client, version 12.5.1
resolving cookbooks for run list: ["private-chef::default"]
Synchronizing Cookbooks:
  - enterprise (0.5.1)
  - private-chef (0.1.0)
  - apt (2.7.0)
  - yum (3.6.0)
  - openssl (4.4.0)
  - runit (1.6.0)
.
.
. (lines truncated)
Running handlers:
Running handlers complete
Deprecated features used!
  Cannot specify both default and name_property together on property path of resource yum_globalconfig. Only one (name_property) will be obeyed. In Chef 13, this will become an error. at 1 location:
    - /opt/opscode/embedded/cookbooks/cache/cookbooks/yum/resources/globalconfig.rb:76:in `class_from_file'
Chef Client finished, 369/483 resources updated in 02 minutes 50 seconds
Chef Server Reconfigured!
[root@mychef ~]#
Step 5: Configure CHEF Manage
root@mychef ~]# chef-manage-ctl reconfigure
Starting Chef Client, version 12.4.1
resolving cookbooks for run list: ["omnibus-chef-manage::default"]
Synchronizing Cookbooks:
  - omnibus-chef-manage
  - chef-server-ingredient
  - enterprise
  - private_chef_addon
  - runit
  - unicorn
  - packagecloud
  - build-essential
  - yum
  - yum-epel
Compiling Cookbooks...
.
.
. (lines truncated)
Running handlers:
Running handlers complete
Chef Client finished, 63/89 resources updated in 46.284372132 seconds
chef-manage Reconfigured!
Step 6: Configure CHEF Reporting
[root@mychef ~]# opscode-reporting-ctl reconfigure
Starting Chef Client, version 12.6.0
resolving cookbooks for run list: ["opscode-reporting::default"]
Synchronizing Cookbooks:
  - enterprise (0.3.0)
  - opscode-reporting (0.2.0)
  - runit (1.3.0)
  - build-essential (2.2.3)
  - yum (3.6.1)
Compiling Cookbooks...
Recipe: opscode-reporting::default
.
.
Running handlers complete
Deprecated features used!
  Cannot specify both default and name_property together on property path of resource yum_globalconfig. Only one (name_property) will be obeyed. In Chef 13, this will become an error. at 1 location:
    - /opt/opscode-reporting/embedded/cookbooks/cache/cookbooks/yum/resources/globalconfig.rb:76:in `class_from_file'
Chef Client finished, 37/55 resources updated in 20 seconds
opscode-reporting Reconfigured!
Step 7: Check if services are up:
[root@mychef ~]# chef-server-ctl status
run: bookshelf: (pid 6592) 504s; run: log: (pid 5479) 550s
run: nginx: (pid 8334) 80s; run: log: (pid 6212) 511s
run: oc_bifrost: (pid 6353) 509s; run: log: (pid 4821) 620s
run: oc_id: (pid 6408) 508s; run: log: (pid 4893) 610s
run: opscode-erchef: (pid 6680) 502s; run: log: (pid 5648) 544s
run: opscode-expander: (pid 6504) 505s; run: log: (pid 5131) 595s
run: opscode-expander-reindexer: (pid 6550) 504s; run: log: (pid 5334) 556s
run: opscode-reporting: (pid 8347) 79s; run: log: (pid 8307) 82s
run: opscode-solr4: (pid 6460) 506s; run: log: (pid 5086) 598s
run: postgresql: (pid 6330) 509s; run: log: (pid 4307) 636s
run: rabbitmq: (pid 6237) 510s; run: log: (pid 2898) 658s\
run: redis_lb: (pid 5908) 526s; run: log: (pid 5901) 526s
[root@mychef ~]# chef-manage-ctl status
run: events: (pid 7353) 175s; run: log: (pid 7363) 173s
run: redis: (pid 7504) 164s; run: log: (pid 7316) 179s
run: web: (pid 7514) 163s; run: log: (pid 7438) 169s
run: worker: (pid 7455) 166s; run: log: (pid 7485) 164s
Step 8: Create an Administrator for CHEF
[root@mychef opscode]# chef-server-ctl user-create admin admin admin admin@foo.com welcome1 --filename /opt/opscode/admin.pem
Step 9: Create an Organization for CHEF
[root@mychef opscode]# chef-server-ctl org-create adminorg "admin org" --association_user admin
Step 10: Login to CHEF UI
From a browser, open https://mychef.mydomain.com (add the certificate exceptions to your browser)

-->
Enter the user credentials you created in Step 8 and Sign in.
 
--> Your CHEF server configurations are now complete.