ubuntu下ntp时间同步
1. 首先安装ntp服务(ubuntu 16.02)
在linux的root用户下执行以下命
sudo apt-get install ntp
(如果不是ubuntu系统则执行 yum install ntp –y)
2. 修改ntp配置文件(server)
我们需要在linux集群中找到一台作为ntp服务器的server,其他机器则为ntp的client,因此,在server服务器上修改一下配置文件
执行
退出保存,重启ntp服务
执行 service ntp restart
vim /etc/ntp.conf:
#linux自带的时间同步,需要注释掉
#pool 0.ubuntu.pool.ntp.org iburst
#pool 1.ubuntu.pool.ntp.org iburst
#pool 2.ubuntu.pool.ntp.org iburst
#pool 3.ubuntu.pool.ntp.org iburst
# Use Ubuntu's ntp server as a fallback.
#pool ntp.ubuntu.com
# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1
#因为是内网,所以用本地时间做为服务器时间,注意这里不是127.0.0.1
server 127.127.1.0
fudge 127.127.1.0 stratum 8 #开放192.168.8.0 整个网段,即在这个网段的所有机器都可以使用 214 作为时间同步服务端
restrict 192.168.0.0 mask 255.255.255.0 nomodify notrap
3. 修改ntp配置文件(client)
同样的server端已经配置好了,client的配置相对简单
执行 sudo vim /etc/ntp.conf:
#linux自带的时间同步,需要注释掉
#pool 0.ubuntu.pool.ntp.org iburst
#pool 1.ubuntu.pool.ntp.org iburst
#pool 2.ubuntu.pool.ntp.org iburst
#pool 3.ubuntu.pool.ntp.org iburst
# Use Ubuntu's ntp server as a fallback.
#pool ntp.ubuntu.com
# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1 #增加214作为时间服务器即可
server 192.168.0.214
# Needed for adding pool entries restrict source notrap nomodify noquery
退出保存,重启ntp服务
执行 sudo service ntp restart
4. 查看ntp服务是否配置完成
在ntp sever上执行 ntpq -p
在ntp client上执行 ntpq –p
即完成ntp服务的配置
5. ntp服务的相关命令
service ntpstart 启动
service ntp stop停止
service ntprestart 重新启动
ubuntu更改时区(东八区)
tzselect



ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
ubuntu下ntp时间同步的更多相关文章
- ubuntu下配置时间同步NTP
1参考文献: 1.鸟哥的Linux私房菜:第十五章.时间服务器: NTP 服务器(强烈建议看完) 2.http://www.crsay.com/wiki/wiki.php/server/centos/ ...
- 关于linux下ntp时间同步服务的安装与配置
1.安装ntp服务,要使用时间同步.那么服务端与客户端都需要使用如下命令安装NTP软件包 [root@ ~]# yum install ntp -y 2.如果只是作为客户端的话,配置则可以非常简单,编 ...
- Linux下ntp时间同步
在root用户下执行 先安装同步时间软件,每台机器执行 yum install -y ntp 然后执行以下命令: crontab -e */10 * * * * /usr/sbin/ntpdate - ...
- Linux下 ntp 时间同步服务ntpd 出现 the NTP socket is in use, exiting 解决
[root@EPDDB log]# [root@EPDDB log]# ntpdate 10.154.8.200 6 Sep 09:35:09 ntpdate[30210]: the NTP sock ...
- ntp时间同步服务器
[root@localhost ~]# ntpdate time.nist.gov 虚拟机时间不对 自动同步 sudo ntpdate asia.pool.ntp.org 要是同步后时间还是不 ...
- Linux集群环境下NTP服务器时间同步
NTP介绍 NTP(Network Time Protocol,网络时间协议)是用来使网络中的各个计算机时间同步的一种协议.它的用途是把计算机的时钟同步到世界协调时UTC(Universal Time ...
- linux ntp时间同步
linux ntp时间同步 一.搭建时间同步服务器1.编译安装ntp serverrpm -qa | grep ntp若没有找到,则说明没有安装ntp包,从光盘上找到ntp包,使用rpm -Uvh n ...
- Linux下ntpdate时间同步
Linux下ntpdate时间同步 Ntp服务器配置(暂略,以后整理) 时间同步方法 同步命令 # ntpdate ntp服务器域名或IP 例:# nt ...
- cloudstack安装篇3-SELinux配置、NTP时间同步、配置ClouStack软件库
一.SELinux配置 为了让CloudStack正常工作,我们必须将SELinux设置为permissive.需要在当前系统运行状态下和启动后都能够生效,进行以下配置. 在系统运行状态下的将SELi ...
- Windows2012R2 NTP时间同步
Windows2012R2 NTP时间同步 Windows2012R2里没有了internet时间,需要使用另外的方式去做时间同步 下面分两个情况 两个情况,两个情况都需要用修改组策略的方式来做 情况 ...
随机推荐
- Vue14 条件渲染
转:https://blog.csdn.net/weixin_57519185/article/details/121168426 1 简介 通过指令v-show和v-if可以实现条件渲染. 它们都能 ...
- Ribbon服务调用+负载均衡(入门)
1.Ribbon Ribbon中文:(用于捆绑或装饰的)带子; 丝带; 带状物; 主要功能是提供客户端的软件负载均衡算法和服务调用 Ribbon已经进入了维护模式了,但是Ribbon仍然被广泛使用中 ...
- 【TS】any和void
any类型 any类型,在ts中是一个万能类型,它可以替代所有类型,也就是说定义了any类型,就不用担心ts的类型束缚,但如果所有的类型都使用any那么ts就失去了它的作用,我们使用ts就是为了规范类 ...
- LOJ 数列分块入门 8
\(\text{Solution}\) 一看有区间赋值直接上 \(ODT\) \(\text{Code}\) #include <cstdio> #include <iostream ...
- Luogu P3919 【模板】可持久化线段树 1(可持久化数组)
板子,正好温习一下主席树的写法 记得数组开 \(32\) 倍!! \(Code\) #include<cstdio> using namespace std; const int N = ...
- 触觉仿真系统:Force Dimension+CHAI 3D
推荐:将 NSDT场景编辑器 加入你的3D开发工具链 Force Dimension 成立于2001年,总部在瑞士,比sensable 晚了8年,开发的理念也不一样,他们开发是连杆式力反馈触觉系统,仿 ...
- let 和 var 的区别
var 关键字 在块级作用域中使用var声明变量,外面同级的块级作用域也可以访问.if.switch.for 等语句的作用域都没有块级作用域,所以说,在这些语句中声明的变量都能被外界访问,这是非常不安 ...
- 初学 Canvas
画布的概念 Canvas(画布)可以用于动画.游戏画面.数据可视化.图片编辑以及实时视频处理等方面.画布在 HTML5 中是通过canvas标签来表现,通过 JavaScript 提供的画布 API, ...
- LeetCode-1034 边界着色
题目来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/coloring-a-border/ 题目描述 给你一个大小为 m x n 的整数矩阵 gri ...
- python ddt file_data
# -*- coding: utf-8 -*-"""------------------------------------------------- File Name ...