RedHat6.5 puppet配置(一)-准备工作

来源:互联网 发布:各类数据出售 编辑:程序博客网 时间:2024/05/22 08:27

一、设备信息

openstack平台上创建4台Redhat6.5 64bit 虚拟机,其中一个作为puppet-master节点,其他3台作为puppet-client节点使用puppet模块安装部署glusterfs副本模式集群。信息如下

hostname(short) FQDN OS version Network(eth0) NTP server puppet-master puppet-master.example.com RedHat 6.5 min+DevTools 10.59.2.201 10.59.63.16 glusterfs01 glusterfs01.example.com RedHat 6.5 min+DevTools 10.59.2.202 10.59.63.16 glusterfs02 glusterfs02.example.com RedHat 6.5 min+DevTools 10.59.2.203 10.59.63.16 glusterfs03 glusterfs03.example.com RedHat 6.5 min+DevTools 10.59.2.204 10.59.63.16

Puppet 要求所有机器有完整的域名,如果没有 DNS 服务器提供域名可以在两台机器上设置主机名(配置/etc/hosts文件)。需要先设置主机名再安装 Puppet,因为安装 Puppet 时会把主机名写入证书,客户端和服务端通信需要这个证书。本测试使用DNS服务,地址10.59.63.17,域名为example.com,即

[root@all-node ~#] cat /etc/resolv.confsearch example.comnameserver 10.59.63.17

二. 本次环境配置将安装的puppet,glusterfs版本

name version comment puppet-server 3.8.4 3系列最新版本 puppet 3.8.4 3系列最新版本 puppet-dashboard 1.2.23 最新稳定版本 glusterfs* 3.6.6 3.6系列最新版本 ruby 1,8.7.352 yum源封装版本 mysql 5.1.71 yum源封装版本

Redhat6.5 软件源下puppet、glusterfs版本比较低,不符合我们的要求,我们需要额外下载RPM包进行安装或者直接使用源代码编译安装

软件 下载地址 puppet http://downloads.puppetlabs.com/puppet/ puppet-dashboard http://downloads.puppetlabs.com/dashboard/ glusterfs http://download.gluster.org/pub/gluster/glusterfs/3.6/3.6.6/

三. 系统初始配置

1. RedHat6.5 64bit软件源配置为本地软件源,信息如下

[root@puppet-master yum.repos.d]# cat epel.repo [epel]name=Extra Packages for Enterprise Linux 6 - $basearchbaseurl=http://10.59.63.224/epel/6/$basearchfailovermethod=priorityenabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6[epel-debuginfo]name=Extra Packages for Enterprise Linux 6 - $basearch - Debugbaseurl=http://10.59.63.224/epel/6/$basearch/debugfailovermethod=priorityenabled=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6gpgcheck=1
[root@puppet-master yum.repos.d]# cat rhel-source.repo [rhel-source]name=Red Hat Enterprise Linux $releasever - $basearch - Sourcebaseurl=http://10.59.63.224/rhel6.5enabled=1gpgcheck=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

2. 查询Redhatb6.5 软件源已包含puppet版本以及gluster-puppet版本

[root@puppet-master ~]# yum search all puppetpuppet-gluster.noarch      :A Puppet module for GlusterFSpuppet-gluster-doc.noarch  :A Puppet module for GlusterFSpuppet-server.noarch       :Server for the puppet system management toolpuppet.noarch              :A network tool for managing many disparate systemsfacter.x86_64              :Command and ruby library for gathering system information

3. 查询RedHat6.5 puppet以及gluster的puppet模块的版本号

[root@puppet-master ~]# yum info puppet-serverName        : puppet-serverArch        : noarchVersion     : 2.7.26Release     : 2.el6Repo        : epelSummary     : Server for the puppet system management tool[root@puppet-master ~]# yum info puppet-glusterName        : puppet-glusterArch        : noarchVersion     : 0.0.3Release     : 1.el6Repo        : epelSummary     : A Puppet module for GlusterFS[root@puppet-master ~]# yum info glusterfsName        : glusterfsArch        : x86_64Version     : 3.4.0.36rhsRelease     : 1.el6Repo        : rhel-sourceSummary     : Cluster File System

可以看到本地源封装的puppet以及gluster模块包版本比较低,本文档采用采用在线下载rpm方式部署比较新的版本。

4. 关闭服务器的Selinux,iptables,配置ntp服务器

# 关闭selinux[root@puppet-master ~]# sed -i '/SELINUX/ s/enforcing/disabled/g' /etc/selinux/config
# 停止iptables服务,并禁止自启动[root@puppet-master ~]# chkconfig iptables off[root@puppet-master ~]# service iptables stop
安装配置ntp服务[root@puppet-master ~]# yum install ntp[root@puppet-master ~]# chkconfig ntpd on[root@puppet-master ~]# service ntpd start[root@puppet-master ~]# cp /etc/ntpd.conf /etc/ntpd.conf.ori# 配置npt.conf,完成后如下[root@puppet-master ~]# cat /etc/ntp.confserver  10.59.63.16driftfile /var/lib/ntp/driftkeys            /etc/ntp/keys[root@puppet-master ~]# ntpq -p     remote           refid      st t when poll reach   delay   offset  jitter==============================================================================*10.59.63.16     202.112.31.197   3 u   78  128  377    0.534   -2.059   0.450

5. 配置hostname解析[Optional]

本实验采用DNS服务器,所以该步骤不会执行,而是如开头编辑/etc/resolv.cof配置DNS域名解析。

如果没有使用DNS服务,需要puppet-master以及各个puppetclient节点配置hostname解析

[root@XXXXXX ~]# cat /etc/hosts127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4::1         localhost localhost.localdomain localhost6 localhost6.localdomain610.59.2.201 puppet-master puppet-master.example.com10.59.2.202 glusterfs01   glusterfs01.example.com10.59.2.203 glusterfs02   glusterfs02.example.com10.59.2.204 glusterfs03   glusterfs03.example.com
0 0
原创粉丝点击