Ubuntu安装NTP Server很简单,分位3步走:

第一步:安装NTP

root@cephadmin:~/ceph-cluster# apt-get install ntp
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libopts25
Suggested packages:
ntp-doc
The following NEW packages will be installed:
libopts25 ntp
upgraded, newly installed, to remove and not upgraded.
Need to get kB of archives.
After this operation, , kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get: http://cn.archive.ubuntu.com/ubuntu/ trusty/main libopts25 amd64 1:5.18-2ubuntu2 [55.3 kB]
Get: http://cn.archive.ubuntu.com/ubuntu/ trusty-updates/main ntp amd64 1:4.2.6.p5+dfsg-3ubuntu2.14.04.10 [421 kB]
Fetched kB in 0s ( kB/s)
Selecting previously unselected package libopts25:amd64.
(Reading database ... files and directories currently installed.)
Preparing to unpack .../libopts25_1%3a5.-2ubuntu2_amd64.deb ...
Unpacking libopts25:amd64 (:5.18-2ubuntu2) ...
Selecting previously unselected package ntp.
Preparing to unpack .../ntp_1%3a4.2.6.p5+dfsg-3ubuntu2.14.04.10_amd64.deb ...
Unpacking ntp (:4.2..p5+dfsg-3ubuntu2.14.04.) ...
Processing triggers for ureadahead (0.100.-) ...
ureadahead will be reprofiled on next reboot
Processing triggers for man-db (2.6.7.1-) ...
Setting up libopts25:amd64 (:5.18-2ubuntu2) ...
Setting up ntp (:4.2..p5+dfsg-3ubuntu2.14.04.) ...
* Starting NTP server ntpd [ OK ]
Processing triggers for libc-bin (2.19-0ubuntu6) ...
Processing triggers for ureadahead (0.100.-) ... root@cephadmin:~/ceph-cluster# service ntp status
* NTP server is running

第二步:修改ntp.conf配置文件

1) 添加公网NTP Server

 server 120.24.166.46   (阿里云NTP Server)

2) 允许的NTP Client网段

restrict 10.138.0.0 mask 255.255.0.0 nomodify
# Enable this if you want statistics to be logged.
#statsdir /var/log/ntpstats/ #也可以开启NTP log statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable # Specify one or more NTP servers. # Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
# on -- (LP: #). See http://www.pool.ntp.org/join.html for
# more information.
server 120.24.166.46 # 阿里云NTP Server
server 127.127.
1.0 # 如果公网NTP不可用时,将使用Local时间作为NTP服务提供给NTP Client。 # Use Ubuntu's ntp server as a fallback.
server ntp.ubuntu.com # Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
# details. The web page <http://support.ntp.org/bin/view/Support/AccessRestrictions>
# might also be helpful.
#
# Note that "restrict" applies to both servers and clients, so a configuration
# that might be intended to block requests from certain clients could also end
# up blocking replies from your own upstream servers. # By default, exchange time with everybody, but don't allow configuration.
restrict - default kod notrap nomodify nopeer noquery
restrict - default kod notrap nomodify nopeer noquery
restrict 192.168.20.0 mask 255.255.255.0 nomodify # 允许的NTP Client网段
# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::

第三步:重启NTP服务,并在客户端验证

root@ntpserver:~/ceph-cluster# service ntp restart
* Stopping NTP server ntpd [ OK ]
* Starting NTP server ntpd [ OK ]
root@ntpclient:/etc/ceph# ntpdate ntpserver
Jan :: ntpdate[]: adjust time server 192.168.20.177 offset 0.209691 sec
root@ntpclient:/etc/ceph#

未完待续......

