Deploying server under CentOS


#1

Hi there!
I’ve been battling today trying to update my chef server to the latest
version (0.9.6) but have been a complete disaster. We run everything under
centos 5.3 so far, and I haven’t found much support in that area, since most
of the documentation / bootstrapping cookbooks mention mostly only ubuntu
support. What would you suggest to be the best course of action? I have a
very small environment of only 5 clients, preparing for a bigger future, so
scrapping everything can be considered. Would it be worth it to create a new
chef server on an ubuntu based system, keep battling, or just wait for the
rpm’s to be updated?

Is there anyone else hosting the server in a centos that can share his
experience?

{ :name => “Albert Llop” }


#2

I’m on centos for one client, running chef .7X

It should work, but as you say, it’s best to go ubuntu if you can. I’m in the process of moving all my systems to ubuntu not just because of chef, but it’s part of the reason.

Alex

On Jul 8, 2010, at 2:24 PM, Albert Llop wrote:

Hi there!
I’ve been battling today trying to update my chef server to the latest version (0.9.6) but have been a complete disaster. We run everything under centos 5.3 so far, and I haven’t found much support in that area, since most of the documentation / bootstrapping cookbooks mention mostly only ubuntu support. What would you suggest to be the best course of action? I have a very small environment of only 5 clients, preparing for a bigger future, so scrapping everything can be considered. Would it be worth it to create a new chef server on an ubuntu based system, keep battling, or just wait for the rpm’s to be updated?

Is there anyone else hosting the server in a centos that can share his experience?

{ :name => “Albert Llop” }


#3

It was a bit painful but I built my own set of RPMs for CentOS 4 (we run
a mixed environment of CentOS 4 and CentOS 5), for Chef 0.8.16.
I don’t have the bandwidth to test 0.9 at this point.

gem2rpm is your friend (assuming you have rpmbuild environment set up):
gem install gem2rpm

gem fetch shadow
gem2rpm shadow-1.1.gem > SPECS/rubygem-shadow.spec
rpmbuild -ba SPECS/rubygem-shadow.spec

You can build all of Chef’s ruby gem dependencies that way.
Then you can fetch ELFF’s latest rubygem-chef SRPM from
http://download.elff.bravenet.com/5/SRPMS/. You’d need to edit the spec
file a bit to make it work, but it can be done.

If and when I have time to test 0.9 and deploy across my org, I’ll
contribute.

-Paul

On 7/8/10 2:24 PM, Albert Llop wrote:

Hi there!
I’ve been battling today trying to update my chef server to the latest
version (0.9.6) but have been a complete disaster. We run everything
under centos 5.3 so far, and I haven’t found much support in that
area, since most of the documentation / bootstrapping cookbooks
mention mostly only ubuntu support. What would you suggest to be the
best course of action? I have a very small environment of only 5
clients, preparing for a bigger future, so scrapping everything can be
considered. Would it be worth it to create a new chef server on an
ubuntu based system, keep battling, or just wait for the rpm’s to be
updated?

Is there anyone else hosting the server in a centos that can share his
experience?

{ :name => “Albert Llop” }


#4

I amanged to have chef server working on CentOS up to 8.16 aswell, but 9.6
has just been completely impossible. I’ve managed to update it all, launch
all the services, but there’s no way in hell I can get to log in to the
webui admin.

Will try to get an ubuntu virtual machine working to save me some hassle in
the future, and if I can’t (or the boss doesn’t approve, which could be :P)
will try Paul’s tips! Thanks a lot!!

{ :name => “Albert Llop” }

On 9 July 2010 00:03, Paul Choi paulchoi@plaxo.com wrote:

It was a bit painful but I built my own set of RPMs for CentOS 4 (we run a
mixed environment of CentOS 4 and CentOS 5), for Chef 0.8.16.
I don’t have the bandwidth to test 0.9 at this point.

gem2rpm is your friend (assuming you have rpmbuild environment set up):
gem install gem2rpm

gem fetch shadow
gem2rpm shadow-1.1.gem > SPECS/rubygem-shadow.spec
rpmbuild -ba SPECS/rubygem-shadow.spec

You can build all of Chef’s ruby gem dependencies that way.
Then you can fetch ELFF’s latest rubygem-chef SRPM from
http://download.elff.bravenet.com/5/SRPMS/. You’d need to edit the spec
file a bit to make it work, but it can be done.

