[root@localhost ~]# ntpdate time.nist.gov

虚拟机时间不对   自动同步   sudo ntpdate asia.pool.ntp.org

要是同步后时间还是不对可能是时区没设置好

zzx@zzx120:~$           sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime   //调整时区               再 sudo ntpdate -u time.twc.weather.com

ubuntu server ntp时间同步服务器安装及使用           date

1 * * * * ntpdate asia.pool.ntp.org

crontab中写同步    * * * * * /sbin/ntpdate time.nist.gov  # /sbin/一定要加

手动修改系统时间 date -s 07/11/98

~~~~~~~~~~~~~~~~~~~

网络同步 ntpdate 210.72.145.44

手动同步   date -s "20091112 18:30:50" &&hwclock --systohc

~~~~~~~~~~~~~~~~~~~~

一、服务端

1 apt-get install ntp

2 安装后默认启动服务,如果没有启动,启动之。

/etc/init.d/ntp start

3 vi /etc/ntp.conf 修改为如下

restrict default nomodify notrap noquery

restrict 127.0.0.1

restrict 10.91.0.0 mask 255.255.255.0 nomodify

server 0.pool.ntp.org

server 1.pool.ntp.org

server 2.pool.ntp.org

server  127.127.1.0     # local clock

fudge   127.127.1.0 stratum 10

driftfile /var/lib/ntp/drift

broadcastdelay  0.008

keys            /etc/ntp/keys

4 重启ntp服务

/etc/init.d/ntp restart

二、客户端

1 使用ntpdate命令,如果不存在这个命令,则先安装apt-get install ntp

/usr/sbin/ntpdate 10.91.0.10 //即使用ip为10.91.0.10的ntp服务器同步时间

2 设置定时同步。

vi /etc/crontab

30 01 * * * /usr/sbin/ntpdate 10.91.0.10

系统便会在每天早上1点30分自动将系统时间同步到ntp服务器的时间。

当然这里crontab的时间是指客户端的时间,同步后等同于ntp服务器的时间。

ntp时间同步服务器的更多相关文章

  1. centos7搭建ntp时间同步服务器chrony服务

    centos7搭建ntp时间同步服务器chrony服务 前言: 在centos6的时候我们基本使用的是ntp服务用来做时间同步,但是在centos7后推荐是chrony作为时间同步器的服务端使用, ...

  2. 张高兴的 .NET IoT 入门指南:(八)基于 GPS 的 NTP 时间同步服务器

    时间究竟是什么?这既可以是一个哲学问题,也可以是一个物理问题.古人对太阳进行观测,利用太阳的投影发明了日晷,定义了最初的时间.随着科技的发展,天文观测的精度也越来越准确,人们发现地球的自转并不是完全一 ...

  3. ntp时间同步服务器的搭建

    CentOS系统一般自带安装有ntp服务,仅需做相关配置即可. 一.配置ntp服务器: 在选定的ntp服务器上vim /etc/ntp.conf 添加一行:restrict default nomod ...

  4. NTP时间同步服务器设置

    一.Window Server设置 [服务器端设置]1) 修改注册表以下键值:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\ ...

  5. Linux下搭建ntp时间同步服务器

    1.ntpd软件安装(略过) 2.修改ntp.conf配置文件 vi /etc/ntp.conf 第一种配置:允许任何IP的客户机都可以进行时间同步将“restrict default kod nom ...

  6. CentOS装个NTP时间同步服务器

    服务端: driftfile /var/lib/ntp/drift restrict default nomodify notrap nopeer noquery restrict 127.0.0.1 ...

  7. 【转】Linux配置NTP时间同步服务器

    分布式程序通常需要运行在一个统一的时间环境里. 转自:http://blog.csdn.net/mengfanzhundsc/article/details/62046562 安装NTP:yum in ...

  8. 【Linux】部署NTP时间同步服务器

    1. 查看机器的Linux版本 查看集群内所有服务器的linux版本,确保相同,不要跨大版本. [root@bigdata111 ~]# cat /etc/redhat-release CentOS ...

  9. .bat脚本将windows server 2008设置成ntp时间同步服务器

    @echo off echo autor OAK @echo off echo -------------------------------- @echo off REG ADD HKEY_LOCA ...

随机推荐

  1. computed、methods、watch

    computed:计算属性将被混入到 Vue 实例中.所有 getter 和 setter 的 this 上下文自动地绑定为 Vue 实例. methods:methods 将被混入到 Vue 实例中 ...

  2. IOS 导航栏颜色 标题

    修改导航栏颜 #define COLOR_TOMATO    [UIColor colorWithRed:255/255.0f green:99/255.0f blue:71/255.0f alpha ...

  3. 小程序行内元素且有border的情况下,根据文字宽度自动调节元素宽度

    比如认识成都: <view style="display: flex;align-items: center;"> <text class="cityV ...

  4. ubuntu18.04 LAMP DVWA

    一.基本擦作: sudo apt-get install lamp-server^ sudo chmod 777 /var/www #也有可能是/var/www/html,访问127.0.0.1验证是 ...

  5. 吴裕雄 Bootstrap 前端框架开发——Bootstrap 辅助类:内容居中

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  6. 2018--Linux命令总结整理复习版

    一.ls命令: 用来显示目标列表,在Linux中是使用率较高的命令.ls命令的输出信息可以进行彩色加亮显示,以分区不同类型的文件. -a:显示所有档案及目录(ls内定将档案名或目录名称为“.”的视为影 ...

  7. (实例)Linux 内核添加exfat驱动

    背景: 由于exfat是常用的文件系统格式,而Linux由于版权的问题,没有在官方中添加有关的驱动. 但是 微软也同意开源了,所以比较新的 Linux 会支持这一块. 为了支持exfat的驱动,我们需 ...

  8. leetcode817 Linked List Components

    """ We are given head, the head node of a linked list containing unique integer value ...

  9. 二、Vue组件(component):组件的相互引用、通过props实现父子组件互传值

    一.组件各部分说明及互相引用 1.一个vue组件由三个部分组成 Template 只能存在一个根元素 2.Script 3.Style scoped:样式只在当前组件内生效 1.1 组件的基本引用代码 ...

  10. jdbc oracle 连接串

    jdbc.url配置为: jdbc:oracle:thin:@xxx.xx.xx.xx:1521:orclpdb 报错: java.sql.SQLException: Listenerrefused ...