1.要看官方文档
http://hadoop.apache.org/docs/current/
2.start-dfs.sh时提示rcmd: socket: Permission denied
解决方法:
在/etc/pdsh下面新建文件rcmd_default,写入ssh,然后回车,记得一定要输入一个回车符另起一行,不然会提示ssh exit with code 1
3.org.apache.hadoop.hdfs.server.datanode.DataNode: Problem connecting to server: server3/192.168.2.107:8020
各个节点的配置文件保存一致,这里因为fs.defaultFS设置错误导致,datanode找不到namenode
4.hadoop执行jar
idea生成可执行jar包:https://www.cnblogs.com/blog5277/p/5920560.html
hadoop执行命令:bin/hadoop jar xxx.jar arg1 arg2 (single node)
5.hadoop java api文档
http://hadoop.apache.org/docs/r3.1.0/api/index.html
6.org.apache.hadoop.hdfs.server.common.InconsistentFSStateException: Directory /tmp/hadoop-kevin/dfs/name is in an inconsistent state: storage directory does not exist or is not accessible.
很明显/tmp下是定期清理的 所以我们要把dfs/name设置到其他位置
core-site.yml
<property>
<name>hadoop.tmp.dir</name>
<value>/data/hadoop/hadoop-${user.name}</value>
<description>A base for other temporary directories.</description>
</property>