处理hive告警:Insufficient space for shared memory file

【问题描述】
突然收到告警短信,大概说HIVE的元数据存储遇到问题

# Ambari上的hive Alert正文摘要
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 294, in _call
    raise Fail(err_msg)
Fail: Execution of 'export HIVE_CONF_DIR='/usr/hdp/current/hive-metastore/conf/conf.server' ; hive --hiveconf hive.metastore.uris=thrift://hello_kmr-master-1:9083 --hiveconf hive.metastore.client.connect.retry.delay=1 --hiveconf hive.metastore.failure.retries=1 --hiveconf hive.metastore.connect.retries=1 --hiveconf hive.metastore.client.socket.timeout=14  --hiveconf hive.execution.engine=mr -e 'show databases;'' returned 1. Java HotSpot(TM) 64-Bit Server VM warning: Insufficient space for shared memory file:
   14906
Try using the -Djava.io.tmpdir= option to select an alternate temp location.
Java HotSpot(TM) 64-Bit Server VM warning: Insufficient space for shared memory file:
   14881
Try using the -Djava.io.tmpdir= option to select an alternate temp location.
Exception in thread "main" java.io.IOException: Mkdirs failed to create /tmp/hadoop-unjar9106802143724187799
at org.apache.hadoop.util.RunJar.ensureDirectory(RunJar.java:140)
at org.apache.hadoop.util.RunJar.run(RunJar.java:210)
at org.apache.hadoop.util.RunJar.main(RunJar.java:148)
)

【原因】hive元数据可用的内存不足
按照告警信息中提到的共享空间(也就是临时存放目录),查询grep -irC 4 --color -E "tmp\.dir|tmp_dir" /usr/hdp/hive/
得知TMP_DIR是/tmp 而我刚才刚刚往/tmp写入了大量的文件,占了总共9个G,而且写入完成以后就马上出现了此类告警

【解决】

清除/tmp的9个G文件,hive恢复

好了,就写到这里,看官们觉得涨知识了,请在文章左侧点个赞 ^_^

你可能感兴趣的:(大数据)