Linux 配置阿里 OPSX NTP服务

编辑文件 "/etc/ntp.conf",根据情况修改文件内容为:

  • 互联网上的服务器:
driftfile  /var/lib/ntp/drift
pidfile   /var/run/ntpd.pid
logfile /var/log/ntp.log
restrict    default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
server 127.127.1.0
fudge  127.127.1.0 stratum 10
server ntp.aliyun.com iburst minpoll 4 maxpoll 10
restrict ntp.aliyun.com nomodify notrap nopeer noquery
  • 阿里云 ECS 服务器:
driftfile  /var/lib/ntp/drift
pidfile   /var/run/ntpd.pid
logfile /var/log/ntp.log
restrict    default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
server 127.127.1.0
fudge  127.127.1.0 stratum 10
server ntp.aliyun.com iburst minpoll 4 maxpoll 10
restrict ntp.aliyun.com nomodify notrap nopeer noquery

server ntp1.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
restrict ntp1.cloud.aliyuncs.com nomodify notrap nopeer noquery
server ntp2.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
restrict ntp2.cloud.aliyuncs.com nomodify notrap nopeer noquery
server ntp3.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
restrict ntp3.cloud.aliyuncs.com nomodify notrap nopeer noquery
server ntp4.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
restrict ntp4.cloud.aliyuncs.com nomodify notrap nopeer noquery
server ntp5.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
restrict ntp5.cloud.aliyuncs.com nomodify notrap nopeer noquery
server ntp6.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
restrict ntp6.cloud.aliyuncs.com nomodify notrap nopeer noquery

对于使用 chrony 客户端的 linux 主机

  • 配置 ‘/etc/chrony.conf‘ 文件的内容为:
server ntp.aliyun.com iburst
stratumweight 0
driftfile /var/lib/chrony/drift
rtcsync
makestep 10 3
bindcmdaddress 127.0.0.1
bindcmdaddress ::1
keyfile /etc/chrony.keys
commandkey 1
generatecommandkey
logchange 0.5
logdir /var/log/chrony

参考

https://opsx.alibaba.com/service?lang=zh-CN

原文地址:http://blog.51cto.com/moerjinrong/2325975

时间: 2024-08-30 08:09:33

Linux 配置阿里 OPSX NTP服务的相关文章

CentOS 配置阿里云 NTP 服务

NTP 是网络时间协议(Network Time Protocol),NTP 服务能保证服务器的本地时间与标准时间同步. ? 配置时区信息 1.删除系统里的当地时间链接 sudo rm /etc/localtime 2.编辑文件 /etc/sysconfig/clock cat << EOM > /etc/sysconfig/clock Zone=Asia/Shanghai EOM 3.更新时区信息 sudo ln -sf /usr/share/zoneinfo/Asia/Shangha

配置Linux 11G R2 RAC NTP服务

安装Oracle 11g RAC时,我们需要配置ntp服务.在使用虚拟机的情况下对于时钟同步方式的配置有很多种方式,可以使用vmware自带的时钟同步功能,也可以直接将本地的一个节点用作时间服务器.本文介绍直接配置ntp方式的时钟服务器. [python] view plain copy print? 1.查看两节点的hosts配置 [[email protected] ~]# cat /etc/hosts # Do not remove the following line, or vario

配置Windows实例NTP服务

本文介绍如何开启和配置Windows NTP服务,保证实例本地时间精确同步. Windows实例NTP服务介绍 目前,所有地域下ECS实例默认采用CST(China Standard Time)时区,您也可以根据自己的业务需求为ECS实例设置或者修改时区. 本文以Windows Server 2008 R2企业版64位为例,介绍如何使用NTP服务同步Windows实例的本地时间.您也可以使用cmd命令完成同步任务,具体操作,请参考 开启Windows实例NTP服务. 开启NTP服务 Window

Nginx配置阿里云https服务

博客原地址 #https访问 server {     listen 443;     server_name www.baidu.com;     root   /var/www/html; index  index.php index.html index.htm; ssl on;         location / {                 try_files $uri $uri/ /index.php?$query_string;          #client_max_b

Linux基于heartbeat配置httpd高可用服务

Heartbeat是一个基于Linux开源的,被广泛使用的高可用集群系统.我们可以基于Heartbeat构建web高可用服务环境.本文在CentOS 6.5下做了一个简单示例,并对其日志进行了初步分析,供大家参考. 有关Heartbeat的相关知识,可以参考: Heartbeat 集群组件概述 Heartbeat 安装及配置 一.配置host解析及网络 ###主机名配置,与/etc/hosts中的解析两者配置保持一致 [[email protected] ~]# more /etc/syscon

ntp服务的细节

在linux里设置NTP服务并不难,但是NTP本身确是一个很复杂的协议. 你都了解细节么? 1. 时间和时区 date命令可显示时间与市区 [[email protected]_PV1_DB ~]# date Tue Feb  7 16:32:16 CST 2017 [[email protected]_PV1_DB ~]# cat /etc/sysconfig/clock ZONE="Asia/Shanghai" CST=true 在地球环绕太阳旋转的24个小时中,世界各地日出日落的

CentOS7 下部署NTP服务供内网客户机使用

1.安装NTP服务# yum -y install ntp 2.修改 ntp配置# vi /etc/ntp.conf # 记录和上级时间服务器的时间差异,默认配置,保留driftfile /var/lib/ntp/drift #表示nomodify客户端可以同步时间restrict default nomodify # 允许本机的一切操作,默认策略,保留restrict 127.0.0.1restrict ::1 # 阿里云NTP服务可修改本NTP服务时间restrict ntp.aliyun.

利用NTP搭建自己的ntp服务

利用NTP搭建自己的ntp服务 发表于 2013 年 9 月 22 日 作者 admin 对于校园网/企业用户,如果您网内所有计算机都通过互联网同步时间,在速度和精度上都有一定的折扣,并且对互联网出口带宽也有一定的影响,对于这类用户,我们建议通过自己搭建ntp服务为内部用户提供时间同步服务. 在Linux系统下搭建ntp服务是非常简单的,即便你对Linux不熟悉,只需要简单的几个操作就够用了,下面是几个必要的步骤: 1.安装你熟悉的操作系统(这里假设你安装的是CentOS 6). 2.查看是否已

Linux NTP服务配置

一.NTP对时原理 NTP同步的方向是从stratum值较小的节点向较大的节点传播,如果某个NTP客户端接收到stratum比自己还要大,那么NTP客户端认为自己的时间比接受到的时间更为精确,不会进行时间的更新. 对于大部分NTP软件系统来说,服务启动后,stratum值初始是0,一旦NTP服务获取到了时间,NTP层次就设置为上级服务器stratum+1.对于具备卫星时钟.原子钟的专业NTP设备,一般stratum值初始是1. NTPD启动后,stratum值初始是0,此时NTPD接收到NTP请