避免regionServer宕機,避免regionserver宕

來源:互聯網
上載者:User

避免regionServer宕機,避免regionserver宕

因為regionserver 的管理資訊主要記錄在zookeeper,regionserver的宕機判斷依據是session expired。ok

那麼regionserver 和Zookeeper的session expired原因有哪些尼?

1. 網路不好。 2. Java full GC, 這會block所有的線程。如果時間比較長,也會導致session expired.解決辦法: 1. 將Zookeeper的timeout時間加長。 2. 配置“hbase.regionserver.restart.on.zk.expire” 為true。 這樣子,遇到ZooKeeper session expired , regionserver將選擇 restart 而不是 abort具體的配置是,在hbase-site.xml中加入<property><name>zookeeper.session.timeout</name><value>90000</value><description>ZooKeeper session timeout.HBase passes this to the zk quorum as suggested maximum time for asession.  See http://hadoop.apache.org/zookeeper/docs/current/zookeeperProgrammers.html#ch_zkSessions“The client sends a requested timeout, the server responds with thetimeout that it can give the client. The current implementationrequires that the timeout be a minimum of 2 times the tickTime(as set in the server configuration) and a maximum of 20 timesthe tickTime.” Set the zk ticktime with hbase.zookeeper.property.tickTime.In milliseconds.</description></property><property><name>hbase.regionserver.restart.on.zk.expire</name><value>true</value><description>Zookeeper session expired will force regionserver exit.Enable this will make the regionserver restart.</description></property> 3、為了避免java full GC suspend thread 對Zookeeper heartbeat的影響,我們還需要對hbase-env.sh進行配置。   設定jvm的記憶體回收演算法:
     -XX:+CMSParallelRemarkEnabled。
如下所示:

export HBASE_OPTS="-Xms16g -Xmx16g -Xmn2g -Xss200k -XX:MaxNewSize=2g -XX:SurvivorRatio=2 -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseConcMarkSweepGC -XX:+DisableExplicitGC  -XX:+CMSParallelRemarkEnabled   -XX:+UseFastAccessorMethods  -XX:+UseParNewGC -XX:MaxPermSize=300m -XX:MaxTenuringThreshold=5  -XX:GCTimeRatio=19 -XX:ParallelGCThreads=10 -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=0 -XX:-UseGCOverheadLimit "

最後啟動  regionserver:命令:hbase-daemon.sh start regionserver
開啟balance命令:balance_switch true

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.