Pro Puppet (58 page)

Read Pro Puppet Online

Authors: Jeffrey McCune James Turnbull

BOOK: Pro Puppet
13.97Mb size Format: txt, pdf, ePub

Listing 11-12.
Installing the MCollective client on Debian-based systems

$ mkdir /var/tmp/mcollective-client
$ cd /var/tmp/mcollective-client
$ wget http://www.puppetlabs.com/downloads/mcollective/mcollective-common_1.0.1-1_all.deb
$ wget http://www.puppetlabs.com/downloads/mcollective/mcollective-client_1.0.1-1_all.deb
$ sudo dpkg -i mcollective*.deb
Selecting previously deselected package mcollective-client.
(Reading database ... 40794 files and directories currently installed.)
Unpacking mcollective-client (from mcollective-client_1.0.1-1_all.deb) ...
Selecting previously deselected package mcollective-common.
Unpacking mcollective-common (from mcollective-common_1.0.1-1_all.deb) ...
Setting up mcollective-common (1.0.1-1) ...
Setting up mcollective-client (1.0.1-1) ...

In addition to the MCollective packages, the STOMP protocol Ruby library needs to be installed. This Ruby library is available in the standard package repositories. If your platform does not have the libstomp-ruby package, please install the library using the
gem install stomp
command. The packages provided by Ubuntu are shown in
Listing 11-13
.

Listing 11-13.
Installing the Ruby Stomp library on Debian

$ sudo aptitude install libstomp-ruby
The following NEW packages will be installed:
  libstomp-ruby libstomp-ruby1.8{a}
0 packages upgraded, 2 newly installed, 0 to remove and 82 not upgraded.
Need to get 7,204B of archives. After unpacking 94.2kB will be used.
Do you want to continue? [Y/n/?]  Y
Get:1 http://us.archive.ubuntu.com/ubuntu/ maverick/universe libstomp-ruby1.8 all
 1.0.4-2 [5,548B]
Get:2 http://us.archive.ubuntu.com/ubuntu/ maverick/universe libstomp-ruby all
 1.0.4-2 [1,656B]
Fetched 7,204B in 0s (9,951B/s)
Selecting previously deselected package libstomp-ruby1.8.
(Reading database ... 48472 files and directories currently installed.)
Unpacking libstomp-ruby1.8 (from .../libstomp-ruby1.8_1.0.4-2_all.deb) ...
Selecting previously deselected package libstomp-ruby.
Unpacking libstomp-ruby (from .../libstomp-ruby_1.0.4-2_all.deb) ...
Setting up libstomp-ruby1.8 (1.0.4-2) ...
Setting up libstomp-ruby (1.0.4-2) ...

Once the MCollective server and client software packages are installed, the operator proceeds to configure both packages to communicate with each other. Remember that the client and server do not need to be on the same system; often the client will be installed on an administrative terminal in the data center. Each managed node only needs the MCollective server software installed.

Installing MCollective on Enterprise Linux

MCollective is also distributed via packages on Enterprise Linux-based systems. The packages are split into a common package, and a client and server package. On nodes to be managed by MCollective, the mcollective-server and mcollective-common packages need to be installed, as shown in
Listing 11-14
.

Listing 11-14.
Installing MCollective server on Enterprise Linux

$ mkdir /var/tmp/mcollective
$  cd /var/tmp/mcollective
$ wget http://www.puppetlabs.com/downloads/mcollective/mcollective-common
-1.0.1-1.el5.noarch.rpm
$ wget http://www.puppetlabs.com/downloads/mcollective/mcollective-1.0.1-1.el5.noarch.rpm
$ sudo rpm -Uvh mcollective*.rpm
Preparing...               ########################################### [100%]
   1:mcollective-common     ########################################### [ 50%]
   2:mcollective            ########################################### [100%]

Here, the operator downloads and installs the RPM packages for the MCollective server software. These packages should be installed on all systems where actions will be carried out. In addition, the MCollective client packages need to be installed on at least one system. The operator installs these packages as shown in
Listing 11-15
. RPC commands will be sent from the client system to the collection of MCollective servers.

Listing 11-15.
Installing the MCollective client on Enterprise Linux

$ mkdir /var/tmp/mcollective-client
$ cd /var/tmp/mcollective-client
$ wget http://www.puppetlabs.com/downloads/mcollective/mcollective-common
-1.0.1-1.el5.noarch.rpm
$ wget http://www.puppetlabs.com/downloads/mcollective/mcollective-client
-1.0.1-1.el5.noarch.rpm
$ sudo rpm -Uvh *.rpm
Preparing...               ########################################### [100%]
   1:mcollective-common     ########################################### [ 50%]
   2:mcollective-client     ########################################### [100%]

