Ubuntu 配置NTP Server
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的更多相关文章
- ubuntu 配置ftp server(zz)
ubuntu 配置 ftp server 安装vsftpd sudo apt-get install vsftpd # vsftp(Very Secure FTP)是一种在Unix/Linux中非 ...
- ubuntu配置ftp server
ubuntu配置ftp server 1. 安装vsftpd sudo apt-get install vsftpd 安装后会自动新建一个用户ftp,密码ftp,作为匿名用户登录的默认用户 sud ...
- Linux 上配置 NTP SERVER
在CENTOS 6.2上面安装配置NTP SERVER 安装NTP:yum install ntp 配置时间源vi /etc/ntp.confserver 210.72.145.44server nt ...
- Ubuntu配置ssh server
SSH-Server配置指南 一.SSH简介 SSH (Secure Shell)是一个应用程序中提供安全通信的协议,通过SSH协议可以安全地访问服务器,因为SSH 具有成熟的公钥加密体系,在数据进行 ...
- 在 Ubuntu 配置 PPTP Server
本文在 Ubuntu 12.4 或 14 亲测有效. 建立 PPTP 服务器 首先安装 pptp 服务器. # apt-get install pptpd 然后配置 pptpd. # sudo vi ...
- Ubuntu配置VNC server
安装vncserver后,默认的配置下只有一个很"朴素"的图形界面(没有抓图,就一个黑白窗口),要支持Ubuntu的桌面,并且支持和windows之前复制粘贴文字,需要修改xsta ...
- Ubuntu集群 配置ntp服务
1.概述 NTP(Network Time Protocol)是用来使计算机时间同步化的一种协议,它可以使计算机对其服务器或时钟源(如石英钟,GPS等等)做同步化,它可以提供高精准度的时间校正(LAN ...
- 【转】Linux配置NTP时间同步服务器
分布式程序通常需要运行在一个统一的时间环境里. 转自:http://blog.csdn.net/mengfanzhundsc/article/details/62046562 安装NTP:yum in ...
- Ubuntu配置OpenStack 二:配置时间同步NTP和安装数据库Maridb以及问题总结
继上一节Ubuntu配置OpenStack 一:配置主机环境,下面继续为安装时间同步,以及配置openstack的安装包源和安装数据库Maridb.(全文截图都是由自己徒手搭建完成并且截图) 一.安装 ...
随机推荐
- postgresql学习文档
字符串函数: http://www.php100.com/manual/PostgreSQL8/functions-string.html http://gavin-chen.iteye.com/bl ...
- SlidingMenu官方实例分析1——ExampleListActivity
1.SlidingMenuDemo下载: 由AndroidManifest.xml能看出项目是从ExampleListActivity启动的: ExampleListActivity继承了Sherlo ...
- 【剑指Offer面试题】 九度OJ1518:反转链表
与其非常快写出一段漏洞百出的代码,倒不如细致分析再写出鲁棒的代码. 提前想好測试用例(输入非空等等)进行測试改动代码. 题目链接地址: http://ac.jobdu.com/problem.php? ...
- phpstorm将多个int数字拼接成字符串
场景:将程序输出的多个int数字拼成以','分隔的字符串 数据为 8680 24399 37619 45425 49635 139334 386918 429498 461616 523384 561 ...
- svn 更新文件冲突,提示中文乱码解决
问题描述: update 操作提示错误信息,中文乱码 和 “Please execute the 'Cleanup' command.” Cleanup 操作报错: 解决办法: 1. 工具下载(sql ...
- 摄像机互联网直播之EasyCloud云平台与EasyNVS云端管控的全局对比
背景分析 近期,Easy系列推出了EasyNVS,在功能上也是可以满足将内网的视频直播转发到公网,再由公网进行视频流的分发. 听起来和EasyCloud功能上是冲突的,其实两者之间的差别还是存在的,本 ...
- FZU 1063 三维扫描(三维连通块)
Accept: 415 Submit: 1291 Time Limit: 1000 mSec Memory Limit : 32768 KB Problem Description 工业 ...
- 转载:HTML/CSS 速写神器:Emmet
转载在http://bubkoo.com/2014/01/04/emmet-a-toolkit-for-improving-html-css-workflow/ 在前端开发的过程中,一个最繁琐的工作就 ...
- Python菜鸟之路:Django 数据库操作进阶F和Q操作
Model中的F F 的操作通常的应用场景在于:公司对于每个员工,都涨500的工资.这个时候F就可以作为查询条件 from django.db.models import F models.UserI ...
- react-native 中使用redux 优化 Connect 使用装饰器简化代码报错
报错信息 error: bundling failed: Error: The 'decorators' plugin requires a 'decoratorsBeforeExport' opti ...