puppet 连载二:服务端和客户端安装(ActiveMQ、MCollective)

-------------------------------------服务端-----------------------------------
1、jdk安装

vi /etc/profile

export JAVA_HOME=/usr/local/jdk
export CLASSPATH=JAVA_HOME/lib/ export PATH=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服务

img_df2e69625a78546e52ba963fae1289af.png
image.png

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值