If and when I have time to test 0.9 and deploy across my org, I’ll
contribute.

-Paul

On 7/8/10 2:24 PM, Albert Llop wrote:

Hi there!
I’ve been battling today trying to update my chef server to the latest
version (0.9.6) but have been a complete disaster. We run everything under
centos 5.3 so far, and I haven’t found much support in that area, since most
of the documentation / bootstrapping cookbooks mention mostly only ubuntu
support. What would you suggest to be the best course of action? I have a
very small environment of only 5 clients, preparing for a bigger future, so
scrapping everything can be considered. Would it be worth it to create a new
chef server on an ubuntu based system, keep battling, or just wait for the
rpm’s to be updated?

Is there anyone else hosting the server in a centos that can share his
experience?

{ :name => “Albert Llop” }


#5

Hello!

On Jul 9, 2010, at 1:01 AM, Albert Llop wrote:

I amanged to have chef server working on CentOS up to 8.16 aswell, but 9.6 has just been completely impossible. I’ve managed to update it all, launch all the services, but there’s no way in hell I can get to log in to the webui admin.

Will try to get an ubuntu virtual machine working to save me some hassle in the future, and if I can’t (or the boss doesn’t approve, which could be :P) will try Paul’s tips! Thanks a lot!!

The RPMs currently install the Chef software as RubyGems, so you should be able to update the gems. The fun part is, the chef-server gems depend on merb 1.1, which depends on bundler, which depends on RubyGems 1.3.6+. So first, update RubyGems:

sudo gem update --system

(unlike debian/ubuntu, you can actually do this on CentOS :)).

Then update the gems by installing them by name:

sudo gem install chef chef-server-api chef-solr

Finally, restart the services.

for i in server solr solr-indexer
do
sudo service chef-$i restart
done

I just performed this update on a centos 5 test system and it worked, in that the client was able to run, and save, to the chef server. I didn’t test any cookbooks, though.


Opscode, Inc
Joshua Timberman, Senior Solutions Engineer
C: 720.334.RUBY E: joshua@opscode.com


#6

I finally got it all working today (kind of). Will try to write the problems I’ve had (next week though) and see if I was doing something wrong and if I contribute with something.

Thanks for the help!


{ :sent_from => “iPhone” }

On 09/07/2010, at 16:53, Joshua Timberman joshua@opscode.com wrote:

Hello!

On Jul 9, 2010, at 1:01 AM, Albert Llop wrote:

I amanged to have chef server working on CentOS up to 8.16 aswell, but 9.6 has just been completely impossible. I’ve managed to update it all, launch all the services, but there’s no way in hell I can get to log in to the webui admin.

Will try to get an ubuntu virtual machine working to save me some hassle in the future, and if I can’t (or the boss doesn’t approve, which could be :P) will try Paul’s tips! Thanks a lot!!

The RPMs currently install the Chef software as RubyGems, so you should be able to update the gems. The fun part is, the chef-server gems depend on merb 1.1, which depends on bundler, which depends on RubyGems 1.3.6+. So first, update RubyGems:

sudo gem update --system

(unlike debian/ubuntu, you can actually do this on CentOS :)).

Then update the gems by installing them by name:

sudo gem install chef chef-server-api chef-solr

Finally, restart the services.

for i in server solr solr-indexer
do
sudo service chef-$i restart
done

I just performed this update on a centos 5 test system and it worked, in that the client was able to run, and save, to the chef server. I didn’t test any cookbooks, though.


Opscode, Inc
Joshua Timberman, Senior Solutions Engineer
C: 720.334.RUBY E: joshua@opscode.com


#7

