hadoop nn配置G1垃圾回收器

转载来自lk 

GC参数的调整,使用了G1GC,完成的GC字符和需要根据情况来这顶的配置如下:

总的配置:
-XX:+UseG1GC -XX:MaxGCPauseMillis=200  -XX:+UnlockExperimentalVMOptions -XX:+ParallelRefProcEnabled -XX:-ResizePLAB -XX:+PerfDisableSharedMem -XX:-OmitStackTraceInFastThrow -XX:G1NewSizePercent=2 -XX:ParallelGCThreads=16 -XX:InitiatingHeapOccupancyPercent=40 -XX:G1HeapRegionSize=32M -XX:G1HeapWastePercent=10 -XX:G1MixedGCCountTarget=16 -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=100M -Xloggc:/var/log/hbase/gc.log

解释
1 MaxGCPauseMillis:每次GC的目标时间,这里设置为设置为100毫秒,而后续调整为200毫秒,是为了兼顾每批处理的内存大小,并且保证足够的SLA

2 G1NewSizePercent:最小可以支持的newsize百分比,这里是2%,建议是G1NewSizePercent * heapsize要接近1GB的大小,让程序在MaxGCPauseMillis内能够完成一次GC

3 InitiatingHeapOccupancyPercent开始进行GC的内存百分比,一般是40-60左右

4 ParallelGCThreads,推荐配置是根据计算机上的核数进行调整的,推荐(core-8)*5/8 + 8

实例: 主机32C,256G

配置如下:

1 配置nn heapsize
export HADOOP_NAMENODE_INIT_HEAPSIZE=65536

2 配置jvm
export HADOOP_NAMENODE_OPTS="-server -Xmx220G -Xms200G -XX:+UseG1GC -XX:MaxGCPauseMillis=200  -XX:+UnlockExperimentalVMOptions -XX:+ParallelRefProcEnabled -XX:-ResizePLAB -XX:+PerfDisableSharedMem -XX:-OmitStackTraceInFastThrow -XX:G1NewSizePercent=2 -XX:ParallelGCThreads=23 -XX:InitiatingHeapOccupancyPercent=40 -XX:G1HeapRegionSize=32M -XX:G1HeapWastePercent=10 -XX:G1MixedGCCountTarget=16 -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=100M -Xloggc:/var/log/hbase/gc.log -Dhadoop.security.logger=${HADOOP_SECURITY_LOGGER:-INFO,RFAS} -Dhdfs.audit.logger=${HDFS_AUDIT_LOGGER:-INFO,NullAppender} $HADOOP_NAMENODE_OPTS"

 问题:配置后,jps看不到进程,待亲测

你可能感兴趣的:(大数据运维之linux日常,大数据运维之hadoop日常)