1.要看官方文档html
http://hadoop.apache.org/docs/current/java
2.start-dfs.sh时提示rcmd: socket: Permission deniednode
解决方法:
在/etc/pdsh下面新建文件rcmd_default,写入ssh,而后回车,记得必定要输入一个回车符另起一行,否则会提示ssh exit with code 1apache
3.org.apache.hadoop.hdfs.server.datanode.DataNode: Problem connecting to server: server3/192.168.2.107:8020api
各个节点的配置文件保存一致,这里由于fs.defaultFS设置错误致使,datanode找不到namenodessh
4.hadoop执行jarsocket
idea生成可执行jar包:https://www.cnblogs.com/blog5277/p/5920560.htmlide
hadoop执行命令:bin/hadoop jar xxx.jar arg1 arg2 (single node)oop
5.hadoop java api文档idea
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>