版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/chr1991/article/details/84799007
绑定异常 Hadoop BindException 和 Connection Refused
1. java.net.BindException: Address already in use
如果其他程序已经占用了该地址或端口就会发生这样的错误。
netstat -a -t --numeric-ports -p
这条命令可以用来检查端口的使用情况。可以看看是否存在冲突。这里有详细说明。
2. java.net.BindException: Cannot assign requested address
检查 \etc\hosts
设置是否正确。
3. Connection Refused
- 检查防火墙设置,例如
iptables
。 - 检查端口是否被监听。Hadoop的
.sh
文件和ubuntu的/etc/hosts
的地址设置是否正确。 telnet localhost <port>
可以用来检测本地端口是否可用;telnet <server> <port>
可以用来检查远程服务器端口是否可用。- 这里有详细说明。