Management server
Management server setup! Short introduction of Puppet and MCollective :)
I. Puppet
Server installation:
$ sudo apt-get install puppetmaster |
On the client:
$ sudo apt-get install puppet |
If you have changed your hostname, you will need to regenerate a crt:
$ sudo puppetd --certname server-05 |
On the server:
List unsigned ca, which have been requested by the client with puppetd –test
$ sudo puppetca --list |
Tips
Regenerate the client certificate, first on the master:
$ sudo puppet cert clean <client-node> |
On the agent:
$ sudo rm -f /var/lib/puppet/ssl/certs/<client-node>.pem |
II. MCollective
II.1. Terminology
Server The mcollective daemon, an app server for hosting Agents and managing the connection to your Middleware.
Node The Computer or Operating System that the Server runs on.
Client Software that produce commands for agents to process, typically this would be a computer with the client package installed and someone using the commands like mc-package to interact with Agents. Often clients will use the MCollective::Client library to communicate to the Collective
Basically the server is the slave, the node which will be orchestrate by the management server and the management server is the client.
II.2. RabbitMQ config
Since OpenStack a messaging queue mecanism system, it will be shame to don’t use it with MCollective, specially if you have setup a RabbitMQ cluster.
$ sudo /usr/lib/rabbitmq/bin/rabbitmq-plugins enable amqp_client |
Verify:
$ /usr/lib/rabbitmq/bin/rabbitmq-plugins list |
User credential:
$ sudo rabbitmqctl add_user <username> <password> |
Modify the plugin according to the MCollective listened port, add the following to the /etc/rabbitmq/rabbitmq.config
:
[
{rabbitmq_stomp, [{tcp_listeners, [{"0.0.0.0", 6163},
{"::1", 6163}]}]}
].
Eventually restart the server:
$ sudo service rabbitmq-server restart |
Listenning?
$ sudo netstat -plantu | grep 6163 |
II.3. Mcollective config
Beware of the packages names:
mcollective-client
: on the node that you want to run your queries frommcollective
: on the nodes that you want to query/control
Note: both of them are comming with the mcollective-common
package.
Here the /etc/mcollective/server.cfg
file:
topicprefix = /topic/
main_collective = mcollective
collectives = mcollective
libdir = /usr/share/mcollective/plugins
logfile = /var/log/mcollective.log
loglevel = info
daemonize = 0
# Plugins
securityprovider = psk
plugin.psk = unset
connector = stomp
plugin.stomp.host= haproxy
plugin.stomp.port= 6163
plugin.stomp.user= mcollective
plugin.stomp.password= marionette
# Facts
factsource = yaml
plugin.yaml = /etc/mcollective/facts.yaml
II.4. Client config
$ sudo aptitude install mcollective |
Here the /etc/mcollective/server.cfg
file:
topicprefix = /topic/
main_collective = mcollective
collectives = mcollective
libdir = /usr/share/mcollective/plugins
logfile = /dev/null
loglevel = info
# Plugins
securityprovider = psk
plugin.psk = unset
connector = stomp
plugin.stomp.host= haproxy
plugin.stomp.port= 6163
plugin.stomp.user= mcollective
plugin.stomp.password= marionette
# Facts
factsource = yaml
plugin.yaml = /etc/mcollective/facts.yaml
Test your client:
$ sudo mco ping |
II.5. MCollective plugins
Fortunetly MCollective comes with a bunch of existing plugins which is really helpful if you don’t want to write your own script.
Test:
$ sudo mco service ntp status |
This was article a really brief introduction to the management servers.
Comments