Two ways to configure Hadoop Secondarynamenode

Source: Internet
Author: User

Hadoop Secondarynamenode is configured in two ways, and the Hadoop version is hadoop-1.0.4:

Cluster allocation Relationship:

Masterjobtracker&&namenode
node1secondarynamenode
node2tasktracker&&datanode
Node3tasktracker&&datanode
Node4tasktracker&&datanode

Configuration 1:

1.conf/core-site.xml:

<configuration>
<property>
	<name>hadoop.tmp.dir</name>
	<value>/home/ Hadoop/hadooptmp</value>
	<description>a Base for other temporary directories.</description>
</property>

<property>
	<name>fs.default.name</name>
	<value> hdfs://master:9000</value>
</property>
</configuration>

2.conf/hadoop-env.sh:

Export JAVA_HOME=/HOME/HADOOP/JDK1.X.X_XX

3. Conf/hdfs-site.xml:

<configuration>
<property>
	<name>dfs.replication</name>
	<value>2< /value>
</property>

<property>
     <name>dfs.data.dir</name>
     <value >/home/hadoop/hadoopfs/data</value>
 </property>
<property>
	<name> dfs.http.address</name>
	<value>master:50070</value>
</property>

< property>
	<name>dfs.back.http.address</name>
	<value>node1:50070</value>
</property>

<property>
	<name>dfs.name.dir</name>
	<value>/ home/hadoop/hadoopfs/name</value>
</property>

<property>
	<name> fs.checkpoint.dir</name>
	<value>/home/hadoop/hadoopcheckpoint</value>
</ property>

<property>
<name>dfs.permissions</name>
<value>false</ value>
</property>
</configuration>

4.conf/mapred-site.xml:

<configuration>
<property>
	<name>mapred.job.tracker</name>
	<value> master:9001</value>
</property>
<property>
	<name> mapred.tasktracker.map.tasks.maximum</name>
	<value>4</value>
</property>
<property>
	<name>mapred.tasktracker.reduce.tasks.maximum</name>
	<value>4</ value>
</property>
<property>
	<name>mapred.child.java.opts</name>
	<value>-Xmx1000m</value>
</property>
</configuration>

5. Conf/masters:

Master

6.conf/secondarynamenode (This is a new file)

Node1

7. Conf/slaves:

Node2
node3
node4

8.bin/start-dfs.sh:

"$bin"/hadoop-daemon.sh--config $HADOOP _conf_dir start namenode $nameStartOpt
"$bin"/hadoop-daemons.sh--config $HADOOP _conf_dir start Datanode $dataStartOpt
"$bin"/hadoop-daemons.sh--config $HADOOP _conf_dir--hosts Secondarynamenode Start Secondarynamenode

9.bin/stop-dfs.sh:

"$bin"/hadoop-daemon.sh--config $HADOOP _conf_dir stop namenode $nameStartOpt
"$bin"/hadoop-daemons.sh--config $ Hadoop_conf_dir Stop Datanode $dataStartOpt
"$bin"/hadoop-daemons.sh--config $HADOOP _conf_dir--hosts Secondarynamenode Stop Secondarynamenode

Configuration 2:

1.conf/core-site.xml:

<configuration>
<property>
	<name>hadoop.tmp.dir</name>
	<value>/home/ Hadoop/hadooptmp</value>
	<description>a Base for other temporary directories.</description>
</property>

<property>
	<name>fs.default.name</name>
	<value>hdfs ://master:9000</value>
</property>
</configuration>

2.conf/hadoop-env.sh:

Export JAVA_HOME=/HOME/HADOOP/JDK1.X.X_XX

3. Conf/hdfs-site.xml:

<configuration>
<property>
	<name>dfs.replication</name>
	<value>2< /value>
</property>

<property>
     <name>dfs.data.dir</name>
     <value >/home/hadoop/hadoopfs/data</value>
 </property>
<property>
	<name> dfs.http.address</name>
	<value>master:50070</value>
</property>

< property>
	<name>dfs.back.http.address</name>
	<value>node1:50070</value>
</property>

<property>
	<name>dfs.name.dir</name>
	<value>/ home/hadoop/hadoopfs/name</value>
</property>

<property>
	<name> fs.checkpoint.dir</name>
	<value>/home/hadoop/hadoopcheckpoint</value>
</ property>

<property>
<name>dfs.permissions</name>
<value>false</ value>
</property>
</configuration>

4.conf/mapred-site.xml:

<configuration>
<property>
	<name>mapred.job.tracker</name>
	<value> master:9001</value>
</property>
<property>
	<name> mapred.tasktracker.map.tasks.maximum</name>
	<value>4</value>
</property>
<property>
	<name>mapred.tasktracker.reduce.tasks.maximum</name>
	<value>4</ value>
</property>
<property>
	<name>mapred.child.java.opts</name>
	<value>-Xmx1000m</value>
</property>
</configuration>

5. Conf/masters:

Node1

7. Conf/slaves:

Node2
node3
node4

There is the use of Secondarynamenode written yesterday, should also have a copy of the Secondarynamenode file to the Namenode process,

Because yesterday when the test was just on a machine, so less copy this step, today with the cluster to test, only to find to copy.

The above two methods have been tested by the cluster and proved to be available.

Share, be happy, grow


Reprint Please specify source: http://blog.csdn.net/fansy1990

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.