-------------------------------------服务端-----------------------------------
1、jdk安装
vi /etc/profile
export JAVA_HOME=/usr/local/jdk
export CLASSPATH=PATH:$JAVA_HOME/bin
source /etc/profile
2、activemq安装
yum install activemq -y
修改配置文件 vi /etc/activemq/activemq.xml
<plugins> #在<persistenceAdapter>标签下面添加一个<plugins>标签
<simpleAuthenticationPlugin>
<users>
<authenticationUser username="${activemq.username}" password="${activemq.password}" groups="admins,everyone"/>
<authenticationUser username="mcollective" password="mcollective" groups="mcollective,admins,everyone"/> #设置了用户名为mcollective,密码为mcollective
</users>
</simpleAuthenticationPlugin>
<authorizationPlugin>
<map>
<authorizationMap>
<authorizationEntries>
<authorizationEntry queue=">" write="admins" read="admins" admin="admins" />
<authorizationEntry topic=">" write="admins" read="admins" admin="admins" />
<authorizationEntry topic="mcollective.>" write="mcollective" read="mcollective" admin="mcollective" />
<authorizationEntry topic="mcollective.>" write="mcollective" read="mcollective" admin="mcollective" />
<authorizationEntry topic="ActiveMQ.Advisory.>" read="everyone" write="everyone" admin="everyone"/>
</authorizationEntries>
</authorizationMap>
</map>
</authorizationPlugin>
</plugins>
保存退出,启动
service activemq start
chkconfig activemq on
安装mcollective
rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm
yum install -y mco*
gem install stomp
chkconfig --add mcollective
chkconfig mcollective on
配置/etc/mcollective/server.cfg client.cfg
server.cfg
main_collective = mcollective
collectives = mcollective
libdir = /usr/libexec/mcollective
logger_type = file
logfile = /var/log/mcollective.log
loglevel = info
daemonize = 1
Plugins
securityprovider = psk
plugin.psk = unset
connector = activemq
plugin.activemq.pool.size = 1
plugin.activemq.pool.1.host = 172.16.54.209
plugin.activemq.pool.1.port = 61613
plugin.activemq.pool.1.user = mcollective
plugin.activemq.pool.1.password = mcollective
Facts
factsource = yaml
plugin.yaml = /etc/mcollective/facts.yaml
service mcollective start
试运行
mco shell run "touch /root/bb"
mco puppet runonce -I it01.xxx.com -v
---------------------------------------------- linux客户端-----------------------------------
rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm
yum install -y mco*
gem install stomp
chkconfig --add mcollective
chkconfig mcollective on
配置/etc/mcollective/server.cfg client.cfg
server.cfg
main_collective = mcollective
collectives = mcollective
libdir = /usr/libexec/mcollective
logger_type = file
logfile = /var/log/mcollective.log
loglevel = info
daemonize = 1
Plugins
securityprovider = psk
plugin.psk = unset
connector = activemq
plugin.activemq.pool.size = 1
plugin.activemq.pool.1.host = 172.16.54.209
plugin.activemq.pool.1.port = 61613
plugin.activemq.pool.1.user = mcollective
plugin.activemq.pool.1.password = mcollective
Facts
factsource = yaml
plugin.yaml = /etc/mcollective/facts.yaml
service mcollective start
------------------------------------------window客户端------------------------------------
安装ruby
安装mcollective_2_3_2_Setup.exe
安装mcollective-puppet-agent-1.6.1.zip
解压mcollective-puppet-agent-1.6.1里的文件到C:\mcollective\plugins\mcollective
修改server.cfg\client.cfg
main_collective = mcollective
collectives = mcollective
libdir = c:\mcollective\plugins;C:\Program Files\Puppet Labs\Puppet\puppet\lib;C:\Program Files\Puppet Labs\Puppet\facter\lib
logfile = c:\mcollective\mcollective.log
logger_type = file
loglevel = info
daemonize = 1
Plugins
securityprovider = psk
plugin.psk = unset
connector = activemq
plugin.activemq.pool.size = 1
plugin.activemq.pool.1.host = 172.16.54.209
plugin.activemq.pool.1.port = 61613
plugin.activemq.pool.1.user = mcollective
plugin.activemq.pool.1.password = mcollective
plugin.puppet.command = "C:\Program Files\Puppet Labs\Puppet\bin\puppet.bat" agent
plugin.puppet.config = C:\ProgramData\PuppetLabs\puppet\etc\puppet.conf
Facts
factsource = yaml
plugin.yaml = c:\mcollective\etc\facts.yaml
启动mcollectived和puppete服务
mco puppet runonce
查看更新间隔:
puppet agent --configprint runinterval
1、服务端
vi /etc/puppet/manifests/site.pp
node default {
notify {'test-success':
name => 'test-sueccess',
message => 'connect success',
}
}
2、客户端:
puppet agent --server puppetmaster --test