首页 > 网络 > 云计算 >

利用openstack建设适合中小型互联网企业的私有云(四)

2017-01-05

利用openstack建设适合中小型互联网企业的私有云。配置系统环境,实现时间服务器高可用:三台服务器,两台做控制节点,一台做计算节点,信息如下(根据自己环境,自行修改)。

利用openstack建设适合中小型互联网企业的私有云。配置系统环境,实现时间服务器高可用:

三台服务器,两台做控制节点,一台做计算节点,信息如下(根据自己环境,自行修改)。

192.168.101.4 controller1
192.168.101.3 controller2
192.168.101.1 compute1

两个控制节点VIP:

192.168.101.241 controller

一、配置系统环境

配置hosts(三台服务器均配置):

cat < /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.101.241 controller
192.168.101.4 controller1
192.168.101.3 controller2
192.168.101.1 compute1
EOF

二、实现时间服务器高可用

chrony既可做时间服务器服务端,也可做时间服务器客户端,且自带高可用功能。这里采用chrony搭建高可用时间服务器(ntp的服务端和客户端ntpdate不能同在一台机器上,且配置高可用比较麻烦,CentOS 7以后chrony逐步替代了ntp)。

1.节点controller1

yum install chrony -y
cat < /etc/chrony.conf
server s2m.time.edu.cn iburst
stratumweight 0
driftfile /var/lib/chrony/drift
rtcsync
makestep 10 3
allow 192.168.101.0/24
bindcmdaddress 127.0.0.1
bindcmdaddress ::1
keyfile /etc/chrony.keys
commandkey 1
generatecommandkey
noclientlog
logchange 0.5
logdir /var/log/chrony
EOF
systemctl enable chronyd.service
systemctl start chronyd.service

2.节点controller2

yum install chrony -y
cat < /etc/chrony.conf
server s2m.time.edu.cn iburst
stratumweight 0
driftfile /var/lib/chrony/drift
rtcsync
makestep 10 3
allow 192.168.101.0/24
bindcmdaddress 127.0.0.1
bindcmdaddress ::1
keyfile /etc/chrony.keys
commandkey 1
generatecommandkey
noclientlog
logchange 0.5
logdir /var/log/chrony
EOF
systemctl enable chronyd.service
systemctl start chronyd.service

3.节点compute1

yum install chrony -y
cat < /etc/chrony.conf
server controller iburst
server controller1 iburst
server controller2 iburst
stratumweight 0
driftfile /var/lib/chrony/drift
rtcsync
makestep 10 3
allow 192.168.101.0/24
bindcmdaddress 127.0.0.1
bindcmdaddress ::1
keyfile /etc/chrony.keys
commandkey 1
generatecommandkey
noclientlog
logchange 0.5
logdir /var/log/chrony
EOF
systemctl enable chronyd.service
systemctl start chronyd.service

4.验证

两个控制节点:

# chronyc sources
210 Number of sources = 1
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
^* ns.pku.edu.cn                 2   6   377    61   -109us[ -212us] +/-  920ms

计算节点:
# chronyc sources
210 Number of sources = 3
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
^? controller                    0  10     0   10y     +0ns[   +0ns] +/-    0ns
^+ controller1                   3   6   377    62   +985us[ +703us] +/-  159ms
^* controller2                   3   6   377     6   -723us[-1135us] +/-  162ms

出现如上即为配置成功。
相关文章
最新文章
热点推荐