在RHEL 7上安装Puppet Enterprise(PE)服务器
我们将在Red Hat Enterprise Linux 7上安装Puppet Enterprise(PE)服务器。
请注意,我们可以免费在最多10个节点上下载并安装Puppet Enterprise。
无需许可证密钥即可在最多10个节点上运行PE。
我们的评估环境
软件需求
我们在本文中使用RHEL 7.0虚拟服务器。
VM的FQDN为pe.igi.local。
已配置“计时”以保持时间。
DNS解析已在单独的实验室DNS服务器上配置。
SELinux设置为强制模式。
硬体需求
我们的虚拟机具有以下规格:
- 2个CPU核心
- 3 GB 内存 + 2 GB SSD支持的交换
- '/opt'-PuppetDB 10GB(基本安装大约需要1.5GB)
- '/' - 16 GB
整体安装
有两种不同的PE安装方法,整体安装和拆分安装。
我们将在本文中使用整体式安装。
通过单片安装,Puppet主服务器,PE控制台和PuppetDB(带有PostgreSQL)都安装在一个节点上。
因为所有组件都在一个节点上,所以这种安装类型更易于安装,升级和故障排除。
稍后我们可以通过向其添加编译母版来扩展此安装类型。
建议将这种类型的安装用于最多500个代理节点的部署。
整体安装的防火墙配置
配置firewalld以容纳PE网络流量:
# firewall-cmd --permanent --add-service=https # firewall-cmd --permanent --add-port={8140/tcp,61613/tcp} # firewall-cmd --reload
下载Puppet Enterprise
我们不愿在此处放置任何直接链接,因为这些链接可能会断开,因此,请导航至https://puppet.com/download-puppet-enterprise并下载PE tar包。
RHCA EX405考试基于Puppet Enterprise 3.6和Satellite 6.1.
红帽培训已使用“证书注释表”(http://www.redhat.com/training/certification/comments.html)确认了信息。
考虑到上述因素,我们将使用的PE版本为3.7.0(主要是因为Puppet上不再提供3.6的下载)。
我们知道Puppet Enterprise的3.7.0版本已被取代,并且可能包含已知的错误或者安全问题,但是出于测试目的,匹配EX405考试环境比使用可用的最新版本更为重要。
验证安装程序
验证安装程序:
# wget -O - https://downloads.puppetlabs.com/puppetlabs-gpg-signing-key.pub | gpg --import [...] gpg: /root/.gnupg/trustdb.gpg: trustdb created gpg: key 4BD6EC30: public key "Puppet Labs Release Key (Puppet Labs Release Key) <Hyman@theitroad>" imported gpg: Total number processed: 1 gpg: imported: 1 (RSA: 1) gpg: no ultimately trusted keys found
现在,通过运行以下命令在tar包上验证发行签名:
# gpg --verify puppet-enterprise-3.7.0-el-7-x86_64.tar.gz.asc gpg: Signature made Wed 05 Nov 2014 02:10:12 GMT using RSA key ID 4BD6EC30 gpg: Good signature from "Puppet Labs Release Key (Puppet Labs Release Key) <Hyman@theitroad>" gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner. Primary key fingerprint: 47B3 20EB 4C7C 375A A9DA E1A0 1054 B7A2 4BD6 EC30
这些仅供参考:
# md5sum ./* c500a0dd6e4d8f861c3ff0f5d22c0774 ./puppet-enterprise-3.7.0-el-7-x86_64-agent.tar.gz c3af6c0a2c448bbaf4662ee49ae0409f ./puppet-enterprise-3.7.0-el-7-x86_64-agent.tar.gz.asc 407f478ff1ae9fa96b612089f2638f80 ./puppet-enterprise-3.7.0-el-7-x86_64.tar.gz db8a72098db92ef3b7a5935cdf181679 ./puppet-enterprise-3.7.0-el-7-x86_64.tar.gz.asc
整体安装:步骤1
如前所述,PE的整体安装将所有内容部署在单个VM上:Puppet主服务器,PE控制台和PuppetDB组件。
我们需要确保端口3000是可访问的,因为基于Web的安装程序正在使用该端口。
安装完成后,我们可以关闭此端口。
也可以不带-permanent标志使用:
# firewall-cmd --add-port=3000/tcp
基于Web的安装程序不支持使用默认值targetpw或者默认值rootpw的sudo配置。
确保“/etc/sudoers”文件不包含这些行。
另外,所有密码中均禁止使用'(单引号)。
解压tar包:
# tar xf ./puppet-enterprise-3.7.0-el-7-x86_64.tar.gz # cd ./puppet-enterprise-3.7.0-el-7-x86_64
我更喜欢屏幕以避免安装中断:
# screen
简而言之,屏幕是一个全屏软件程序,可用于在多个进程(通常是交互式shell程序)之间多路复用物理控制台。
在PE安装程序目录中,运行安装程序脚本:
# ./puppet-enterprise-installer ======================================================================================================================== Puppet Enterprise v3.7.0 installer Puppet Enterprise documentation can be found at http://docs.puppetlabs.com/pe/3.7/ ----------------------------------------------------------------------------------------------------------------------- STEP 1: GUIDED INSTALLATION Before you begin, choose an installation method. We've provided a few paths to choose from. - Perform a guided installation using the web-based interface. Think of this as an installation interview in which we ask you exactly how you want to install PE. In order to use the web-based installer, you must be able to access this machine on port 3000 and provide the SSH credentials of a user with root access. This method will login to servers on your behalf, install Puppet Enterprise and get you up and running fairly quickly. - Use the web-based interface to create an answer file so that you login to the servers yourself and perform the installation locally. Refer to Answer File Installation (http://docs.puppetlabs.com/pe/3.7/install_automated.html), which provides an overview on installing PE with an answer file. - If you choose not to use the web-based interface, you can write your own answer file or use the answer file(s) provided in the PE installation tar包. Check the Answer File Reference Overview (http://docs.puppetlabs.com/pe/3.7/install_answer_file_reference.html) to get started. ?? Install packages and perform a guided install? [Y/n] Y Installing setup packages. Please go to https://pe.igi.local:3000 in your browser to continue installation. Be sure to use https://and that port 3000 is reachable through the firewall.
请注意,在完成安装之前,我们需要保持终端连接打开。
否则,安装将失败。
为了安全起见,我们将取消屏幕会话。
要分离屏幕,请按“ Ctrl-A”和“ d”:
[detached from 2353.pts-0.pe] [Hyman@theitroad ~]#
# screen -ls There is a screen on: 2353.pts-0.pe (Detached) 1 Socket in /var/run/screen/S-root.
屏幕可以用“ screen -r”重新连接。
此时,PE安装程序将启动Web服务器并提供以下网址:https://pe.igi.local:3000。
将地址复制到浏览器中,然后继续进行“单片安装:第2部分”。
整体安装:步骤2
如果此时我们将打开“日志视图”,则会注意到该脚本安装了以下软件包:
# yum -y -d2 install ‘libxslt’ ‘pciutils’ ‘zlib’ ‘which’ ‘libxml2’ ‘net-tools’ ‘libjpeg’ ‘curl’ ‘system-logos’ ‘mailcap’ ‘pe-cloud-provisioner’ ‘pe-cloud-provisioner-libs’ ‘pe-agent’ ‘pe-ruby-ldap’ ‘pe-rubygem-net-ssh’ ‘pe-java’ ‘pe-puppetserver’ ‘pe-puppetserver-common’ ‘pe-license’ ‘pe-puppet-license-cli’ ‘pe-puppetdb-terminus’ ‘pe-console-services-termini’ ‘pe-httpd’ ‘pe-passenger’ ‘pe-rubygem-rack’ ‘pe-mcollective-client’ ‘pe-postgresql’ ‘pe-puppet-dashboard’ ‘pe-bundler’ ‘pe-libevent’ ‘pe-memcached’ ‘pe-live-management’ ‘pe-console-auth’ ‘pe-console’ ‘pe-certificate-manager’ ‘pe-license’ ‘pe-license-status’ ‘pe-event-inspector’ ‘pe-console-services’ ‘pe-postgresql-server’ ‘pe-postgresql-contrib’ ‘pe-postgresql’ ‘pe-java’ ‘pe-puppetdb’
Puppet Enterprise已安装到'/opt/puppet',其配置文件位于'/etc/puppetlabs'中。
Puppet安装说明说,我们必须确保打开以下TCP端口:443、4433、4435、8140、61613.
一切都应该运行:
# systemctl status -l pe-puppet.service # /opt/puppet/bin/puppet resource service