作者:尹正杰
版权声明:原创作品,谢绝转载!否则将追究法律责任。
一.配置网卡bond模式
博主推荐阅读:
https://www.cnblogs.com/yinzhengjie/p/10334705.html
https://www.cnblogs.com/yinzhengjie/p/12178304.html
二.搭建时间同步服务器
1>.ntpd服务端安装ntp服务
[root@manage110.yinzhengjie.org.cn ~]# yum -y install ntp
Loaded plugins: fastestmirror
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirror.bit.edu.cn
* updates: mirror.bit.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package ntp.x86_64 0:4.2.6p5-29.el7.centos will be installed
--> Processing Dependency: libopts.so.25()(64bit) for package: ntp-4.2.6p5-29.el7.centos.x86_64
--> Running transaction check
---> Package autogen-libopts.x86_64 0:5.18-5.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================================================================================================================================================
Installing:
ntp x86_64 4.2.6p5-29.el7.centos base 548 k
Installing for dependencies:
autogen-libopts x86_64 5.18-5.el7 base 66 k
Transaction Summary
==============================================================================================================================================================================================================================================================================
Install 1 Package (+1 Dependent package)
Total download size: 614 k
Installed size: 1.5 M
Downloading packages:
(1/2): autogen-libopts-5.18-5.el7.x86_64.rpm | 66 kB 00:00:00
(2/2): ntp-4.2.6p5-29.el7.centos.x86_64.rpm | 548 kB 00:00:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 1.4 MB/s | 614 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : autogen-libopts-5.18-5.el7.x86_64 1/2
Installing : ntp-4.2.6p5-29.el7.centos.x86_64 2/2
Verifying : ntp-4.2.6p5-29.el7.centos.x86_64 1/2
Verifying : autogen-libopts-5.18-5.el7.x86_64 2/2
Installed:
ntp.x86_64 0:4.2.6p5-29.el7.centos
Dependency Installed:
autogen-libopts.x86_64 0:5.18-5.el7
Complete!
[root@manage110.yinzhengjie.org.cn ~]#
[root@manage110.yinzhengjie.org.cn ~]# yum -y install ntp
2>.修改ntpd服务端的配置文件
[root@manage110.yinzhengjie.org.cn ~]# egrep -v "^#|^$" /etc/ntp.conf
driftfile /var/lib/ntp/drift
restrict 192.168.0.0 mask 255.255.248.0 nomodify notrap
server 127.127.1.0
fudge 127.127.1.0 stratum 10
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
disable monitor
[root@manage110.yinzhengjie.org.cn ~]#
[root@manage110.yinzhengjie.org.cn ~]# echo SYNC_HWCLOCK=yes >> /etc/sysconfig/ntpd
[root@manage110.yinzhengjie.org.cn ~]#
3>.ntpd服务端启动ntpd服务
[root@manage110.yinzhengjie.org.cn ~]# systemctl start ntpd
[root@manage110.yinzhengjie.org.cn ~]#
[root@manage110.yinzhengjie.org.cn ~]# systemctl enable ntpd
Created symlink from /etc/systemd/system/multi-user.target.wants/ntpd.service to /usr/lib/systemd/system/ntpd.service.
[root@manage110.yinzhengjie.org.cn ~]#
[root@manage110.yinzhengjie.org.cn ~]# systemctl status ntpd
● ntpd.service - Network Time Service
Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
Active: active (running) since Sun 2020-01-12 17:51:05 CST; 13s ago
Process: 2726 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 2727 (ntpd)
CGroup: /system.slice/ntpd.service
└─2727 /usr/sbin/ntpd -u ntp:ntp -g
Jan 12 17:51:05 manage110.yinzhengjie.org.cn ntpd[2727]: Listen normally on 5 lo ::1 UDP 123
Jan 12 17:51:05 manage110.yinzhengjie.org.cn ntpd[2727]: Listen normally on 6 eth3 fe80::20c:29ff:feae:eac5 UDP 123
Jan 12 17:51:05 manage110.yinzhengjie.org.cn ntpd[2727]: Listen normally on 7 eth1 fe80::20c:29ff:feae:eac5 UDP 123
Jan 12 17:51:05 manage110.yinzhengjie.org.cn ntpd[2727]: Listen normally on 8 eth2 fe80::20c:29ff:feae:eabb UDP 123
Jan 12 17:51:05 manage110.yinzhengjie.org.cn ntpd[2727]: Listen normally on 9 eth0 fe80::20c:29ff:feae:eabb UDP 123
Jan 12 17:51:05 manage110.yinzhengjie.org.cn ntpd[2727]: Listening on routing socket on fd #26 for interface updates
Jan 12 17:51:05 manage110.yinzhengjie.org.cn ntpd[2727]: 0.0.0.0 c016 06 restart
Jan 12 17:51:05 manage110.yinzhengjie.org.cn ntpd[2727]: 0.0.0.0 c012 02 freq_set kernel 0.000 PPM
Jan 12 17:51:05 manage110.yinzhengjie.org.cn ntpd[2727]: 0.0.0.0 c011 01 freq_not_set
Jan 12 17:51:06 manage110.yinzhengjie.org.cn ntpd[2727]: 0.0.0.0 c514 04 freq_mode
[root@manage110.yinzhengjie.org.cn ~]#
4>.客户端同步ntp服务器端的时间
[root@computing121.yinzhengjie.org.cn ~]# date
Sun Jan 12 18:23:59 CST 2020
[root@computing121.yinzhengjie.org.cn ~]#
[root@computing121.yinzhengjie.org.cn ~]# ll /var/spool/cron/root
-rw------- 1 root root 0 Jan 12 10:42 /var/spool/cron/root
[root@computing121.yinzhengjie.org.cn ~]#
[root@computing121.yinzhengjie.org.cn ~]# crontab -l
[root@computing121.yinzhengjie.org.cn ~]#
[root@computing121.yinzhengjie.org.cn ~]# echo "*/10 * * * * /usr/sbin/ntpdate 172.30.7.110 && /usr/sbin/hwclock -w" > /var/spool/cron/root
[root@computing121.yinzhengjie.org.cn ~]#
[root@computing121.yinzhengjie.org.cn ~]# ll /var/spool/cron/root
-rw------- 1 root root 68 Jan 12 10:42 /var/spool/cron/root
[root@computing121.yinzhengjie.org.cn ~]#
[root@computing121.yinzhengjie.org.cn ~]# crontab -l
*/10 * * * * /usr/sbin/ntpdate 172.30.7.110 && /usr/sbin/hwclock -w
[root@computing121.yinzhengjie.org.cn ~]#
[root@computing121.yinzhengjie.org.cn ~]# systemctl restart crond
[root@computing121.yinzhengjie.org.cn ~]#
[root@computing121.yinzhengjie.org.cn ~]# date
Sun Jan 12 10:36:40 CST 2020
[root@computing121.yinzhengjie.org.cn ~]#
三.根据官网的中文文档继续后续安装即可
博主推荐阅读:
https://docs.openstack.org/ocata/zh_CN/install-guide-rdo/environment-packages.html#
实际生产环境中一般使用ocata版本较多,遗憾的是,在2020年OpenStack官网对ocata停止yum源的支持,因此得自建yum仓库进行安装。