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. 微信 oauth 授权3

    3. 请求 2的url会得到 { "access_token": "OezXcEiiBSKSxW0eoylIeAsR0GmYd1awCffdHgb4fhS_KKf2Cot ...

  2. android中延迟执行某个任务

    android App开发在某些情况下需要有延时功能,比如说App首页显示定格3秒,然后自动跳到登录页的情况,这就好比是一个预加载,但是这个预加载可能瞬间就完成了,撑不到3秒钟,这是就要求你做延时处理 ...

  3. JS中的动态合集与静态合集

    JS的动态合集 前言 DOM是JavaScript重要组成部分,在DOM中有三个特别的集合分别是NodeList(节点的集合),NamedNodeMap(元素属性的集合)和HTMLCollection ...

  4. Olya and Energy Drinks(bfs)

    D. Olya and Energy Drinks time limit per test 2 seconds memory limit per test 256 megabytes input st ...

  5. 1714 B君的游戏(Nim博弈)

    1714 B君的游戏 基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 B君和L君要玩一个游戏.刚开始有n个正整数  ai  . 双方轮流操作.每次操作,选一个正整数 ...

  6. iOS10通知框架UserNotifications

    在iOS10上,苹果将原来散落在UIKit中各处的用户通知相关的代码进行重构,剥离,打造了一个全新的通知框架-UserNotifications.笔者最近在开发公司通知相关的需求,跟着WWDC2016 ...

  7. [mysql]清除单表大量数据方法(需保留部分数据)

    大半夜的在删除线上的日志数据,需要清理的大概有1亿八千万条...任务艰巨. 毕业前没学过数据库,所以对于如何清理大量数据还真一时不知道该怎么办才好.刚开始确实想过对表进行重命名的方式来处理,不过当时因 ...

  8. 【python】-- Django 分页 、cookie、Session、CSRF

    Django  分页 .cookie.Session.CSRF 一.分页 分页功能在每个网站都是必要的,下面主要介绍两种分页方式: 1.Django内置分页 from django.shortcuts ...

  9. js计算两个时间之间的间隔

    计算时间间隔的方法有很多,这里只是一种方式,可以方法里直接传入两个时间,也可以传入两个字符串格式的时间,在方法里解析一下就ok,这个例子里不传入参数,直接在方法里随便写一个时间来演示一下 fun() ...

  10. Js中localStorage

    优点: 1.拓展了cookie的4K限制 2.将数据直接存储到本地,相当于一个5M的前端页面数据库 不足: 1.浏览器的大小不统一 2.IE8以上的IE版本才支持 3.localStorage的值类型 ...