分析nmon发现dm-2磁盘压力较大,该磁盘主要写logs\local
avg-cpu: %user %nice %system %iowait %steal %idle
39.68 0.00 60.32 0.00 0.00 0.00
Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util
sdb 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdd 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdc 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sda 5.67 2.67 0.67 1.00 50.67 29.33 48.00 0.02 10.60 9.80 1.63
sde 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdf 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdi 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdg 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdj 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdk 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdl 0.00 0.33 0.00 0.67 0.00 8.00 12.00 0.00 4.50 4.50 0.30
sdm 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdh 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdn 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
dm-0 0.00 0.00 0.00 0.67 0.00 5.33 8.00 0.01 21.00 19.50 1.30
dm-1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
dm-2 0.00 0.00 6.33 3.00 50.67 24.00 8.00 0.05 5.50 0.36 0.33
将Yarn日志修改为写到数据盘目录,然后重启集群,步骤如下:
停止hive
ps -ef|grep metastore | grep -v grep|awk '{print $2}' | xargs kill -9
ps -ef|grep hiveserver2 | grep -v grep|awk '{print $2}' | xargs kill -9
停止Yarn
stop-yarn.sh
备节点: yarn-daemon.sh stopresourcemanager
更新yarn-site.xml
<property>
<name>yarn.nodemanager.local-dirs</name>
<value>/chunk1/yarn/local,/chunk2/yarn/local,/chunk2/yarn/local,/chunk4/yarn/local,/chunk5/yarn/local,/chunk6/yarn/local,/chunk7/yarn/local,/chunk8/yarn/local,/chunk9/yarn/local,/chunk10/yarn/local,/chunk11/yarn/local,/chunk12/yarn/local,/chunk13/yarn/local</value>
</property>
<property>
<name>yarn.nodemanager.log-dirs</name>
<value>/chunk1/yarn/logs,/chunk2/yarn/logs,/chunk2/yarn/logs,/chunk4/yarn/logs,/chunk5/yarn/logs,/chunk6/yarn/logs,/chunk7/yarn/logs,/chunk8/yarn/logs,/chunk9/yarn/logs,/chunk10/yarn/logs,/chunk11/yarn/logs,/chunk12/yarn/logs,/chunk13/yarn/logs</value>
</property>
scp配置文件到各个节点;
重启yarn
start-yarn.sh
mr-jobhistory-daemon.sh starthistoryserver
yarn-daemon.sh start resourcemanager
重启Hive
nohup hive --service metastore &
nohup hive --service hiveserver2 &
而Hadoop是个高密集型内存运算系统,这个改动似乎给它带来了副作用。理论上运算型Java程序应该更多的使用用户态CPU才对,Cloudera官方也推荐关闭THP;
参数修改如下:
echo never >/sys/kernel/mm/redhat_transparent_hugepage/enabled
echo never >/sys/kernel/mm/redhat_transparent_hugepage/defrag
[always] never means that transparenthugepage compaction is enabled.
always [never] means that transparenthugepage compaction is disabled.
10:47完成主机参数修改,修改前后主机Cpu资源对比见下图:
http://blog.sina.com.cn/s/blog_db77b3c60102vsgr.html
http://blog.csdn.net/opensure/article/details/66478063
http://www.cloudera.com/documentation/archive/cdh/4-x/4-2-2/CDH4-Installation-Guide/cdh4ig_topic_11_6.html