1、三个节点时间同步,cdh1,cdh2,cdh3

2、做法:cdh1从网络时间同步,然后cdh2和cdh3从cdh1节点同步

3、安装与自启动设置

yum install ntp

按上面的安装方式在内网每台节点上都安装好NTP软件包

完成后,都需要配置NTP服务为自启动

chkconfig ntpd on

chkconfig --list ntpd

ntpd           0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭

如果2,3,4,5都为启动,则正常。

在配置前,先使用ntpdate手动同步下时间,免得本机与外部时间服务器时间差距太大,让ntpd不能正常同步。

ntpdate -u cn.ntp.org.cn

4、配置cdh1的/etc/ntp.conf

# For more information about this file, see the man pages
# ntp.conf(), ntp_acc(), ntp_auth(), ntp_clock(), ntp_misc(), ntp_mon(). driftfile /var/lib/ntp/drift # Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery
restrict - default kod nomodify notrap nopeer noquery # Permit all access over the loopback interface. This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1
restrict - :: # Hosts on local network are less restricted.
# 允许内网其他机器同步时间
restrict 192.168.189.0 mask 255.255.255.0 nomodify notrap # Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server cn.ntp.org.cn perfer #broadcast 192.168.1.255 autokey # broadcast server
#broadcastclient # broadcast client
#broadcast 224.0.1.1 autokey # multicast server
#multicastclient 224.0.1.1 # multicast client
#manycastserver 239.255.254.254 # manycast server
#manycastclient 239.255.254.254 autokey # manycast client
# 允许上层时间服务器主动修改本机时间
restrict cn.ntp.org.cn nomodify notrap noquery # 外部时间服务器不可用时,以本地时间作为时间服务
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum # Enable public key cryptography.
#crypto includefile /etc/ntp/crypto/pw # Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography.
keys /etc/ntp/keys # Specify the key identifiers which are trusted.
#trustedkey # Specify the key identifier to use with the ntpdc utility.
#requestkey # Specify the key identifier to use with the ntpq utility.
#controlkey # Enable writing of statistics records.
#statistics clockstats cryptostats loopstats peerstats

5、启动ntp服务

service ntpd start

启动后,一般需要5-10分钟左右的时候才能与外部时间服务器开始同步时间。

6、通过watch ntpq -p  查看网络ntp服务器

7、然后去cdh2和cdh3去修改/ect/ntp.conf,向cdh1同步时间

修改一行:server cdh1

8、分别在cdh2和cdh3启动ntp

service ntpd start

9、其他命令

service ntpd restart 重启ntp

service ntpd stop 停止ntp

ntpstat 命令查看时间同步状态,这个一般需要5-10分钟后才能成功连接和同步

[root@cdh2 opt]# ntpstat
synchronised to NTP server (192.168.189.128) at stratum 4
   time correct to within 48 ms
   polling server every 64 s

