Linux-NTP-Server+Client
2015-09-03 20:57
501 查看
GMT/UTC/CST;
/etc/localtime,/usr/share/zoneinfo/*时区文件,/etc/profile加TZ变量;
硬件时间RTC,系统时间;date,hwclock,tzselect;
/usr/share/zoneinfo/Asia
zdump sichuan 查看对于每个time zone当前的时间
# hwclock --set --date="mm/dd/yy hh:mm:ss" 设置硬件时间我们可以开机的时候在BIOS里设定.也可以用hwclock命令
# date -s "dd/mm/yyyy hh:mm:ss" 修改系统时间用date命令就最简单了
1.设置时区
GMT:格林威治时区
UTC:世界协调时区
CST:中国标准时区
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
如果时区不对,删除、/etc/localtime,再配置
tzselect 》5) Asia--9) China--1) Beijing Time
2.Command
# hwclock --set --date="mm/dd/yy hh:mm:ss"
# date -s "dd/mm/yyyy hh:mm:ss"
# hwclock --systohc
# hwclock --hctosys
3.NTP SERVER
rpm -qa | grep ntp
yum -y ntpd install http://www.pool.ntp.org SERVER = cn.pool.ntp.org
ntpdate cn.pool.ntp.org
/etc/ntp.conf
#server cn.pool.ntp.org
#fudge 127.127.1.0 stratum 10 stratum
#driftfile /var/lib/ntp/ntp.drift
#restrict default kod nomodify notrap nopeer noquery 默认的client拒绝所有的操作
#restrict 127.0.0.1 允许本机地址一切
#restrict 192.168.1.0 mask 255.255.255.0 nomodify 允许局域网内所有client连接到这台服务器同步时间.
# /etc/init.d/ntpd start
# chkconfig --level 35 ntpd on
# vi /etc/sysconfig/ntpd
SYNC_HWCLOCK=yes
watch ntpq -p
4.NTP client的设置
/etc/ntp.conf
server 192.168.1.105
LINUX客户端使用
ntpdate 92.168.1.105
# hwclock --systohc
如果同步不成功检查:iptables need disable 或 tcp 123
/etc/localtime,/usr/share/zoneinfo/*时区文件,/etc/profile加TZ变量;
硬件时间RTC,系统时间;date,hwclock,tzselect;
/usr/share/zoneinfo/Asia
zdump sichuan 查看对于每个time zone当前的时间
# hwclock --set --date="mm/dd/yy hh:mm:ss" 设置硬件时间我们可以开机的时候在BIOS里设定.也可以用hwclock命令
# date -s "dd/mm/yyyy hh:mm:ss" 修改系统时间用date命令就最简单了
1.设置时区
GMT:格林威治时区
UTC:世界协调时区
CST:中国标准时区
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
如果时区不对,删除、/etc/localtime,再配置
tzselect 》5) Asia--9) China--1) Beijing Time
2.Command
# hwclock --set --date="mm/dd/yy hh:mm:ss"
# date -s "dd/mm/yyyy hh:mm:ss"
# hwclock --systohc
# hwclock --hctosys
3.NTP SERVER
rpm -qa | grep ntp
yum -y ntpd install http://www.pool.ntp.org SERVER = cn.pool.ntp.org
ntpdate cn.pool.ntp.org
/etc/ntp.conf
#server cn.pool.ntp.org
#fudge 127.127.1.0 stratum 10 stratum
#driftfile /var/lib/ntp/ntp.drift
#restrict default kod nomodify notrap nopeer noquery 默认的client拒绝所有的操作
#restrict 127.0.0.1 允许本机地址一切
#restrict 192.168.1.0 mask 255.255.255.0 nomodify 允许局域网内所有client连接到这台服务器同步时间.
# /etc/init.d/ntpd start
# chkconfig --level 35 ntpd on
# vi /etc/sysconfig/ntpd
SYNC_HWCLOCK=yes
watch ntpq -p
4.NTP client的设置
/etc/ntp.conf
server 192.168.1.105
LINUX客户端使用
ntpdate 92.168.1.105
# hwclock --systohc
如果同步不成功检查:iptables need disable 或 tcp 123
相关文章推荐
- linux运维实战练习-2015年8月30日课程作业
- centos6.5 下搭建lamp环境
- linux下运行C程序
- Linux export 命令
- linux命令进阶小记
- Linux rar乱码
- linux系统启动流程
- linux系统启动流程
- linux驱动篇之 driver_register 过程分析(一)
- centos7 安装zabbix-agent
- Linux系统mysql密码和远程访问设置
- linux下 mysql 操作
- Linux 系统挂载数据盘
- Linux设备驱动——字符驱动各种结构体
- Linux的O_DIRECT选项
- 从NFS启动Linux系统,OK6410
- 救援模式修复bootloader
- Linux学习之建立yum源、yum命令的使用及rpm包编译安装
- Centos7 安装zabbix-server
- CentOS 7 安装问题:dracut_initqueue[599]: Warning: Could not boot 原因,及解决办法