Once the MCollective client and server packages are installed, the Ruby STOMP protocol library also needs to be installed. MCollective communicates with the messaging middleware using the STOMP protocol. The Stomp gem provides the API to this protocol. On Enterprise Linux systems, the most effective way to install the Stomp gem is to use the
gem
command, as shown in
Listing 11-16
.

Listing 11-16.
Installing the Stomp gem on Enterprise Linux systems

$ sudo gem install stomp
Successfully installed stomp-1.1.8
1 gem installed
Installing ri documentation for stomp-1.1.8...
Installing RDoc documentation for stomp-1.1.8...

Similar to the MCollective server software, only the client and common packages need to be installed on an administrative console. Once the software has been installed, the operator must configure the MCollective client and server systems to connect to the RabbitMQ service. In the next section, you'll see how MCollective is configured on all platforms.

MCollective Server Configuration

The MCollective server needs to be configured to connect to the RabbitMQ server. The MCollective process connects to the service using a standard TCP connection to port 6313. Let's see how the operator configures the MCollective server in
Listing 11-17
.

Listing 11-17.
Configuring the MCollective server

$ cat /etc/mcollective/server.cfg
topicprefix = /topic/mcollective
libdir = /usr/share/mcollective/plugins
logfile = /var/log/mcollective.log
loglevel = info
daemonize = 1
# Plugins
securityprovider = psk
plugin.psk = klot2oj2ked2tayn3hu5on7l
connector = stomp
plugin.stomp.host = stomp.example.com
plugin.stomp.port = 6163
plugin.stomp.user = mcollective
plugin.stomp.password = iwillchangethispassword
# Facts
factsource = yaml
plugin.yaml = /etc/mcollective/facts.yaml

There are three key settings to change when installing and configuring MCollective. These settings are:

  • plugin.psk: The pre-shared key MCollective uses to verify message authenticity
  • plugin.stomp.host: The hostname or IP address of a Stomp message queue service
  • plugin.stop.password: The password MCollective uses to authenticate the connection to the Stomp server. This password should match the password used in
    Listing 11-9
    , “Configuring the RabbitMQ MCollective account.”

The operator first configures the hostname of the Stomp protocol server. The Stomp server is provided by the RabbitMQ service. Next, the operator configures MCollective to log in to the Stomp service using the username
mcollective
and a password. These credentials correspond to the
rabbitctl add_user
commands he used to create these accounts in
Listing 11-9
. Finally, the operator configures a pre-shared key to sign messages as they travel across the message bus. This pre-shared key should be a long, randomly generated string. The same string should be used on all MCollective systems, both client and server. Other MCollective processes will also be configured with this key to authenticate messages among each other.

Once the MCollective server is configured, in
Listing 11-18
the operator restarts the service to connect MCollective to the message bus.

Listing 11-18.
Restarting the MCollective server after configuration

$ sudo /sbin/service mcollective restart
service mcollective restart
Shutting down mcollective: [  OK  ]
Starting mcollective: [  OK  ]

At this point, the MCollective server will initiate a connection to the RabbitMQ server and begin listening for messages. This process is commonly referred to as subscribing to a message queue. The operator then configures the MCollective client to send the first message to the collective. The MCollective client is often installed on a different system from all of the MCollective servers. The configuration the operator is using for the MCollective client is shown in
Listing 11-19
. Notice that the plugin.psk (Pre Shared Key) setting identically matches the setting in the server configuration.

Listing 11-19.
Configuring the MCollective client

$ sudo cat /etc/mcollective/client.cfg
topicprefix = /topic/mcollective
libdir = /usr/share/mcollective/plugins
logfile = /dev/null
loglevel = info
# Plugins
securityprovider = psk
plugin.psk = klot2oj2ked2tayn3hu5on7l
connector = stomp
plugin.stomp.host = stomp.example.com
plugin.stomp.port = 6163
plugin.stomp.user = mcollective
plugin.stomp.password = iwillchangethispassword
# Facts
factsource = yaml
plugin.yaml = /etc/mcollective/facts.yaml

Other books

One Thousand Years by Randolph Beck
Sevin: Lords of Satyr by Elizabeth Amber
Shifters, Beasts, and Monsters by Aya Fukunishi, Linda Barlow, Elixa Everett, Virginia Wade, Savannah Reardon, Skye Eagleday, Giselle Renarde, Jessi Bond, Natalie Deschain, Audrey Grace, Francis Ashe, J.E., M. Keep, Christie Sims, Alara Branwen
You Changed My Life by Abdel Sellou
THE OVERTON WINDOW by Beck, Glenn
Chroniech! by Doug Farren
Sarah's Key by Tatiana de Rosnay