码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • Hadoop集群搭建--时间同步


    关注微信公共号:小程在线

     

    关注CSDN博客:程志伟的博客

    如果服务器在公网环境(能连接外网),可以不采用集群时间同步

    需要使用root用户

    1.查看所有节点ntpd服务状态和开机自启动状态

    [root@hadoop102 atguigu]# systemctl status ntpd

    [root@hadoop102 atguigu]# systemctl start ntpd
    [root@hadoop102 atguigu]# systemctl status ntpd

    开机启动ntpd

    [root@hadoop102 atguigu]# systemctl is-enabled ntpd
    disabled

    2. 修改hadoop102的ntp.conf配置文件

    修改1:

    #restrict 192.168.10.0 mask 255.255.255.0 nomodify notrap修改为:

    restrict 192.168.10.0 mask 255.255.255.0 nomodify notrap

    修改2:

    下面这几个都是在前面加上#

    #server 0.centos.pool.ntp.org iburst
    #server 1.centos.pool.ntp.org iburst
    #server 2.centos.pool.ntp.org iburst
    #server 3.centos.pool.ntp.org iburst

    修改3:

    在文件的最后增加:

    server 127.127.1.0

    fudge 127.127.1.0 stratum 10

    3.修改/etc/sysconfig/ntpd 文件

    [root@hadoop102 atguigu]# vim /etc/sysconfig/ntpd

    4.重启

    [root@hadoop102 atguigu]# systemctl restart ntpd

    5.设置开机启动

    [root@hadoop102 atguigu]# systemctl enable ntpd
    Created symlink from /etc/systemd/system/multi-user.target.wants/ntpd.service to /usr/lib/systemd/system/ntpd.service.

    6.修改103的时间

    关闭所有节点上ntp服务和自启动

    [atguigu@hadoop103 module]$ sudo systemctl stop ntpd
    [atguigu@hadoop103 module]$ sudo systemctl disable ntpd

    在其他机器配置1分钟与时间服务器同步一次
    [atguigu@hadoop103 module]$ sudo crontab -e
    crontab: installing new crontab


    [atguigu@hadoop103 module]$ date
    2022年 05月 10日 星期二 16:39:57 CST

    修改任意机器时间
    [atguigu@hadoop103 module]$ sudo date -s "2021-9-11 11:11:11"
    2021年 09月 11日 星期六 11:11:11 CST
    [atguigu@hadoop103 module]$ date
    2021年 09月 11日 星期六 11:11:36 CST

    1分钟后查看机器是否与时间服务器同步
    [atguigu@hadoop103 module]$ date
    2022年 05月 10日 星期二 16:46:04 CST

  • 相关阅读:
    Java函数式接口
    VR全景图比平面图多了哪些优势,VR全景可以用在哪些领域
    【web-避开客户端控件】(2.3.1)收集使用数据:浏览器扩展技术、攻击浏览器扩展的方法
    【LeetCode周赛】LeetCode第365场周赛
    (免费分享)基于springboot,vue毕业设计管理系统
    (154)Verilog HDL:设计一个选择器之mux2to1
    java计算机毕业设计Web好好吃查询系统源码+mysql数据库+系统+lw文档+部署
    为期一周的数据分析与Excel,继续加油,多练习
    C语言学习示例代码汇总
    面试官:“同学,你做的这几个项目都不错。但怎么问QPS你就胡说呢?”
  • 原文地址:https://blog.csdn.net/c1z2w3456789/article/details/124690505
  • 最新文章
  • 沪漂五周年了:我越来越迷茫了
    Agentic Skill Routing 实战:别再把所有 Skill 塞进 AI Agent 上下文
    MySQL-Seconds_behind_master的精度误差
    [MAF预定义ChatClient中间件-03]CachingChatClient——利用缓存省钱省时间
    AI的至暗历史:从万众期待到被政府撤资,AI的两次死亡徘徊
    Agent OS :五种驯服不确定性的范式
    PortSwigger SQL注入LAB11
    数据库即时编译JIT
    [Begin]AI Learn Data Day 0
    深度学习进阶(二十七)现代 LLM 的核心架构设计其二:SwiGLU
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
小工具 小游戏
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1

京公网安备 11010502049817号