一、hiveservice2文件打开数太多
1、这几个hiveservice的文件数一直在告警,如图 
2、通过命令查看hiveservice的文件打开数
lsof -p pid |wc -l

hive文件打开数太多任务会出现(too many open files)
 3、解决方案 查看现状的 hiveserver max : 32768
ulimit -n
65535
cat /proc/sys/fs/file-max
13057222
4、调大系统max进程参数
1、进程的max : 65535 --> 131070
2、系统的max : 13057222 --> 35942900
5、调整参数
ulimit -n 131070
vim /etc/security/limits.conf
* soft nofile 131070
* hard nofile 131070
6、修改系统进程max
echo 35942900 > /proc/sys/fs/file-max
vim /etc/sysctl.conf
fs.file-max = 35942900
7、在cm上打开hive.server2.logging.operation.enabled,调整最大文件数至65535 ,并重启hiveservice2

 8、重启hiveservice2  9、验证更改是否生效65535
cat /proc/`netstat -nltp|grep -w 10000|awk '{print $NF}'| awk -F "/" '{print $1}'`/limits | grep open

补充
hive 参数调整日志级别
<!-- hiveserver 保存操作日志并使其可供客户端使用-->
<property>
<name>hive.server2.logging.operation.enabled</name>
<value>true</value>
</property>
<!-- hiveserver 操作日志记录模式可供客户端在会话级别设置 -->
<property>
<name>hive.server2.logging.operation.level</name>
<value>NONE</value>
</property>
<!-- hiveserver 操作日志保存路径 -->
<property>
<name>hive.server2.logging.operation.log.location</name>
<value>/opt/bigdata/hadoop/hive110/oprlog</value>
</property>
beeline 控制日志输出
bin/beeline --hiveconf hive.server2.logging.operation.level=NONE
更多日志配置,请看如下
Hiveserver日志配置
Apache-hive
|