Environment variables for sizing NameNode heap memory
You can configure the values of HADOOP_HEAPSIZE and HADOOP_NAMENODE_OPTS to size the NameNode heap memory.
HADOOP_HEAPSIZE sets the JVM heap size for
all Hadoop project servers such as HDFS, YARN, and MapReduce.
HADOOP_HEAPSIZE is an integer passed to the JVM as
the maximum memory (Xmx) argument. For
example:
HADOOP_HEAPSIZE=1024
HADOOP_NAMENODE_OPTS is specific to the NameNode and
sets all JVM flags, which must be specified.
HADOOP_NAMENODE_OPTS overrides the
HADOOP_HEAPSIZE Xmx value for the NameNode. For
example:
HADOOP_NAMENODE_OPTS=-Xms1024m -Xmx1024m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled -XX:+PrintTenuringDistribution -XX:OnOutOfMemoryError={{AGENT_COMMON_DIR}}/killparent.sh
Both HADOOP_NAMENODE_OPTS and
HADOOP_HEAPSIZE are stored in
/etc/hadoop/conf/hadoop-env.sh
.