Marionette Collective using ActiveMQ

5.7 supports Java 1.7. About the middleware, RabbitMQ is not default middleware of MCollective, therefore we will use ActiveMQ as the middleware (java app). Components: * java-1.7.0-openjdk * ActiveMQ 5.8.0 * tanukiwrapper 3.5.9 – activeMQ dependency * mcollective 2.3.2 * mcollective-common 2.3.2 – mcollective dependency * rubygem-stomp 1.2.2 – mcollective-common dependency * mcollective-client 2.3.2 * mcollective-common 2.3.2 – mcollective-client dependency * rubygem-stomp 1.2.2 – mcollective-client dependency How does it work? Very easy. Mcollective server needs to get installed to each node/puppetclient. Those clients connect to a middleware, in this case we use ActiveMQ, through a protocol such as activemq protocol. An mcollective-client then connect to the middleware to talk to each mcollective server. Installing ActiveMQ:


# yum install java
# yum install activemq
# vi /etc/activemq/activemq.xml and change password
              authenticationUser username="mcollective" password="passwordhere" 
chkconfig activemq on
service activemq restart
Now let’s configure each client. Each client needs mcollective server: puppetclient:
yum install rubygem-stomp
yum install mcollective
Install mcollective-common-2.3.2-
Install mcollective-2.3.2-

Change /etc/mcollective/server.cfg
connector = activemq
plugin.activemq.pool.size = 1
plugin.activemq.pool.1.host = middleware.com
plugin.activemq.pool.1.port = 61613
plugin.activemq.pool.1.user = mcollectiveuser
plugin.activemq.pool.1.password = passwordhere
Don’t forget add OUTBOUND port 61613
cat mcollective
# Allow mcollective to middleware
chain OUTPUT {
proto ( tcp udp ) dport 61613 ACCEPT;
}
service mcollective restart
Setup client, somewhere.
# wget http://downloads.puppetlabs.com/mcollective/mcollective-client-2.3.2-1.el6.noarch.rpm
yum -y install rubygem-stomp
rpm -Uvh mcollective-common-2.3.2-1.el6.noarch.rpm
rpm -Uvh mcollective-client-2.3.2-1.el6.noarch.rpm

vi /etc/mcollective/client.cfg
connector = activemq
plugin.activemq.pool.size = 1
plugin.activemq.pool.1.host = middlewareserver.com
plugin.activemq.pool.1.port = 61613
plugin.activemq.pool.1.user = mcollectiveuser
plugin.activemq.pool.1.password = passwordhere
Now try mco ping
$ sudo mco ping
puppetclient.demo                        time=46.72 ms
---- ping statistics ----
1 replies max: 46.72 min: 46.72 avg: 46.72
]]>

Leave a Reply