ubuntu安装hadoop2.x(伪分布式)
1.x和2.x在安装上差异不大,就是程序目录不大一样。
hadoop1.x和2.x部分对应关系
1.x | 2.x | |
core-site.xml | ${HADOOP_HOME}/conf/core-site.xml | ${HADOOP_HOME}/etc/hadoop/core-site.xml |
hdfs-site.xml | ${HADOOP_HOME}/conf/hdfs-site.xml | ${HADOOP_HOME}/etc/hadoop/hdfs-site.xml |
namenode format | ${HADOOP_HOME}/bin/hadoop namenode -format | ${HADOOP_HOME}/bin/hdfs namenode -format |
start-dfs.sh | ${HADOOP_HOME}/bin/start-dfs.sh | ${HADOOP_HOME}/sbin/start-dfs.sh |
stop-dfs.sh | ${HADOOP_HOME}/bin/stop-dfs.sh | ${HADOOP_HOME}/sbin/star-dfs.sh |
example.jar | ${HADOOP_HOME}/hadoop-examples-1.x.x.jar | ${HADOOP_HOME}/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.x.x.jar |
wordcount |
$ cd ${HADOOP_HOME} $ bin/hadoop jar hadoop-examples-1.2.1.jar wordcount input output |
$ cd ${HADOOP_HOME} $ bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.x.x.jar org.apache.hadoop.examples.WordCount input output |
mapreduce | 待补充 | 待补充 |
其他 | 待补充 | 待补充 |
备注
2.x 在安装完成后,执行dfs命令是会报一个WARN
15/04/24 15:35:53 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
这个不影响。网上也有具体的解决办法。