Cloudera Manager パーセルを通じてインストールされた、CDH5.0.2 を実行する 4 つのデータノード クラスターがあります。1,300 万人のユーザーの行を HBase にインポートするために、単純な Python スクリプトを作成し、hadoop ストリーミング jar を使用しました。10万行までは期待どおりに機能します。そして...そして、次々と、すべてのデータノードが同じメッセージでクラッシュします:
The health test result for REGION_SERVER_GC_DURATION has become bad:
Average time spent in garbage collection was 44.8 second(s) (74.60%)
per minute over the previous 5 minute(s).
Critical threshold: 60.00%.
Web で見られるアドバイス ( [1]、[2]、[3]など) に従って問題を解決しようとしても、解決には至りません。Java ヒープ サイズで「遊んで」も無駄です。状況を「解決」した唯一のことは、リージョン サーバーのガベージ コレクション期間の監視期間を 5 秒から 50 秒に増やしたことです。間違いなく汚い回避策。
現在、GC 使用状況のモニターを作成する人員がいません。最終的にはそうなりますが、1,300 万行を HBase にインポートすると、すべてのリージョン サーバーが確実にクラッシュする可能性があるのではないかと考えていました。きれいな解決策はありますか?
編集:
データノードの JVM オプションは次のとおりです。
-XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled
データノードは、CentOS 6.5 を実行する物理マシンで、それぞれ 32Gb RAM と 2GHz の 1Quadcore と 30Mb キャッシュを備えています。
以下は、実行する Python スクリプトの抜粋です。2 つのテーブルに入力します。1 つは一意のユーザー ID を行キーとして、1 つの列ファミリにはユーザー情報を、もう 1 つはアクセスしたいすべての情報を行キーとして格納します。
#!/usr/bin/env python2.7
import sys
import happybase
import json
connection = happybase.Connection(host=master_ip)
hbase_main_table = connection.table('users_table')
hbase_index_table = connection.table('users_index_table')
header = ['ID', 'COL1', 'COL2', 'COL3', 'COL4']
for line in sys.stdin:
l = line.replace('"','').strip("\n").split("\t")
if l[header.index("ID")] == "ID":
#you are reading the header
continue
for h in header[1:]:
try:
id = str(l[header.index("ID")])
col = 'info:' + h.lower()
val = l[header.index(h)].strip()
hbase_table.put(id_au_bytes, {
col: val
})
indexed = ['COL3', 'COL4']
for typ in indexed:
idx = l[header.index(typ)].strip()
if len(idx) == 0:
continue
row = hbase_index_table.row(idx)
old_ids = row.get('d:s')
if old_ids is not None:
ids = json.dumps(list(set(json.loads(old_ids)).union([id_au])))
else:
ids = json.dumps([id_au])
hbase_index.put(idx, {
'd:s': ids,
'd:t': typ,
'd:b': 'ame'
})
except:
msg = 'ERROR '+str(l[header.index("ID")])
logging.info(msg, exc_info=True)