Hadoop Secondarynamenode is configured in two ways, and the Hadoop version is hadoop-1.0.4:
Cluster allocation Relationship:
Masterjobtracker&&namenode
node1secondarynamenode
node2tasktracker&&datanode
Node3tasktracker&&datanode
Node4tasktracker&&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