Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to define memory separately for hadoop daemons in hadoop-env.sh

Tags:

java

hadoop

As I know hadoop-env.sh is the configuration file for settings environment for the hadoop daemons. In This file how can I define HADOOP_HEAPSIZE is the property to define heap size for daemons. Is it mean that it will work for all the daemons like namenode,datanode,task tracker,job tracker and secondary namenode all will take 1000 mb memory on each machine. If yes then how can I make different for each one.

I watch following few entries in hadoop-env.sh

export HADOOP_NAMENODE_OPTS="-Dcom.sun.management.jmxremote $HADOOP_NAMENODE_OPTS"
export HADOOP_SECONDARYNAMENODE_OPTS="-Dcom.sun.management.jmxremote $HADOOP_SECONDARYNAMENODE_OPTS"
export HADOOP_DATANODE_OPTS="-Dcom.sun.management.jmxremote $HADOOP_DATANODE_OPTS"
export HADOOP_BALANCER_OPTS="-Dcom.sun.management.jmxremote $HADOOP_BALANCER_OPTS"
export HADOOP_JOBTRACKER_OPTS="-Dcom.sun.management.jmxremote $HADOOP_JOBTRACKER_OPTS"

Are these entries for seperatly allocate the memory for each daemon, if yes then what is -Dcom.sub.management.jmxremote as much I know syntax for java heap memory allocation is like -Xmx<size>m.

Also In this where is task tracker. and what is Balancer.

like image 887
agarwal_achhnera Avatar asked Nov 10 '22 03:11

agarwal_achhnera


1 Answers

-Dcom.sun.management.jmxremote is used to allow JMX client access. http://docs.oracle.com/javase/7/docs/technotes/guides/management/agent.html

Yes the options you listed in your question are used as JVM options when starting those daemons respectively. So HADOOP_NAMENODE_OPTS is used when name node daemon is started, HADOOP_DATANODE_OPTS is used when data node daemon is started, etc. You can add "-Xmx " option to those variables with different values so different types of daemons will have different heap sizes.

like image 170
Kai Avatar answered Nov 14 '22 23:11

Kai