hadoop2.7.1怎么配置secondarynamenode

2024-12-25 22:23:00
推荐回答(1个)
回答1:

1.conf/core-site.xml:


hadoop.tmp.dir
/home/hadoop/hadooptmp
A base for other temporary directories.



fs.default.name
hdfs://master:9000



2.conf/hadoop-env.sh:
export JAVA_HOME=/home/hadoop/jdk1.x.x_xx

3. conf/hdfs-site.xml:


dfs.replication
2



dfs.data.dir
/home/hadoop/hadoopfs/data


dfs.http.address
master:50070



dfs.back.http.address
node1:50070



dfs.name.dir
/home/hadoop/hadoopfs/name



fs.checkpoint.dir
/home/hadoop/hadoopcheckpoint



dfs.permissions
false



4.conf/mapred-site.xml:


mapred.job.tracker
master:9001


mapred.tasktracker.map.tasks.maximum
4


mapred.tasktracker.reduce.tasks.maximum
4


mapred.child.java.opts
-Xmx1000m



5. conf/masters:
master

6.conf/secondarynamenode(此为新建的文件)
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