HadOOP部署和调试遇到的一些问题 V1.0.2

1.使用HDFS,用JAVAAPI存入文件时报错

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

2.强制关机或者killhadoop进程后报错

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.

强关后需要关闭安全模式:

引用
bin/hadoop dfsadmin -safemode leave #关闭safe mode

相关推荐