Hi all!
This is a resumed list of the problems I recall having. I wish it was more
detailed.

  • The nastiest one was discovering the problem with the json gem. I did
    uninstall json and reinstalled version 1.4.2, but still I only managed to
    have it all working when I uninstalled json_pure the same way. If you catch
    the exception on the put_rest method of lib/chef/rest.rb you’d get a weird
    JSON::SAFE_STATE_PROTOTYPE error. Since the exception wasn’t caught, it
    failed silently (in my case, when creating a new view in couchdb =>
    chef/lib/couchdb.rb line 95).
  • Another thing I found very very confusing was, the init.d scripts
    provided with the gem don’t have a reasonable $CONFIG default. For the
    chef-solr-indexer it’s “/etc/chef/solr-indexer.rb” and for the
    chef-server-webui it’s “/etc/chef/webui.rb”. The bootstrapping cookbook only
    creates solr.rb and server.rb config files. I think it’d make more sense if
    the scripts pointed to solr.rb and server.rb. It’s not so hard to debug this
    one, but it was very unexpected.
  • Another weird default for the init.d scritps is the pidfile, in the
    bootstrapping process you end up with config files pointing to
    /srv/chef/run/, whereas the init.d scripts provided use /var/run/chef/. Not
    weird, but also not quite expected.
  • On attribute definition, for example on the server_proxy recipe if you
    have:
    set_unless[:chef][:doc_root] =
    "#{languages[:ruby][:gems_dir]}/gems/chef-server-webui-#{chef[:server_version]}/public"
    It seems to generate the [:chef][:doc_root] attribute and save it. So
    when you update chef-server you have go to the webui and remove this
    attribute, or it will still point to older versions.

The first one was the worst, because I just couldn’t figure it out until I
dived into the code. The other ones were just a matter of time, but could
help in the future if they’re ironed out.
I’m not (yet) so lucky as to be working with chef full time, so apologies in
advance for not being able to contribute in a better way (opening tickets or
providing packages). Chef is awesome, I love it!

Thanks for the excellent work!

{ :name => “Albert Llop” }

On 9 July 2010 18:21, Albert Llop mrsimo@gmail.com wrote:

I finally got it all working today (kind of). Will try to write the
problems I’ve had (next week though) and see if I was doing something wrong
and if I contribute with something.

Thanks for the help!


{ :sent_from => “iPhone” }

On 09/07/2010, at 16:53, Joshua Timberman joshua@opscode.com wrote:

Hello!

On Jul 9, 2010, at 1:01 AM, Albert Llop wrote:

I amanged to have chef server working on CentOS up to 8.16 aswell, but
9.6 has just been completely impossible. I’ve managed to update it all,
launch all the services, but there’s no way in hell I can get to log in to
the webui admin.

Will try to get an ubuntu virtual machine working to save me some hassle
in the future, and if I can’t (or the boss doesn’t approve, which could be
:P) will try Paul’s tips! Thanks a lot!!

The RPMs currently install the Chef software as RubyGems, so you should
be able to update the gems. The fun part is, the chef-server gems depend on
merb 1.1, which depends on bundler, which depends on RubyGems 1.3.6+. So
first, update RubyGems:

sudo gem update --system

(unlike debian/ubuntu, you can actually do this on CentOS :)).

Then update the gems by installing them by name:

sudo gem install chef chef-server-api chef-solr

Finally, restart the services.

for i in server solr solr-indexer
do
sudo service chef-$i restart
done

I just performed this update on a centos 5 test system and it worked, in
that the client was able to run, and save, to the chef server. I didn’t test
any cookbooks, though.


Opscode, Inc
Joshua Timberman, Senior Solutions Engineer
C: 720.334.RUBY E: joshua@opscode.com


#8
  • Another thing I found very very confusing was, the init.d scripts
    provided with the gem don’t have a reasonable $CONFIG default. For the
    chef-solr-indexer it’s “/etc/chef/solr-indexer.rb” and for the
    chef-server-webui it’s “/etc/chef/webui.rb”. The bootstrapping cookbook only
    creates solr.rb and server.rb config files. I think it’d make more sense if
    the scripts pointed to solr.rb and server.rb. It’s not so hard to debug this
    one, but it was very unexpected.

I second the comment about the $CONFIG defaults. I was bootstrapping on
RedHat and ran into several problems but this one just seems like a bug in
the bootstrap recipe. I just copied the /etc/chef/solr.rb config file to
/etc/chef/solr-indexer.rb - is that a reasonable workaround?

Other problems:

  1. Unspecified dependency on runit (unless configured to use init).
  2. Gem installation can put executables in different place from where the
    init scripts expect them.
  3. service chef-solr stop doesn’t.

If I have time I’ll make patches &c.

Thanks,

-Ian