Chinaunix首页 | 论坛 | 博客
  • 博客访问: 12698
  • 博文数量: 8
  • 博客积分: 1415
  • 博客等级: 上尉
  • 技术积分: 90
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-13 08:24
文章分类

全部博文(8)

文章存档

2010年(8)

我的朋友

分类: Oracle

2010-03-13 10:22:41

    根据三思的笔记,配置好node2后,发现node1的时间和node2的时间与主机的时间相差甚远。现在已解决同步。方法如下:
1、安装vmware-config-tools
2、修改ntp的配置,详见鸟哥的linux私房菜,
[root@node1 ~]# vi /etc/ntp.conf
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer
restrict -6 default kod nomodify notrap nopeer
# 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 -6 ::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 210.72.145.44 prefer
server 218.21.130.42
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
#server 0.rhel.pool.ntp.org
#server 1.rhel.pool.ntp.org
#server 2.rhel.pool.ntp.org
#broadcast 192.168.1.255 key 42         # broadcast server
#broadcastclient                        # broadcast client
#broadcast 224.0.1.1 key 42             # multicast server
#multicastclient 224.0.1.1              # multicast client
#manycastserver 239.255.254.254         # manycast server
#manycastclient 239.255.254.254 key 42  # manycast client
# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available.
server  127.127.1.0     # local clock
fudge   127.127.1.0 stratum 10
# Drift file.  Put this in a directory which the daemon can write to.
# No symbolic links allowed, either, since the daemon updates the file
# by creating a temporary in the same directory and then rename()'ing
# it to the file.
driftfile /var/lib/ntp/drift
# 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
3、查看ntp状态
[root@node1 ~]# watch ntpq -p
4、在node2,写脚本,用crontab,每分钟同步node1
[root@node2 tmp]# more ntp.sh
#!/bin/bash
/usr/sbin/ntpdate node1
[root@node2 tmp]# crontab -l
*/1 * * * * sh /tmp/ntp.sh 2>&1>>/tmp/ntp.log
5、实验表明node2这样配置不行,于是node2也启用ntpd服务,只不过server多了node1
阅读(541) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~