Shut down the Hadoop cluster if it is already running, by executing the bin/stop-dfs.sh
and bin/stop-mapred.sh
commands from HADOOP_HOME
.
We can control Hadoop configurations through the following three configuration files:
Each configuration file has name-value pairs expressed in an XML format, and they define the workings of different aspects of Hadoop. The following code snippet shows an example of a property in the configuration file. Here, the <configuration>
tag is the top-level XML container, and the <property>
tags that define individual properties go as child elements of the <configuration>
tag.
<configuration> <property> <name>mapred.reduce.parallel.copies</name> <value>20</value> </property> ... </configuration>
The following instructions show how to change the directory to which we write Hadoop logs and configure the maximum number of map and reduce tasks:
/root/hadoop_logs
.HADOOP_LOG_DIR
in HADOOP_HOME/conf/hadoop-env.sh
and point it to the new directory.HADOOP_HOME/conf/mapred-site.xml
file:<property> <name>mapred.tasktracker.map.tasks.maximum</name> <value>2 </value> </property> <property> <name>mapred.tasktracker.reduce.tasks.maximum</name> <value>2 </value> </property>
bin/stop-mapred.sh
and bin/start-mapred.sh
commands from the HADOOP_HOME
directory.watch ps –ef|grep hadoop
command. If you are in Windows or MacOS use the Task Manager.HADOOP_LOG_DIR
redefines the location to which Hadoop writes its logs. The mapred.tasktracker.map.tasks.maximum
and mapred.tasktracker.reduce.tasks.maximum
properties define the maximum number of map and reduce tasks that can run within a single TaskTracker at a given moment.
These and other server-side parameters are defined in the HADOOP_HOME/conf/*-site.xml
files. Hadoop reloads these configurations after a restart.
There are many similar configuration properties defined in Hadoop. You can see some of them in the following tables.
The configuration properties for conf/core-site.xml
are listed in the following table:
The configuration properties for conf/mapred-site.xml
are listed in the following table:
The configuration properties for conf/hdfs-site.xml
are listed in the following table: