Linux-NTP-Server+Client
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
Linux-NTP-Server+Client的更多相关文章
- win2003系统同步Linux ntp server批处理
最后更新时间: 2018/12/15 一般windows配置时间服务器,只需要在windows系统右下角,点时间,里面配置好对应NTP服务器地址就行, 至多再修改一下注册表 HKEY_LOCAL_MA ...
- L01-RHEL6.5中部署NTP(ntp server + client)
RHEL6.5集群中部署NTP NTP全称为Network Time Protocol,即网络时间协议.一般在Linux系统中用来同步集群中不同机器的时间. 本文描述的ntp服务部署框架如下图示 如上 ...
- linux+udp+server+client
一.客户端 #include<sys/types.h> #include<sys/socket.h> #include<netinet/in.h> #include ...
- linux 下使rdate命令支持ipv6 ntp server 同步时间
如果使用linux 下,busybox自带的rdate命令 去ipv6 的ntp server 同步时间的话,会提示invalid argument :无效参数. 那么现在下载rdate的源码并对其进 ...
- Linux NTP服务器的搭建及client自动更新时间
Network Time Protocol(NTP)是用来使计算机时间同步化的一种协议,它可以使计算机对其服务器或时钟源(如石英钟,GPS等等)做同步化,它可以提供高精准度的时间校正(LAN上与标准间 ...
- linux c server and client 简单的通信
server.c #include <stdlib.h> #include <stdio.h> #include <errno.h> #include <st ...
- Linux 上配置 NTP SERVER
在CENTOS 6.2上面安装配置NTP SERVER 安装NTP:yum install ntp 配置时间源vi /etc/ntp.confserver 210.72.145.44server nt ...
- linux ntp时间同步
linux ntp时间同步 一.搭建时间同步服务器1.编译安装ntp serverrpm -qa | grep ntp若没有找到,则说明没有安装ntp包,从光盘上找到ntp包,使用rpm -Uvh n ...
- linux ntp时间服务器配置
Network Time Protocol (NTP) 也是RHCE新增的考试要求. 学习的时候也顺便复习了一下如何设置Linux的时间,现在拿出来和大家分享 设置NTP服务器不难但是NTP本身是一个 ...
- linux NTP配置
时间是由计算机内的石英晶体振荡电路以:NetworkTimeProtocol(NTP):通常情况下,时间同步是按以下步骤进行的::(1):NTP客 户端向NTP服务器发出一个时间请:(2):当服务器接 ...
随机推荐
- UVA1476 三分法
单峰函数(即先递增后递减,有极大值的函数),都可以用三分法来求 #include <iostream> #include <cmath> #include <cstdio ...
- WCF中DataContractAttribute 类
一.这个类的作用 使用提供的数据协定,将类型实例序列化和反序列化为 XML 流或文档.无法继承此类,(DataContractSerializer 用于序列化和反序列化在 Windows Commun ...
- beta 阶段的 postmortem 报告
part一: 用户数:目前约30人 总结:与当初的预算差不多,首先1.第一次开发软件,经验效率不足,那是很正常的事情.2.用户数量少,因为宣传力度还是比较的少.应该加强软件的推广才行. part二: ...
- LeetCode Search a 2D Matrix II (技巧)
题意: 有一个矩阵,每行有序,每列也有序.判断一个数target是否存在于此矩阵中. 思路: 从右上角开始,如果当前数字<target,则该行作废.若当前数字>target,该列作废.这样 ...
- notebook
1. 2.
- libvirtError: no connection driver available for qemu:///system 解决办法
今天部署了一套K版的OpenStack环境后,启动nova-compute后,日志里狂报如下错误(因为其内部有定时任务需要去连libvirtd进程): 2015-08-14 10:01:00.061 ...
- 发布b3log-solo后,访问http://localhost:8080/b3log-solo/提示错误为staticServePath Error。
发布b3log-solo后,访问http://localhost:8080/b3log-solo/提示错误为staticServePath Error. latke.props内容为: serverS ...
- hdu 5093 Battle ships
二分图匹配 #include<cstdio> #include<cstring> #include<iostream> #include<cmath> ...
- vimrc配置文件_version1.0_+pathogen, taglist, wordcomplete插件说明
为了表示对Ruchee的感谢,首先这是Ruchee的个人网站:http://www.ruchee.com/index.html,他的以前很多的代码都放到Git里面了,里面有链接. 看了整整一天,刚开始 ...
- leetcode 107 Binary Tree Level Order Traversal II ----- java
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left ...