美文网首页
NTP集群服务器搭建

NTP集群服务器搭建

作者: 大大大大大大大熊 | 来源:发表于2018-12-18 15:17 被阅读0次

NTP服务器

10.11.52

服务器需要能联网,从互联网的时间中心中同步时间。

1.查看是否安装的ntp时间服务器
rpm -qa | grep ntp
2.安装ntp服务
yum install -y ntp ntpdate
3.修改ntp配置文件
vi /etc/ntp.conf

-----------------------------------------------------
ntp服务器需要修改的是
-----------------------------------------------------
# 阿里云服务器
server ntp1.aliyun.com

# allow update time by the upper server
# 允许上层时间服务器主动修改本机时间
restrict ntp1.aliyun.com nomodify notrap noquery

# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available.
# 外部时间服务器不可用时,以本地时间作为时间服务
#server  127.127.1.0     # local clock
fudge   127.127.1.0 stratum 10

4.启动ntp服务
service ntpd start  启动ntp服务
service ntpd status 

5.设置开机启动
chkconfig ntpd on

查看是否已经打开服务
systemctl list-unit-files | grep ntp

6.查看服务连接和监听
netstat -tlunp | grep ntp

7.查看网络中的NTP服务器,同时显示客户端和每个服务器的关系
ntpq -p

8.查看时间同步状态,这个一般需要5-10分钟后才能成功连接和同步。所以,服务器启动后需要稍等下
ntpstat

9. 把系统时间同步到硬件BIOS。
可用该参数保持硬件时间与操作系统时间的自动同步,配制方法如下:
vi /etc/sysconfig/ntpd
# Command line options for ntpd
OPTIONS="-g"
SYNC_HWCLOCK=yes

NTP客户端

10.11.6.53, 10.11.6.54
同步服务器

1. 配置/etc/ntp.conf文件,sudo vi /etc/ntp.conf
在此文件中添加如下配置: 
server 10.11.6.52 prefer 
2. 执行sudo chkconfig ntpd on,设置开机启动。
3. 执行sudo service ntpd start启动ntpd服务。
4. 同步NTP-Server时间 
sudo ntpdate -u 10.11.6.52
5. 把系统时间同步到硬件BIOS。
可用该参数保持硬件时间与操作系统时间的自动同步,配制方法如下:
sudo vi /etc/sysconfig/ntpd
# Command line options for ntpd
OPTIONS="-g"
SYNC_HWCLOCK=yes

查看时间信息:timedatectl
查看时间更新:watch -n 1 -d "date"

因为windows挂的VPN连接的linux集群,然后如果windows作为NTP服务器的话,linux连接不上,因为IP复杂。但是Windows可以连接linux集群。所以把windows也作为NTP客户端,在linux集群中选择一个服务端,大家都连接这个服务端。

相关文章

  • 使用dokcer镜像快速搭建ntp服务器实现时间同步

    使用镜像搭建ntp服务器,并在客户端调用进行定时时间同步。 一、 ntp服务器搭建 查询到有现成的ntp服务器do...

  • NTP集群服务器搭建

    NTP服务器 10.11.52 服务器需要能联网,从互联网的时间中心中同步时间。 NTP客户端 10.11.6.5...

  • 第十三周

    1、搭建时间服务器,日志服务器并简述sudo安全切换 1)安装ntp服务器 yum install ntp 配置文...

  • XDH_LESSON6

    服务器集群搭建、管理与快速部署四台ubuntu虚拟机搭建集群服务器。什么叫服务器集群?服务器集群就是指将很多服务器...

  • 03-MongoDB集群运维-NTP时间同步

    背景 使用 NTP时间同步操作,避免出现因时间不一致导致集群间数据同步问题 NTP时间同步 测试NTP常用服务器是...

  • 第十三周作业

    1、搭建时间服务器,日志服务器并简述sudo安全切换。 1)搭建时间服务器: 早期是用ntp服务: #yum in...

  • Slurm22.11.2 入门教程01-Centos7.6 安装

    说明: 一. 集群环境搭建分为:【NTP】、【MUNGE】、【Slurm】 网络拓扑 计算机名称 I...

  • 笔记 时间同步服务器搭建

    ntp配置 需要搭建本地的时间同步服务器(非授时)参考:1.CentOS 6 安装 NTP Server 时间服务...

  • 搭建时间服务器并配置集群自动时钟同步

    搭建时间服务器并配置集群自动时钟同步 一、搭建时间服务器 (一)为什么要搭建时间服务器 因为Hadoop 对集群...

  • 配置集群时间同步

    配置集群时间同步: 1.时间服务器配置(必须root用户) 检查ntp是否安装 2.修改ntp配置文件 [root...

网友评论

      本文标题:NTP集群服务器搭建

      本文链接:https://www.haomeiwen.com/subject/noclkqtx.html