目标
目前办公室有100多个系统,预计这个数字会增加。 所有系统都由Puppetpipe理。 如果Puppet代码在Puppet Master上发生变化,需要在多个系统上实现,则在每个系统上执行sudo puppet agent -t手动运行Puppet。 有时需要在十多个系统上进行更改。 为了安全起见,这个想法是使用MCollective,即在所有系统上运行一次木偶,而不是在每个系统上运行木偶。
尝试
已经在Puppetmaster上安装了ActiveMQ , MCollective Server和MCollective Client 。 一旦运行mco ping ,就可以findPuppetmaster 。 安装MCollective Puppet Agent并运行mco rpc puppet runonce Puppet在mco rpc puppet runonce上运行。
为了连接一个远程 mcollective客户端的想法是, activemq和mcollective客户端必须安装并运行,以通过发出mco pingfind第二个主机。
/var/log/mcollective.log
INFO -- : activemq.rb:114:in `on_connecting' TCP Connection attempt 23 to stomp://mcollective@stomp1:6163
/etc/activemq/activemq.xml
<transportConnectors> <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/> <transportConnector name="stomp" uri="stomp://0.0.0.0:61613"/> </transportConnectors> </broker>
/etc/mcollective/server.cfg
connector = activemq plugin.activemq.pool.size = 1 plugin.activemq.pool.1.host = localhost plugin.activemq.pool.1.port = 61613 plugin.activemq.pool.1.user = mcollective plugin.activemq.pool.1.password = helloworld
其中一个假设是多个主机应该在server.cfg中configuration。 当试图使其工作,它不知道如何build筑应该看起来像。 一个 ActiveMQ, 一个 MCollective Server和多个 MCollective客户端(每个节点上一个)是否需要?
预期结果
预期的结果是, mco pingfindPuppetmaster和远程客户端 。 一旦这个工作,就可以在两个系统上使用MCollective运行Puppet。 当可以在这两个系统上使用MCollective执行Puppet时,一旦执行了mco rpc puppet runonce ,将会添加多个节点,并且Puppet将在这些系统上运行。
目前的结果
由于无法通过执行mco ping来查找远程客户端,因此无法在使用MCollective的两个系统上运行Puppet。
需要一个 ActiveMQ服务器,需要在每个节点上安装plugin.activemq.pool.1.host ,并且plugin.activemq.pool.1.host片段需要包含ActiveMQ服务器的IP。

[vagrant@localhost ~]$ mco ping test time=225.70 ms test2 time=488.51 ms ---- ping statistics ---- 2 replies max: 488.51 min: 225.70 avg: 357.10
/etc/mcollective/server.cfg
connector = activemq plugin.activemq.pool.size = 1 plugin.activemq.pool.1.host = IP_ACTIVEMQ_SERVER plugin.activemq.pool.1.port = 61613 plugin.activemq.pool.1.user = mcollective plugin.activemq.pool.1.password = helloworld
一旦findPuppet节点,执行mco rpc puppet runonce在所有系统上运行Puppet。