Ubuntu 配置NTP Server的更多相关文章

  1. ubuntu 配置ftp server(zz)

    ubuntu 配置 ftp server   安装vsftpd sudo apt-get install vsftpd # vsftp(Very Secure FTP)是一种在Unix/Linux中非 ...

  2. ubuntu配置ftp server

    ubuntu配置ftp server 1. 安装vsftpd   sudo apt-get install vsftpd 安装后会自动新建一个用户ftp,密码ftp,作为匿名用户登录的默认用户 sud ...

  3. Linux 上配置 NTP SERVER

    在CENTOS 6.2上面安装配置NTP SERVER 安装NTP:yum install ntp 配置时间源vi /etc/ntp.confserver 210.72.145.44server nt ...

  4. Ubuntu配置ssh server

    SSH-Server配置指南 一.SSH简介 SSH (Secure Shell)是一个应用程序中提供安全通信的协议,通过SSH协议可以安全地访问服务器,因为SSH 具有成熟的公钥加密体系,在数据进行 ...

  5. 在 Ubuntu 配置 PPTP Server

    本文在 Ubuntu 12.4 或 14 亲测有效. 建立 PPTP 服务器 首先安装 pptp 服务器. # apt-get install pptpd 然后配置 pptpd. # sudo vi ...

  6. Ubuntu配置VNC server

    安装vncserver后,默认的配置下只有一个很"朴素"的图形界面(没有抓图,就一个黑白窗口),要支持Ubuntu的桌面,并且支持和windows之前复制粘贴文字,需要修改xsta ...

  7. Ubuntu集群 配置ntp服务

    1.概述 NTP(Network Time Protocol)是用来使计算机时间同步化的一种协议,它可以使计算机对其服务器或时钟源(如石英钟,GPS等等)做同步化,它可以提供高精准度的时间校正(LAN ...

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

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

  9. Ubuntu配置OpenStack 二:配置时间同步NTP和安装数据库Maridb以及问题总结

    继上一节Ubuntu配置OpenStack 一:配置主机环境,下面继续为安装时间同步,以及配置openstack的安装包源和安装数据库Maridb.(全文截图都是由自己徒手搭建完成并且截图) 一.安装 ...

随机推荐

  1. hdu 1956(混合图的欧拉回路)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1956 思路:先将无向边定向,比如1<->3,可以定它的方向为1->3,1的出度++, ...

  2. Apache JMeter录制HTTPS的方法及测试中常见问题解决

    Jmeter录制https请求,录制不到的常见解决方案: cmd java -version 显示为1.7 以jdk1.7为例,打开\Java\jre7\lib\security 中的,java.se ...

  3. python 基础 10.0 nosql 简介--redis 连接池及管道

    一. NOSQL 数据库简介 NoSQL 泛指非关系型的数据库.非关系型数据库与关系型数据库的差别 非关系型数据库的优势: 1.性能NOSQL 是基于键值对的,可以想象成表中的主键和值的对应关系,而且 ...

  4. 编写自己的ls命令

    ····要编写ls命令,首先要了解它能做什么,完成了什么工作,是如何完成这些工作的····  一.ls命令能做什么? 我们在命令行输入ls,ls默认找出当前目录中所有文件的文件名,并且按照字典序排序后 ...

  5. 1674 区间的价值 V2(分治)

    1674 区间的价值 V2 基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 lyk拥有一个区间. 它规定一个区间的价值为这个区间中所有数and起来的值与这个区间所有 ...

  6. Shiro 页面权限标签

    http://www.cnblogs.com/jifeng/p/4500410.html  不整理了,直接看人家写好的

  7. 普通java工程的resources目录寻址

    问题: 普通java工程的src/main/resources目录下的配置文件如何寻址 在src/main/java目录下的代码中如何访问src/main/resources目录下的配置文件? Mav ...

  8. Stolz–Cesàro theorem

    w http://planetmath.org/sites/default/files/texpdf/33795.pdf Stolz–Cesàro theorem - Wikipedia  https ...

  9. Delphi里的Windows消息(可查MSDN指定位置)

    各种控件的通知消码和控制消息可由MSDN-> Platform SDK-> User Interface Services->Windows User Interface->C ...

  10. Django的models方法返回值异常,待解决

    class BookInfo(models.Model): #创建书本信息类,继承models.Model booktitle=models.CharField(max_length=20) book ...