5 [Screencasts]: /mcollective/screencasts.html
6 [ActiveMQ]: http://activemq.apache.org/
7 [ActiveMQ Getting Started]: http://activemq.apache.org/getting-started.html
8 [EC2Demo]: /mcollective/ec2demo.html
9 [Stomp]: http://stomp.codehaus.org/Ruby+Client
10 [DepRPMs]: http://www.marionette-collective.org/activemq/
11 [DebianBug]: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=562954
12 [SecurityWithActiveMQ]: /mcollective/reference/integration/activemq_security.html
13 [ActiveMQClustering]: /mcollective/reference/integration/activemq_clusters.html
14 [ActiveMQSamples]: http://github.com/puppetlabs/marionette-collective/tree/master/ext/activemq/examples/
15 [ActiveMQSingleBrokerSample]: http://github.com/puppetlabs/marionette-collective/raw/master/ext/activemq/examples/single-broker/activemq.xml
16 [ConfigurationReference]: /mcollective/reference/basic/configuration.html
17 [Terminology]: /mcollective/terminology.html
18 [SimpleRPCIntroduction]: /mcollective/simplerpc/
19 [ControllingTheDaemon]: /mcollective/reference/basic/daemon.html
20 [SSLSecurityPlugin]: /mcollective/reference/plugins/security_ssl.html
21 [AESSecurityPlugin]: /mcollective/reference/plugins/security_aes.html
22 [ConnectorStomp]: /mcollective/reference/plugins/connector_stomp.html
23 [MessageFlowCast]: /mcollective/screencasts.html#message_flow
24 [Plugins]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki
25 [MCDownloads]: http://www.puppetlabs.com/downloads/mcollective/
26 [RubyGems]: http://packages.debian.org/search?suite=default§ion=all&arch=any&searchon=names&keywords=rubygems
28 Getting started using Debian based distribution like Debian squeeze and Ubuntu is easy as DEBs are available for most the required components. This guide walks you through the process.
30 If you just want to experiment with the system please try our [EC2 based demo][EC2Demo]. You should be familiar with the architecture and terminology of Marionette Collective, please review the [basic architecture, terminology and message flow][MessageFlowCast] screencast first.
33 We try to keep the requirements on external Gems to a minimum, you only need:
35 * A Stomp server, tested against [ActiveMQ]
38 * [Ruby Stomp Client][Stomp]
42 We strongly recommend you set up a local Apt repository that will host all the packages on your LAN, you can get the prerequisite packages here:
45 * Java - OpenJDK that is included with your distribution
46 * Ruby - included with your distribution
49 * [MCollective][MCDownloads] - mcollective-1.x.x-1_all.deb, mcollective-common-1.x.x-1_all.deb, mcollective-client-1.x.x-1_all.deb
51 The rest of this guide will assume you set up a Apt repository. Puppet Labs hosts a Apt repository with all these dependencies at _apt.puppetlabs.com_.
54 ActiveMQ is currently the most used and tested middleware for use with MCollective.
56 You need at least one ActiveMQ server on your network, all the nodes you wish to manage will connect to the central ActiveMQ server.
57 Later on your can [cluster the ActiveMQ servers for availability and scale][ActiveMQClustering].
61 On the server that you chose to configure as the ActiveMQ server:
63 {% highlight console %}
64 % apt-get install openjdk-6-jre
67 ActiveMQ installation instructions can be found [here][ActiveMQ Getting Started].
71 Initially you'll just keep it simple with a single ActiveMQ broker and a basic user setup, further security information for ActiveMQ
72 can be found [here][SecurityWithActiveMQ]
74 Place the following in your ActiveMQ configuration path as *activemq.xml*. You can download this file from [GitHub][ActiveMQSingleBrokerSample]
76 Other examples are also available from [GitHub][ActiveMQSamples]
80 xmlns="http://www.springframework.org/schema/beans"
81 xmlns:amq="http://activemq.apache.org/schema/core"
82 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
83 xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
84 http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
85 http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
87 <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" useJmx="true">
91 <policyEntry topic=">" producerFlowControl="false"/>
92 <policyEntry queue="*.reply.>" gcInactiveDestinations="true" inactiveTimoutBeforeGC="300000" />
98 <managementContext createConnector="false"/>
102 <statisticsBrokerPlugin/>
103 <simpleAuthenticationPlugin>
105 <authenticationUser username="mcollective" password="marionette" groups="mcollective,everyone"/>
106 <authenticationUser username="admin" password="secret" groups="mcollective,admin,everyone"/>
108 </simpleAuthenticationPlugin>
109 <authorizationPlugin>
112 <authorizationEntries>
113 <authorizationEntry queue=">" write="admins" read="admins" admin="admins" />
114 <authorizationEntry topic=">" write="admins" read="admins" admin="admins" />
115 <authorizationEntry topic="mcollective.>" write="mcollective" read="mcollective" admin="mcollective" />
116 <authorizationEntry queue="mcollective.>" write="mcollective" read="mcollective" admin="mcollective" />
117 <authorizationEntry topic="ActiveMQ.Advisory.>" read="everyone" write="everyone" admin="everyone"/>
118 </authorizationEntries>
121 </authorizationPlugin>
127 <memoryUsage limit="20 mb"/>
130 <storeUsage limit="1 gb" name="foo"/>
133 <tempUsage limit="100 mb"/>
138 <transportConnectors>
139 <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
140 <transportConnector name="stomp" uri="stomp://0.0.0.0:61613"/>
141 </transportConnectors>
146 This creates a user *mcollective* with the password *marionette* and give it access to read/write/admin */topic/mcollective.`*`*. You should change this passsword.
150 Start the ActiveMQ service:
152 {% highlight console %}
153 # /etc/init.d/activemq start
156 You should see it running in the process list:
158 {% highlight console %}
160 activemq 3012 0.1 14.5 1155112 152180 ? Sl Dec28 2:02 java -Dactivemq.home=/usr/share/activemq -Dactivemq.base=/usr/share/activemq -Dcom.sun.management.jmxremote -Dorg.apache.activemq.UseDedicatedTaskRunner=true -Xmx512m -Djava.library.path=/usr/lib:/usr/lib64 -classpath /usr/share/java/tanukiwrapper.jar:/usr/share/activemq/bin/run.jar -Dwrapper.key=eg4_VvENzCmvtAKg -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.pid=3000 -Dwrapper.version=3.2.3 -Dwrapper.native_library=wrapper -Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1 org.tanukisoftware.wrapper.WrapperSimpleApp org.apache.activemq.console.Main start
163 You should also see it listening on port 61613 in your network stack
165 You should open port 61613 for all your nodes to connect to.
167 ## Marionette Collective
169 There are a few packages supplied and you will have potentially two type of server:
171 * Nodes that you wish to manage using mcollective need the mcollective and mcollective-common packages
172 * Nodes that you wish to use to initiate requests from also known as clients need mcollective-client and mcollective-common packages
174 A machine can be both at once, in which case you need to install all 3 packages. We'll work on the assumption here that you wish to both manage your machine and use it as a client by installing all 3 packages on our initial node.
178 {% highlight console %}
179 # apt-get install mcollective mcollective-client mcollective-common
185 You'll need to tweak some configs in */etc/mcollective/client.cfg*, a full reference of config settings can be
186 found [here][ConfigurationReference]:
188 We're assuming you called the machine running ActiveMQ *stomp.example.net* please change as appropriate
192 libdir = /usr/libexec/mcollective
196 # connector plugin config
198 plugin.stomp.host = stomp.example.net
199 plugin.stomp.port = 61613
200 plugin.stomp.user = mcollective
201 plugin.stomp.password = marionette
203 # security plugin config
204 securityprovider = psk
205 plugin.psk = abcdefghj
208 You should also create _/etc/mcollective/server.cfg_ here's a sample, , a full reference of config settings can be found here [ConfigurationReference]:
212 libdir = /usr/libexec/mcollective
213 logfile = /var/log/mcollective.log
217 # connector plugin config
219 plugin.stomp.host = stomp.example.net
220 plugin.stomp.port = 61613
221 plugin.stomp.user = mcollective
222 plugin.stomp.password = marionette
226 plugin.yaml = /etc/mcollective/facts.yaml
228 # security plugin config
229 securityprovider = psk
230 plugin.psk = abcdefghj
233 Replace the *plugin.psk* in both these files with a Pre-Shared Key of your own.
236 By default - and for this setup - we'll use a simple YAML file for a fact source, later on you can use Puppet Labs Facter or something else.
238 Create */etc/mcollective/facts.yaml* along these lines:
248 The packages include standard init script, just start the server:
250 {% highlight console %}
251 # /etc/init.d/mcollective restart
254 You should see in the log file somethig like:
256 {% highlight console %}
257 # tail /var/log/mcollective.log
258 I, [2010-12-29T11:15:32.321744 #11479] INFO -- : mcollectived:33 The Marionette Collective 1.1.0 started logging at info level
261 ### Test connectivity
263 If all is fine and you see this log message you can test with the client code:
265 {% highlight console %}
267 your.domain.com time=74.41 ms
269 ---- ping statistics ----
270 1 replies max: 74.41 min: 74.41 avg: 74.41
273 This sends out a simple 'hello' packet to all the machines, as we only installed one you should have just one reply.
275 If you install the _mcollective_ and _mcollective-common_ packages along wit the facts and server.cfg you should see more nodes show up here.
277 You can explore other aspects of your machines:
279 {% highlight console %}
280 % mco find --with-fact country=uk
284 This searches all systems currently active for ones with a fact *country=uk*, it got the data from the yaml file you made earlier.
286 If you use confiuration management tools like puppet and the nodes are setup with classes with *classes.txt* in */var/lib/puppet* then you
287 can search for nodes with a specific class on them - the locations will configurable soon:
289 {% highlight console %}
290 % mco find --with-class common::linux
294 The filter commands are important they will be the main tool you use to target only parts of your infrastructure with calls to agents.
296 See the *--help* option to the various *mco `*`* commands for available options. You can now look at some of the available plugins and
297 play around, you might need to run the server process as root if you want to play with services etc.
300 We provide limited default plugins, you can look on our sister project [MCollective Plugins][Plugins] where you will
301 find various plugins to manage packages, services etc.
304 From here you should look at the rest of the wiki pages some key pages are:
306 * [Screencasts] - Get a hands-on look at what is possible
308 * [Introduction to Simple RPC][SimpleRPCIntroduction] - a simple to use framework for writing clients and agents
309 * [ControllingTheDaemon] - Controlling a running daemon
310 * [AESSecurityPlugin] - Using AES+RSA for secure message encryption and authentication of clients
311 * [SSLSecurityPlugin] - Using SSL for secure message signing and authentication of clients
312 * [ConnectorStomp] - Full details on the Stomp adapter including failover pools