el7 install puppteserver5

目的

在 el7 服务器上安装 puppet server 5 版本

额外的软件下载地址

wget http://hcc-mirror.unl.edu/puppetlabs/puppet5/el/7/x86_64/puppetserver-5.3.9-1.el7.noarch.rpm
wget http://hcc-mirror.unl.edu/puppetlabs/puppet5/el/7/x86_64/puppet-agent-5.5.8-1.el7.x86_64.rpm
wget http://mirror.centos.org/centos/7/updates/x86_64/Packages/copy-jdk-configs-3.3-11.el7_9.noarch.rpm
wget http://mirror.centos.org/centos/7/updates/x86_64/Packages/java-1.8.0-openjdk-headless-1.8.0.392.b08-2.el7_9.x86_64.rpm
wget http://mirror.centos.org/centos/7/updates/x86_64/Packages/tzdata-java-2022g-1.el7.noarch.rpm

puppetserver install

centos7 只需要可以访问最新 7.9.2009 updates 软件源
yum install -y copy-jdk-configs cups-libs jpackage-utils lksctp-tools pcsc-lite-libs tzdata-java
rpm -ivh puppetserver-5.3.9-1.el7.noarch.rpm  puppet-agent-5.5.8-1.el7.x86_64.rpm

server config

调整 jdk size

/etc/sysconfig/puppetserver
JAVA_ARGS="-Xms6g -Xmx6g -Djruby.logger.class=com.puppetlabs.jruby_utils.jruby.Slf4jLogger"
顺手更新一下 ruby 版本
JRUBY_JAR="/opt/puppetlabs/server/apps/puppetserver/jruby-9k.jar"

添加 auto sign

/etc/puppetlabs/puppetserver/conf.d/autosign.conf
*.vclound.com

添加服务器地址

/etc/puppetlabs/puppet/puppet.conf

[master]
vardir = /opt/puppetlabs/server/data/puppetserver
logdir = /var/log/puppetlabs/puppetserver
rundir = /var/run/puppetlabs/puppetserver
pidfile = /var/run/puppetlabs/puppetserver/puppetserver.pid
codedir = /etc/puppetlabs/code
server = puppet5-uq2pu.vclound.com

server startup

systemctl restart puppetserver

# systemctl status  puppetserver
puppetserver.service - puppetserver Service
   Loaded: loaded (/usr/lib/systemd/system/puppetserver.service; disabled)
   Active: active (running) since 三 2024-01-03 02:31:41 UTC; 38min ago
  Process: 11255 ExecStop=/opt/puppetlabs/server/apps/puppetserver/bin/puppetserver stop (code=exited, status=0/SUCCESS)
  Process: 11270 ExecStart=/opt/puppetlabs/server/apps/puppetserver/bin/puppetserver start (code=exited, status=0/SUCCESS)
 Main PID: 11277 (java)
   CGroup: /system.slice/puppetserver.service
           └─11277 /usr/bin/java -Xms6g -Xmx6g  .... <-- 验证一下内存分配

验证一下服务端口
# netstat -ntl | grep 8140
tcp6       0      0 :::8140                 :::*                    LISTEN

测试模板

随便来个文件测试一下

/etc/puppetlabs/code/environments/production/manifests/node/test.pp
node 'tsdb-zxjzd.vclound.com' {
    file { '/tmp/abc':
        ensure  => file,
        mode    => '0644',
        owner   => root,
        group   => root,
        content => "add",
    }
}

客户端执行

参考上述方法安装 puppet-agent
参考上述方法配置服务器 (server = puppet5-uq2pu.vclound.com)
客户端测试运行

测试 puppet
# /opt/puppetlabs/bin/puppet agent -t
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Caching catalog for tsdb-zxjzd.vclound.com
Info: Applying configuration version '1704250370'
Notice: /Stage[main]/Main/Node[tsdb-zxjzd.vclound.com]/File[/tmp/abc]/ensure: defined content as '{md5}34ec78fcc91ffb1e54cd85e4a0924332'
Info: Creating state file /opt/puppetlabs/puppet/cache/state/state.yaml
Notice: Applied catalog in 0.02 seconds

执行 puppet
# /opt/puppetlabs/bin/puppet agent

验收文件
# cat /tmp/abc
add
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Terry_Tsang

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值