Hadoop & Mapreduce Tutorial | Cluster Installation and Configuration

Installation and Configuration

Installation

Installing a Hadoop cluster typically involves unpacking the software on all the machines in the cluster or installing RPMs.

Typically one machine in the cluster is designated as the NameNode and another machine the as ResourceManager, exclusively. These are the masters.

The rest of the machines in the cluster act as both DataNode and NodeManager. These are the slaves.

Configuration

Hadoop 2 configuration is driven by two types of important configuration files:

  • Read-only default configuration – core-default.xml, hdfs-default.xml, yarn-default.xml and mapred-default.xml.
  • Site-specific configuration – conf/core-site.xml, conf/hdfs-site.xml, conf/yarn-site.xml and conf/mapred-site.xml.

Additionally, you can control the Hadoop scripts found in the bin/ directory of the distribution, by setting site-specific values via the conf/hadoop-env.sh and yarn-env.sh.

Site Configuration – To configure the Hadoop cluster you will need to configure the environment in which the Hadoop daemons execute as well as the configuration parameters for the Hadoop daemons. The Hadoop daemons are NameNode/DataNode and ResourceManager/NodeManager.

Configuring Environment – Administrators should use the conf/hadoop-env.sh and conf/yarn-env.sh script to do site-specific customization of the Hadoop daemons’ process environment. At the very least you should specify the JAVA_HOME so that it is correctly defined on each remote node. In most cases you should also specify HADOOP_PID_DIR and HADOOP_SECURE_DN_PID_DIR to point to directories that can only be written to by the users that are going to run the hadoop daemons. Otherwise there is the potential for a symlink attack.

Administrators can configure individual daemons using the configuration options shown below in the table:

DaemonEnvironment Variable
NameNodeHADOOP_NAMENODE_OPTS
DataNodeHADOOP_DATANODE_OPTS
Secondary NameNodeHADOOP_SECONDARYNAMENODE_OPTS
ResourceManagerYARN_RESOURCEMANAGER_OPTS
NodeManagerYARN_NODEMANAGER_OPTS
WebAppProxyYARN_PROXYSERVER_OPTS
Map Reduce Job History ServerHADOOP_JOB_HISTORYSERVER_OPTS

For example, To configure Namenode to use parallelGC, the following statement should be added in hadoop-env.sh :

export HADOOP_NAMENODE_OPTS=”-XX:+UseParallelGC ${HADOOP_NAMENODE_OPTS}”

Other useful configuration parameters that you can customize include:

  • HADOOP_LOG_DIR / YARN_LOG_DIR – The directory where the daemons’ log files are stored. They are automatically created if they don’t exist.
  • HADOOP_HEAPSIZE / YARN_HEAPSIZE – The maximum amount of heapsize to use, in MB e.g. if the variable is set to 1000 the heap will be set to 1000MB. This is used to configure the heap size for the daemon. By default, the value is 1000.

Apply for Big Data and Hadoop Developer Certification

https://www.vskills.in/certification/certified-big-data-and-apache-hadoop-developer

Back to Tutorials

Share this post
[social_warfare]
Need and evolution
Clients

Get industry recognized certification – Contact us

keyboard_arrow_up