Java 无法分配请求的地址
cat/etc/hostsJava 无法分配请求的地址,java,ubuntu,hadoop,hbase,Java,Ubuntu,Hadoop,Hbase,cat/etc/hosts 127.0.0.1 localhost.localdomain localhost #192.168.0.105 UG-BLR-L030.example.com UG-BLR-L030 localhost 192.168.0.105 UG-BLR-L030 localhost.localdomain localhost # The following lines are desirable for IPv6 capable hosts ::1 ip6-l
127.0.0.1 localhost.localdomain localhost
#192.168.0.105 UG-BLR-L030.example.com UG-BLR-L030 localhost
192.168.0.105 UG-BLR-L030 localhost.localdomain localhost
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
核心站点.xml
<configuration>
<property>
<name>hadoop.tmp.dir</name>
<value>/usr/local/hadoop/hadoop-data</value>
<description>A base for other temporary directories.</description>
</property>
<property>
<name>fs.default.name</name>
<value>hdfs://UG-BLR-L030:54310</value>
<description>The name of the default file system. A URI whose
scheme and authority determine the FileSystem implementation. The
uri's scheme determines the config property (fs.SCHEME.impl) naming
the FileSystem implementation class. The uri's authority is used to
determine the host, port, etc. for a filesystem.</description>
</property>
</configuration>
ifconfig
eth0 Link encap:Ethernet HWaddr f0:1f:af:4a:6b:fa
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:340842 errors:0 dropped:0 overruns:0 frame:0
TX packets:197054 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:410705701 (410.7 MB) TX bytes:18456910 (18.4 MB)
Interrupt:20 Memory:f7e00000-f7e20000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:1085723 errors:0 dropped:0 overruns:0 frame:0
TX packets:1085723 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:136152053 (136.1 MB) TX bytes:136152053 (136.1 MB)
wlan0 Link encap:Ethernet HWaddr 0c:8b:fd:1d:14:ba
inet addr:192.168.0.105 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:873934 errors:0 dropped:0 overruns:0 frame:0
TX packets:630943 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:919721448 (919.7 MB) TX bytes:92919940 (92.9 MB)
错误:
ERROR org.apache.hadoop.hdfs.server.namenode.NameNode: java.net.BindException: Problem binding to UG-BLR-L030/192.168.0.105:54310 : Cannot assign requested address
为什么hadoop尝试连接到
UG-BLR-L030/192.168.0.105:54310
,而不是UG-BLR-L030:54310
或192.168.0.105:54310
,我通过编辑我的hosts文件,使其看起来像这样:
127.0.0.1 UG-BLR-L030.example.com UG-BLR-L030 localhost
192.168.0.105 UG-BLR-L030.example.com UG-BLR-L030
我通过编辑我的主机文件使其如下所示,成功地实现了这一点:
127.0.0.1 UG-BLR-L030.example.com UG-BLR-L030 localhost
192.168.0.105 UG-BLR-L030.example.com UG-BLR-L030
运行此操作的主机是否实际配置了该IP地址?在Linux上使用
ifconfig
检查,在Windows上使用ipconfig
检查。所有东西都在我的笔记本电脑上。这是一个seudo分布式安装程序,在一台机器上运行。@realponsum我还添加了ifconfig
OK的输出,因此IP地址可用。因此,请检查端口(使用sudo netstat-nlp--inet
)和本地端口范围(使用cat/proc/sys/net/ipv4/ip\u local\u port\u range
)上是否有其他内容正在侦听。已检查。一切看起来都很好。你知道为什么hadoop会尝试连接到UG-BLR-L030/192.168.0.105:54310。它应该只是主机名和端口。您运行此操作的主机是否实际配置了该IP地址?在Linux上使用ifconfig
检查,在Windows上使用ipconfig
检查。所有东西都在我的笔记本电脑上。这是一个seudo分布式安装程序,在一台机器上运行。@realponsum我还添加了ifconfig
OK的输出,因此IP地址可用。因此,请检查端口(使用sudo netstat-nlp--inet
)和本地端口范围(使用cat/proc/sys/net/ipv4/ip\u local\u port\u range
)上是否有其他内容正在侦听。已检查。一切看起来都很好。你知道为什么hadoop会尝试连接到UG-BLR-L030/192.168.0.105:54310。它应该只是主机名和端口。