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. redhat6.5安装postgresql8.4数据库

    Redhat6.5安装postgresql8.4数据库 step1 先移除原有的postgresql数据库(如果有),否则直接跳过 rpm -qa | grep postgresql* rpm -ev ...

  2. 这篇文章主要为大家详细介绍了jQuery密码强度验证控件使用详解的相关资料,具有一定的参考价值,感兴趣的小伙伴们可以参考一下

    本文实例为大家分享了jQuery密码强度验证控件,供大家参考,具体内容如下 <html>   <head>     <meta http-equiv="Cont ...

  3. TelephonyManager&GsmCellLocation类的方法详解

    转载:http://blog.163.com/zhangzheming_282/blog/static/117920962011101944356511/ TelephonyManager类 主要提供 ...

  4. iOS-获取的NSDate date时间与实际相差8个小时解决方案

    本文转载至 http://blog.sina.com.cn/s/blog_51a995b70101iptl.html NSDate *date = [NSDate date]; NSTimeZone  ...

  5. CodeIgniter 入门教程第一篇:信息发布

    一.MVC CodeIgniter 采用MVC架构即:控制层.模型层和视图层. 对应Application下面的文件夹   (图1): 所有新建文件以.php结尾 视图层 view 文件夹放入HTML ...

  6. java8 关于日期的处理

    Java8 为我们提供了一种新的日期格式:LocalDate和LocalDateTime 获取当前的时间及前一天时间的方法: import java.time.LocalDateTime; impor ...

  7. linux下安装nmon监控工具

    1.首先下载压缩包 wget http://sourceforge.net/projects/nmon/files/download/nmon_x86_12a.zip/download 2.解压并修改 ...

  8. python基础里的那些为什么?

    一.执行python脚本的两种方式? 直接在解释器里编写并在解释器里执行 文件编写,并在终端通过 python 路径  这种方式执行 好,我们就以输出hello world这个例子来比较两种方式的不同 ...

  9. Wireshark网络分析工具(二)

    一.TCP三次握手过称 1. 第一次握手的数据包 客户端发送一个TCP,标志位为SYN,序列号为0, 代表客户端请求建立连接. 如下图: 2. 第二次握手的数据包 服务器发回确认包, 标志位为 SYN ...

  10. Vue父组件调用子组件的方法

    vue中如果父组件想调用子组件的方法,可以在子组件中加上ref,然后通过this.$refs.ref.method调用,例如: 父组件: <template> <div @click ...