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

简介: -------------------------------------服务端-----------------------------------1、jdk安装vi /etc/profileexport JAVA_HOME=/usr/loca...

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

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

目录
相关文章
|
监控 关系型数据库 MySQL
puppet连载15:搭建zabbix服务端、客户端
zabbix的安装需要先安装mysql. 服务端/puppet/soft建vi zabbix35server.sh 文件,内容: !/bin/bash result=netstat -tnlup|grep 3306; if [ "$result" !=...
1038 0
|
关系型数据库 网络安全 PostgreSQL
puppet连载14:安装puppetdb
yum install puppetdb puppetdb-terminus -y service puppetdb start vi /etc/puppet/puppet.
1070 0
|
网络协议 应用服务中间件 Shell
puppet连载12:linux安装nginx、openresty
服务端在/puppet/soft 里建nginx1102setup.sh,内容: !/bin/bash yum -y install wget libtool expat-devel gcc gcc-c++ glibc automake autocon...
933 0
|
Java 应用服务中间件 Linux
puppet连载九:linux安装jdk、tomcat模块
安装jdk1.8.0_91和tomcat8.0.36 mkdir -p /etc/puppet/modules/linuxjdktomcat/{manifests,templates,files} vi /etc/puppet/modules/linuxjdktomcat/manifests/init.
1080 0
|
MySQL 关系型数据库 Linux
puppet连载10:linux安装percona57/56/55、sysbench、tpcc模块
在服务端/puppet/soft下建my.cnf,内容为https://www.jianshu.com/p/c63fc6c71279 在服务端/puppet/soft下建changemysql57pass.
1077 0
|
关系型数据库 MySQL Linux
puppet连载四:服务端安装dashboard
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import - curl -L get.rvm.io | bash -s stable source /etc/profile.
1266 0
|
Linux 开发工具 git
puppet连载七:linux基础组件安装模块
linux基础组件安装模块linuxbaseinstall 更换源,安装gcc gcc-c++ glibc-devel make ncurses-devel openssl-devel autoconf git mkdir -p /etc/puppet...
1076 0
|
2月前
|
运维 Linux Apache
Puppet 作为一款强大的自动化运维工具,被广泛应用于配置管理领域。通过定义资源的状态和关系,Puppet 能够确保系统始终处于期望的配置状态。
Puppet 作为一款强大的自动化运维工具,被广泛应用于配置管理领域。通过定义资源的状态和关系,Puppet 能够确保系统始终处于期望的配置状态。
70 3
|
安全 Linux 网络协议
puppet yum模块、配置仓储、mount模块
转载:http://blog.51cto.com/ywzhou/1577335 作用:自动为客户端配置YUM源,为使用yum安装软件包提供便捷。 1、服务端配置yum模块 (1)模块清单 [root@puppet ~]# tree /etc/puppe...
1119 0