zoukankan      html  css  js  c++  java
  • HBase启动后RegionServer自动挂原因及解决办法

     zookeeper在同步和管理集群时依赖节点系统时间,每隔一定周期zookeeper master会监测所有节点的连接状态。所以解决办法就是利用ntp对集群局域网进行时间同步。

    CentOS设置系统时间与网络时间同步

    Linux的时间分为System Clock(系统时间)和Real Time Clock (硬件时间,简称RTC)。

    系统时间:指当前Linux Kernel中的时间。

    硬件时间:主板上有电池供电的时间。

    查看系统时间的命令: #date

    设置系统时间的命令: #date –set(月/日/年 时:分:秒)

    例:#date –set “10/11/10 10:15”

    也可以:

    开始的时候,或者网上都有的说法,比如说把时间设为2009-11-12 18:30:50。
          我们会先设日期
          date -s 20091112
          再设时间
          date -s 18:30:50

    查看硬件时间的命令: # hwclock

    常用参数

      -r, --show         读取并打印硬件时钟(read hardware clock and print result )
      -s, --hctosys      将硬件时钟同步到系统时钟(set the system time from the hardware clock )
      -w, --systohc     将系统时钟同步到硬件时钟(set the hardware clock to the current system time )

    设置硬件时间的命令: # hwclock –set –date = (月/日/年 时:分:秒)

    上述提到的是手动设置时间到一个时间点,可能与当前网络的时间有误差。下面介绍一下与时间服务器上的时间同步的方法:

    1.  安装ntpdate工具

    # yum -y install ntp ntpdate

    2.  设置系统时间与网络时间同步

    # ntpdate cn.pool.ntp.org

    3.  将系统时间写入硬件时间

    # hwclock --systohc

  • 相关阅读:
    ExpandoObject与DynamicObject的使用
    ManualResetEvent 线程通信
    CancellationTokenSource 取消任务
    SQL Server 每日一题--老二解析
    说说 C# 8 using 新特性
    SQL Server 每日一题--老二
    C#中的坑--浮点类型
    开胃菜解析
    开胃菜
    快速入门 Arrow 日期处理库
  • 原文地址:https://www.cnblogs.com/luozeng/p/8433154.html
Copyright © 2011-2022 走看看