11G RAC 配置NTP服务器

51 篇文章 2 订阅
19 篇文章 0 订阅
  1. 11G RAC  配置NTP服务器  
  2.   
  3. tip01的IP:162.20.1.228  NTP服务端  
  4. tip02的IP:162.20.1.229  NTP客户端  
  5.   
  6. 配置NTP服务器之前,确认服务器已装好NTP包  
  7.   
  8. [root@tip01 ~]# rpm -qa  | grep ntp  
  9. ntp-4.2.2p1-9.el5_4.1  
  10. chkfontpath-1.10.1-1.1  
  11.   
  12. 然后再把服务器的系统时钟与硬件时间同步一下  
  13.   
  14. 先查看下系统  
  15. [root@tip01 ~]# date  
  16. 2012年05月20日 星期日 22:07:01 CST  
  17.   
  18. 查看硬件时钟  
  19. [root@tip01 ~]# hwclock   
  20. 2012年05月20日 星期日 13时33分46秒  -0.415712 seconds  
  21.   
  22. 这里,系统时钟与硬件时钟不同步,我们通过以下命令来把硬件时钟与系统时钟同步  
  23. [root@tip01 ~]# clock --systohc  
  24.   
  25. 在查看下系统时钟与硬件时钟,已经同步了  
  26.   
  27. [root@tip01 ~]# date  
  28. 2012年 05月20日 星期日 22:08:07 CST  
  29. [root@tip01 ~]# hwclock   
  30. 2012年 05月20日 星期日 22时08分12秒  -0.154372 seconds  
  31. [root@tip01 ~]#   
  32.   
  33.   
  34. 编辑tip01节点的配置文件  
  35.  
  36. # vi /etc/ntp.conf   
  37.   
  38. restrict default kod nomodify notrap nopeer noquery  
  39. restrict -6 default kod nomodify notrap nopeer noquery  
  40.   
  41. restrict 127.0.0.1   
  42. restrict -6 ::1  
  43.   
  44.   
  45. server  162.20.1.228    #  
  46. server  127.127.1.0     #local clock  
  47.   
  48. fudge   127.127.1.0 stratum 10  
  49. driftfile /var/lib/ntp/drift  
  50. keys /etc/ntp/keys  
  51.   
  52. restrict 162.20.1.228  mask 255.255.255.255 nomodify notrap noquery  
  53.   
  54.   
  55. 编辑tip02节点ntp.conf文件  
  56. # vi /etc/ntp.conf   
  57.   
  58. server tip01  
  59. restrict tip01 mask 255.255.255.255 nomodify notrap noquery  
  60.   
  61.   
  62. 3.分别在tip01,tip02上修改NTPD参数文件  
  63.  
  64. #vi /etc/sysconfig/ntpd  
  65.   
  66. SYNC_HWCLOCK=yes  
  67. OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"  
  68.  
  69. #RAC安装时需要检测的-x参  
  70.  
  71.  
  72. # cd /etc/ntp  
  73. # ls  
  74. keys  ntpservers  step-tickers  
  75.  
  76. # more ntpservers   
  77. #This file contains a list of ntp servers to show in the system-config-date user interface.  
  78. #It is not recommended that you modify this file by hand.  
  79.  
  80. #添加ntp 服务器地址或者主机名  
  81.  tip01  
  82.   
  83. 注:注意查看step-tickers内容,如果step-tickers错误也会导致ntp不同步  
  84.  
  85. # more step-tickers   
  86.   
  87.   
  88.   
  89. 在tip01,tip02上执行chkconfig,使NTP服务开机启动  
  90. [root@tip01 ~]# chkconfig  ntpd on  
  91. [root@tip02 ~]# chkconfig  ntpd on  
  92.   
  93.   
  94. [root@tip01 ~]# service ntpd restart  
  95. 关闭 ntpd:[确定]  
  96. ntpd: 同步时间服务器:[失败]  
  97. 启动 ntpd:[确定]  
  98.   
  99.   
  100.   
  101. 确保该端口以udp方式开放。  
  102. [root@tip01 ~]# netstat -an |grep 123  
  103. udp        0      0 192.168.99.228:123          0.0.0.0:*                                 
  104. udp        0      0 162.20.1.228:123            0.0.0.0:*                                 
  105. udp        0      0 127.0.0.1:123               0.0.0.0:*                                 
  106. udp        0      0 0.0.0.0:123                 0.0.0.0:*                                 
  107. udp        0      0 ::1:123                     :::*                                      
  108. udp        0      0 fe80::250:56ff:fe9d:123     :::*                                      
  109. udp        0      0 :::123                      :::*  
  110.   
  111. 查看ntp状态  
  112. [root@tip01 ~]# ntpstat   
  113.   
  114. synchronised to local net at stratum 11   
  115.    time correct to within 11 ms  
  116.    polling server every 1024 s  
  117.   
  118.   
  119. 在tip02节点启动ntp服务  
  120.   
  121. [root@tip02 ~]# service ntpd start  
  122. ntpd: 同步时间服务器:[确定]  
  123. 同步硬件时钟到系统时钟 [确定]  
  124. 启动 ntpd:[确定]  
  125.   
  126.   
  127. 切换至事先配好的grid用户来验证两节点时间  
  128.   
  129. [grid@tip02 ~]$ ssh tip01 date  
  130. 2012年 05月 20日 星期日 22:21:46 CST  
  131. [grid@tip02 ~]$ ssh tip02 date  
  132. 2012年 05月 20日 星期日 22:21:48 CST  
  133. [grid@tip02 ~]$  
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值