NTP服务器时间集群借节点之间同步的更多相关文章

  1. 大数据项目之_15_帮助文档_NTP 配置时间服务器+Linux 集群服务群起脚本+CentOS6.8 升级到 python 到 2.7

    一.NTP 配置时间服务器1.1.检查当前系统时区1.2.同步时间1.3.检查软件包1.4.修改 ntp 配置文件1.5.重启 ntp 服务1.6.设置定时同步任务二.Linux 集群服务群起脚本2. ...

  2. CDH5.16.1集群新增节点

    如果是全新安装集群的话,可以参考<Ubuntu 16.04上搭建CDH5.16.1集群> 下面是集群新增节点步骤: 1.已经存在一个集群,有两个节点 192.168.100.19 hado ...

  3. Tomcat集群---Cluster节点配置(转)

    <!-- Cluster(集群,族) 节点,如果你要配置tomcat集群,则需要使用此节点. className 表示tomcat集群时,之间相互传递信息使用那个类来实现信息之间的传递. cha ...

  4. 使用fabric解决百度BMR的spark集群各节点的部署问题

    前言 和小伙伴的一起参加的人工智能比赛进入了决赛之后的一段时间里面,一直在构思将数据预处理过程和深度学习这个阶段合并起来.然而在合并这两部分代码的时候,遇到了一些问题,为此还特意写了脚本文件进行处理. ...

  5. Web服务器Tomcat集群与负载均衡技术

    我们曾经介绍过三种Tomcat集群方式的优缺点分析.本文将介绍Tomcat集群与负载均衡技术具体实施过程. 在进入集群系统架构探讨之前,先定义一些专门术语: 1. 集群(Cluster):是一组独立的 ...

  6. Tomcat集群---Cluster节点配置

    <!-- Cluster(集群,族) 节点,如果你要配置tomcat集群,则需要使用此节点. className 表示tomcat集群时,之间相互传递信息使用那个类来实现信息之间的传递. cha ...

  7. 使用Kubeadm创建k8s集群之节点部署(三十一)

    前言 本篇部署教程将讲述k8s集群的节点(master和工作节点)部署,请先按照上一篇教程完成节点的准备.本篇教程中的操作全部使用脚本完成,并且对于某些情况(比如镜像拉取问题)还提供了多种解决方案.不 ...

  8. Elasticsearch核心技术(2)--- 基本概念(Index、Type、Document、集群、节点、分片及副本、倒排索引)

    Elasticsearch核心技术(2)--- 基本概念 这篇博客讲到基本概念包括: Index.Type.Document.集群,节点,分片及副本,倒排索引. 一.Index.Type.Docume ...

  9. emqtt 分布集群及节点桥接搭建

    目录 分布集群 emq@s1.emqtt.io 节点设置 emq@s2.emqtt.io 节点设置 节点加入集群 节点退出集群 节点发现与自动集群 manual 手动创建集群 基于 static 节点 ...

随机推荐

  1. kindle书摘-活着-余华-活着不易,珍惜

     https://github.com/starrtc/android-demo 中文版自序 标注(黄色) - 位置 29 作家的使命不是发泄,不是控诉或者揭露,他应该向人们展示高尚.这里所说的高尚不 ...

  2. USB2.0学习笔记连载(十四):USB驱动安装及固件程序的编写

    在之前的博客中已经讲过,驱动程序最核心的两个文件,一个是xxx.sys文件,一个是xxx.inf文件,主机是寻找xxx.inf文件. 在下面的文件中有相关关于USB驱动的说明.对于用户来说,xxx.s ...

  3. (笔记)Mysql命令use:使用数据库

    use命令可以让我们来使用数据库. use命令格式: use <数据库名>; 例如,如果xhkdb数据库存在,尝试存取它:   mysql> use xhkdb;屏幕提示:Datab ...

  4. nodejs基础 -- 常用工具util

    util是nodejs的核心模块,提供常用函数的集合,用户弥补核心javascript的功能过于精简的不足 util.inherits 是一个实现对象间原型继承的函数 javascript的面向对象特 ...

  5. WAS集群:记一次Node Agent不活动问题解决过程

    之前很少接触集群,准确地说是很少接触项目现场的实施工作,或者说接触到的都是比较简单的实施工作,安装Linux.WAS.Oracle相对来说都比较简单.一直埋头干着研发的活,干着不要紧,一干就是好几年. ...

  6. PHI 数据库简介

    PHI是一个致病菌的数据库,截止到2017年8月1号为止,最新的版本是4.3,数据库中收录了实验验证过的致病菌的信息,其中有176个来自动物的致病菌,227个来自植物的致病菌,3个来自真菌的致病菌; ...

  7. 10个样式各异的CSS3 Loading加载动画

    前几天我在园子里分享过2款很酷的CSS3 Loading加载动画,今天又有10个最新的Loading动画分享给大家,这些动画的样式都不一样,实现起来也并不难,你很容易把它们应用在项目中,先来看看效果图 ...

  8. 两个大数组foreach,找出相同的key数量,所用的时间对比

    <?php function microtime_float() { list($usec, $sec) = explode(" ", microtime()); retur ...

  9. 在Android中,px,dp,dip,sp的不同之处

           最近在学习Android开发,一直没有弄清楚px,dp,dip,sp的区别.今天正好有时间,就花时间研究了一下.     众所周知,Android厂商非常多,各种尺寸的Android手机 ...

  10. [转]油猴Tampermonkey-让百度云下载飞起来

    1. 简介 Tampermonkey,油猴脚本是一款免费的浏览器扩展程序. 我们这里用于Chrome浏览器,目的是为了让百度云里面的文件以满速下载,VIP还得出钱呢. 2. 安装 安装Lantern蓝 ...