[b]1.使用HDFS,用JAVA API存入文件时报错[/b]
通过命令 lsof -i :9000
发现如果系统支持IPv6的话, Hadoop会自动使用IPv6,破解:
在hadoop-env.sh下添加下一句:
[b]2.强制关机或者kill hadoop进程后报错[/b]
强关后需要关闭安全模式:
[quote]bin/hadoop dfsadmin -safemode leave #关闭safe mode[/quote]
Exception in thread "main" java.net.ConnectException: Call to IP:9000 failed on connection exception: java.net.ConnectException: Connection refused: no further information
通过命令 lsof -i :9000
发现如果系统支持IPv6的话, Hadoop会自动使用IPv6,破解:
在hadoop-env.sh下添加下一句:
HADOOP_OPTS=-Djava.net.preferIPv4Stack=true
[b]2.强制关机或者kill hadoop进程后报错[/b]
Exception in thread "main" org.apache.hadoop.ipc.RemoteException: org.apache.hadoop.hdfs.server.namenode.SafeModeException: Cannot create file/usr/local/test. Name node is in safe mode.
强关后需要关闭安全模式:
[quote]bin/hadoop dfsadmin -safemode leave #关闭safe mode[/quote]