
大家好我是sean,因用户需求,首次在制造环境打造ntp服务
硬件环境状况
准备2台独立服务器,分别为:
10.3.3.62/192.168.36.230 ntpd服务器oracle rac集群搭建oracle rac集群搭建,用于与内部公共ntpd同步标准时间
10.3.3.64/192.168.36.85 ntpd客户端,用于与ntpd同步时间
系统环境
Oracle linux7.3 x86_64
Oracle rac 集群版本 11.2.0.3
检测2台机器是否调试
[root@a05 ~]# rpm -q ntp
ntp-4.2.6p5-28.0.1.el7.x86_64
如果尚未安装则略过此步,否则使用yum进行调试,并修改平台开机自动开启并开展服务
yum -y install ntp
systemctl enable ntpd(如果修改了这一步还是开难以推进,那么执行systemctl disable chronyd.service )
systemctl start ntpd
设置ntp服务器10.3.3.62
配置前先使用命令:ntpdate -u cn.pool.ntp.org,同步服务器
修改/etc/ntp.conf文件,红标是设置的内容
# For more information about this file, see the man pages
# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).
driftfile /var/lib/ntp/drift
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default nomodify notrap nopeer noquery
# Permit all access over the loopback interface. This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1
restrict ::1
# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

restrict 192.168.36.0 mask 255.255.255.0 nomodify notrap
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool ().
#server 0.rhel.pool.ntp.org iburst
#server 1.rhel.pool.ntp.org iburst
#server 2.rhel.pool.ntp.org iburst
#server 3.rhel.pool.ntp.org iburst
#server 2.cn.pool.ntp.org
#server 1.asia.pool.ntp.org
#server 2.asia.pool.ntp.org
#server 127.127.1.0
#broadcast 192.168.1.255 autokey # broadcast server
#broadcastclient # broadcast client
#broadcast 224.0.1.1 autokey # multicast server
#multicastclient 224.0.1.1 # multicast client
#manycastserver 239.255.254.254 # manycast server
#manycastclient 239.255.254.254 autokey # manycast client
#restrict 2.cn.pool.ntp.org nomodify notrap noquery
#restrict 1.asia.pool.ntp.org nomodify notrap noquery
restrict 127.127.1.0 nomodify notrap noquery
server 127.0.0.1 # local clock
fudge 127.0.0.1 stratum 10
# Enable public key cryptography.
#crypto
includefile /etc/ntp/crypto/pw
# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography.
keys /etc/ntp/keys
# Specify the key identifiers which are trusted.
#trustedkey 4 8 42
# Specify the key identifier to use with the ntpdc utility.

#requestkey 8
# Specify the key identifier to use with the ntpq utility.
#controlkey 8
# Enable writing of statistics records.
#statistics clockstats cryptostats loopstats peerstats
# Disable the monitoring facility to prevent amplification attacks using ntpdc
# monlist command when default restrict does not include the noquery flag. See
# CVE-2013-5211 for more details.
# Note: Monitoring will not be disabled with the limited restriction flag.
disable monitor
修改完成后重启ntpd服务systemctl restart ntpd
使用ntpq -p 查看网络中的NTP服务器,同时显示客户端和每个服务器的关系
使用ntpstat 命令查看时间同步状况,这个大概应该5-10分钟后就能顺利连接和同步。所以,服务器启动后必须稍等下:
刚开启的之后,一般是:
# ntpstat
unsynchronised
time server re-starting
polling server every 64 s
连接并同步后:
# ntpstat
synchronised to NTP server (202.112.10.36) at stratum 3
time correct to within 275 ms
polling server every 256 s
设置客户端:10.3.3.64
安装ntp服务并修改为手动开启,和上面的设定方法同样。然后编辑/etc/ntp.conf文件,红标为变化的内容。
# For more information about this file, see the man pages
# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).
driftfile /var/lib/ntp/drift
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default nomodify notrap nopeer noquery

# Permit all access over the loopback interface. This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1
restrict ::1
# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool ().
#server 0.centos.pool.ntp.org iburst
server 192.168.36.230
restrict 192.168.36.230 nomodify notrap noquery
server 127.0.0.1
fudge 127.0.0.1 stratum 10
#broadcast 192.168.1.255 autokey # broadcast server
#broadcastclient # broadcast client
#broadcast 224.0.1.1 autokey # multicast server
#multicastclient 224.0.1.1 # multicast client
#manycastserver 239.255.254.254 # manycast server
#manycastclient 239.255.254.254 autokey # manycast client
# Enable public key cryptography.
#crypto
includefile /etc/ntp/crypto/pw
# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography.
keys /etc/ntp/keys
# Specify the key identifiers which are trusted.
#trustedkey 4 8 42
# Specify the key identifier to use with the ntpdc utility.
#requestkey 8
# Specify the key identifier to use with the ntpq utility.

#controlkey 8
# Enable writing of statistics records.
#statistics clockstats cryptostats loopstats peerstats
# Disable the monitoring facility to prevent amplification attacks using ntpdc
# monlist command when default restrict does not include the noquery flag. See
# CVE-2013-5211 for more details.
# Note: Monitoring will not be disabled with the limited restriction flag.
disable monitor
ntpdate 192.168.36.230
Ntpdate -u 192.168.36.230
重启ntpd服务
#systemctl restart ntpd
启动后,查看同步状况
# ntpq -p
# ntpstat


后期发现oraclerac集群ntp报错


解决方法是必须填写到下面内容文件(每台机器都应该添加)
[root@rac1 ~]# cat /etc/sysconfig/ntpd
# Command line options for ntpd
#OPTIONS="-g"
OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"
SYNC_HWCLOCK=no
NTPDATE_OPTIONS=""
[root@rac2 ~]# cat /etc/sysconfig/ntpd
# Command line options for ntpd
#OPTIONS="-g"
OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"
SYNC_HWCLOCK=no
NTPDATE_OPTIONS=""
第一次在制造环境这么搞,不足之处请你们多多指点,自己折腾吧返回搜狐,查看更多
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/ruanjian/article-129209-1.html
气死我啦
倒是身边守着世界最大的市场
刚开战没多久