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

-------------------------------------服务端-----------------------------------
1、activemq安装
yum install java activemq -y

修改配置文件 vi /etc/activemq/activemq.xml

  <plugins>   
      <simpleAuthenticationPlugin>
        <users>
          <authenticationUser username="${activemq.username}" password="${activemq.password}" groups="admins,everyone"/>
          <authenticationUser username="mcollective" password="mcollective" groups="mcollective,admins,everyone"/>   
        </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>

<transportConnectors> #将<transportConnectors>标签修改成下面的内容
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
<transportConnector name="stomp" uri="stomp+nio://0.0.0.0:61613"/> #确认ActiveMQ的61613端口在配置文件中处于开启状态
</transportConnectors>

保存退出,启动

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 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服务

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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 136,273评论 19 139
  • Puppet模块Puppet部署master/agent模式Puppet多环境配置Puppet kick机制 一、...
    哈喽别样阅读 3,462评论 0 1
  • Puppet理论定义: Puppet 是一个跨平台的集中化配置管理系统,它使用自有的描述语言,可管理配置文件、用户...
    属于你的世界阅读 4,635评论 0 2
  • 1.puppet 是什么 puppet是一个开源的软件自动化配置和部署工具,很多大型IT公司均在使用puppet对...
    milo_e1ce阅读 10,441评论 0 4
  • 1、mkdir /puppetmkdir /puppet/soft2、服务端安装dnsmasq:yum insta...
    SkTj阅读 3,408评论 0 0

友情链接更多精彩内容