1 Star 0 Fork 90

清风 / Linux-Tutorial

forked from 冷川 / Linux-Tutorial 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
NTP.md 1.21 KB
一键复制 编辑 原始数据 按行查看 历史
Judas.n 提交于 2016-04-17 22:46 . 2016-04-17完善NTP文章

NTP(Network Time Protocol)介绍

NTP 安装

  • 查看是否已安装:

  • CentOS:rpm -qa | grep ntp-*

  • Ubuntu:dpkg -l | grep ntp-*

  • 安装:

  • CentOS 6:sudo yum install -y ntp

  • Ubuntu:sudo apt-get install -y ntp

NTP 服务器配置文件常用参数

  • 世界上可以校对时间节点:http://www.pool.ntp.org/zh
  • 中国时间校对服务器节点:http://www.pool.ntp.org/zone/cn
  • 配置文件介绍(记得先备份):sudo vim /etc/ntp.conf
  • NTP 服务器配置文件常用参数
  • 该配置解释:
    • 标注 1 是默认内容,我们这里进行了注释。
    • 标注 2 是新增内容,表示使用中国时间校对服务器节点地址。
    server 0.asia.pool.ntp.org
    server 1.asia.pool.ntp.org
    server 2.asia.pool.ntp.org
    server 3.asia.pool.ntp.org
  • 启动服务:
  • sudo service ntpd start
  • 服务加到启动项
    • CentOS 系统
      • sudo chkconfig ntpd on
    • Ubuntu 系统
      • sudo apt-get install -y sysv-rc-conf
      • sudo sysv-rc-conf ntpd on

NTP 资料

Shell
1
https://gitee.com/VIPhxp/Linux-Tutorial.git
git@gitee.com:VIPhxp/Linux-Tutorial.git
VIPhxp
Linux-Tutorial
Linux-Tutorial
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891