puppet 連載二:服務(wù)端和客戶端安裝(ActiveMQ、MCollective)

-------------------------------------服務(wù)端-----------------------------------
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>標(biāo)簽修改成下面的內(nèi)容
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
<transportConnector name="stomp" uri="stomp+nio://0.0.0.0:61613"/> #確認(rèn)ActiveMQ的61613端口在配置文件中處于開(kāi)啟狀態(tài)
</transportConnectors>

保存退出,啟動(dòng)

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

試運(yùn)行

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

啟動(dòng)mcollectived和puppete服務(wù)

image.png

mco puppet runonce

查看更新間隔:
puppet agent --configprint runinterval
1、服務(wù)端
vi /etc/puppet/manifests/site.pp
node default {
notify {'test-success':
name => 'test-sueccess',
message => 'connect success',
}
}
2、客戶端:
puppet agent --server puppetmaster --test

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • Spring Cloud為開(kāi)發(fā)人員提供了快速構(gòu)建分布式系統(tǒng)中一些常見(jiàn)模式的工具(例如配置管理,服務(wù)發(fā)現(xiàn),斷路器,智...
    卡卡羅2017閱讀 136,506評(píng)論 19 139
  • Puppet模塊Puppet部署master/agent模式Puppet多環(huán)境配置Puppet kick機(jī)制 一、...
    哈嘍別樣閱讀 551評(píng)論 0 1
  • Puppet理論定義: Puppet 是一個(gè)跨平臺(tái)的集中化配置管理系統(tǒng),它使用自有的描述語(yǔ)言,可管理配置文件、用戶...
    屬于你的世界閱讀 1,091評(píng)論 0 2
  • 1.puppet 是什么 puppet是一個(gè)開(kāi)源的軟件自動(dòng)化配置和部署工具,很多大型IT公司均在使用puppet對(duì)...
    milo_e1ce閱讀 5,120評(píng)論 0 4
  • 1、mkdir /puppetmkdir /puppet/soft2、服務(wù)端安裝dnsmasq:yum insta...
    SkTj閱讀 529評(píng)論 0 0

友情鏈接更多精彩內(nèi)容