Centos7-搭建hdfs启动时报java.net.BindException: Problem binding to [node01:9000] java.net.BindException异常
今天用阿里的服务器搭了个伪分布式的HDFS,格式化后启动hdfs,发现只有dataNode启动了,查看启动日志发现异常:
2019-01-22 15:54:50,507 FATAL org.apache.hadoop.hdfs.server.namenode.NameNode: Failed to start namenode.
java.net.BindException: Problem binding to [node01:9000] java.net.BindException: Cannot assign requested address; For more details see: http://wiki.apache.org/hadoop/BindException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.apache.hadoop.net.NetUtils.wrapWithMessage(NetUtils.java:791)
at org.apache.hadoop.net.NetUtils.wrapException(NetUtils.java:720)
at org.apache.hadoop.ipc.Server.bind(Server.java:424)
at org.apache.hadoop.ipc.Server$Listener.<init>(Server.java:573)
at org.apache.hadoop.ipc.Server.<init>(Server.java:2206)
at org.apache.hadoop.ipc.RPC$Server.<init>(RPC.java:944)
at org.apache.hadoop.ipc.ProtobufRpcEngine$Server.<init>(ProtobufRpcEngine.java:537)
at org.apache.hadoop.ipc.ProtobufRpcEngine.getServer(ProtobufRpcEngine.java:512)
at org.apache.hadoop.ipc.RPC$Builder.build(RPC.java:789)
at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.<init>(NameNodeRpcServer.java:331)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createRpcServer(NameNode.java:627)
at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:600)
at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:765)
at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:749)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1446)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1512)
针对找个异常,首先是要确定自己的配置文件有没有配置错误,检查了一遍没错呀。然后就去官网看看什么原因(点击查看官网关于此异常介绍),官网上的内容如下:

根据官网介绍,出现这种情况要么是9000端口被占用了,要么就是hdfs在EC2上运行,那么hdfs服务将尝试使用公共主机名或IP显式绑定公共弹性IP地址,或者隐式使用“0.0.0.0”作为地址。
首先看看9000端口有没有被占用,输入官网提供的指令: netstat -a -t --numeric-ports -p,发现9000端口并没有被占用,那么就是第二个原因了。百度了一下阿里的ECS服务器无法绑定公网IP的地址,细心的人应该能发现连接服务器的ip和你连接服务器后,输入ifconfig显示的ip地址不一致。如下图,可以看到网段都不一样:

所以要解决这个BindException,直接修改/etc/hosts文件:
内网IP地址 hostname1
公网IP地址 hostname2

注意:内网IP对应的hostname要和hadoop的配置文件core-site.xml的hostname对应。
<property>
<name>fs.defaultFS</name>
<value>hdfs://node01:9000</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/var/abc/hadoop/local</value>
</property>
修改完成后重新格式化,hdfs就可以正常启动了。
Centos7-搭建hdfs启动时报java.net.BindException: Problem binding to [node01:9000] java.net.BindException异常的更多相关文章
- java.net.BindException: Problem binding to [hadoop103:8031] java.net.BindException
ResourceManger启动失败,Namenode启动成功,这个问题排查了好久 在hadoop-2.7.6/logs/yarn-root-resourcemanager-hadoop102.log ...
- Problem binding to [bigdata-server-01:9000] java.net.BindException: Cannot assign requested address;
If the port is "0", then the OS is looking for any free port -so the port-in-use and port- ...
- java.net.BindException: Problem binding to [node2:45454] java.net.BindException: Cannot assign requested address
主要原因是网络的问题.可参考官方给出的详细解释. http://wiki.apache.org/hadoop/BindException 总之,这是网络或者配置网络的问题,跟 hadoop 基本没有关 ...
- MyEclipse for Spring启动时报错"An internal error occurred during: 'Updating indexes'.Java heap space"的解决办法
问题 MyEclipse for Spring在启动时,报如下错误:An internal error occurred during: 'Updating indexes'.Java heap sp ...
- 项目启动时报错Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError
https://www.cnblogs.com/liuyp-ken/p/7911536.html 解决过程: 1.检查配置,反反复复看了很多遍,确认没有问题. 2. 网上找了很多资料,类似的问题很多, ...
- springmvc启动时报错:找不到类ContextLoaderListener:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
严重: Error configuring application listener of class org.springframework.web.context.ContextLoaderLis ...
- java.net.BindException:Problem binding to [hostname:8088]地址已在使用
异常提示端口号被占用 查找被占用的端口 netstat -tln netstat -tln | grep 8083 netstat -tln ## 查看端口使用情况,而netstat -tln | g ...
- Tomcat启动时报错:java.net.BindException: Permission denied <null>:80 【转载】
本文转载自: http://blog.sina.com.cn/s/blog_4550f3ca0101g37l.html 问题起因:做负载均衡时需要将Web工程与Wap工程同时部署在一台Suse服务 ...
- Jenkins启动时报错:java.net.BindException: Address already in use: bind 解决方法
下载jenkins.war包后,进入Jenkins.war包目录下,运行java -jar jenkins.war时报端口被占用的错误:java.net.BindException: Address ...
随机推荐
- ideaaaaaaaaa
数据库proxy:可以用作自动化数据逆向SQL test4j/jtester:
- C#中DataTable中Rows.Add 和 ImportRow 对比
最近参加项目中,数据操作基本都是用DataTable的操作,老代码中有些地方用到DataTable.Rows.Add又有些代码用的DataTable.ImportRow,于是就对比了一下 VS查询说明 ...
- FZOJ Problem 2103 Bin & Jing in wonderland
...
- POJ3067 Japan
Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 26270 Accepted: 7132 Description Japa ...
- display的32种写法--摘抄
你知道『回』字有四种写法,但你知道display有32种写法吗?今天我们一一道来,让你一次性完全掌握display,从此再也不用对它发愁. 从大的分类来讲,display的32种写法可以分为6个大类, ...
- JSTL <C:if></C:if> 和<C:ForEach></C:ForEach> 入门级~
一.<C:If>标签:条件判断语句 <c:if test="${objList.nodetype == 1}">上级节点</c:if> te ...
- AC日记——Super Mario hdu 4417
Super Mario Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total ...
- js-className修改class属性
1.修改className 1)修改class类名为p-a-0 2)在保留class="p1"的基础上再添加一个类名为p-a-0 2.删除className 1).结果需删除cla ...
- Codeforces Gym101572 G.Galactic Collegiate Programming Contest (2017-2018 ACM-ICPC Nordic Collegiate Programming Contest (NCPC 2017))
Problem G Galactic Collegiate Programming Contest 这个题题意读了一会,就是几个队参加比赛,根据实时的信息,问你1号队的实时排名(题数和罚时相同的时候并 ...
- [Python Cookbook] IPython: An Interactive Computing Environment
You can launch IPython on the command line just like launching the regular Python interpreter except ...