Hadoop配置遇到的问题总结

0. 环境说明:

hbase-2.1.3,hadoop-3.1.2,ubuntu 18.04

1. 无法连接http://localhost:50070

我的配置过程是参考官方文档的:http://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-common/SingleCluster.html
 一步一步核对很多次,配置按文档所述,但就是无法打开上面的链接。后面bing了一下,找到了原因:
 https://stackoverflow.com/questions/19641326/http-localhost50070-does-not-work-hadoop
 原来是新版此端口变为9870了:

Since Hadoop 3.0.0 - Alpha 1 there was a Change in the port configuration:
http://localhost:50070
was moved to
http://localhost:9870

2. 执行./bin/start-hbase.sh,使用jps看到HMaster and HRegionServer运行不起来, 在logs/hbase-xxx-master-xxx-iMac.log中看到报错:

2019-03-03 18:42:41,252 ERROR [main] regionserver.HRegionServer: Failed construction RegionServer
java.lang.NoClassDefFoundError: org/apache/htrace/SamplerBuilder
at org.apache.hadoop.hdfs.DFSClient.(DFSClient.java:644)
at org.apache.hadoop.hdfs.DFSClient.(DFSClient.java:628)
at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:149)

网上搜索看到如下解决方法:
https://stackoverflow.com/questions/19641326/http-localhost50070-does-not-work-hadoophttps://stackoverflow.com/questions/19641326/http-localhost50070-does-not-work-hadoop
,执行如下命令解决:

cp ./lib/client-facing-thirdparty/htrace-core-3.1.0-incubating.jar ./lib/

3. 分别按照hbase和hadoop官方文档配置,hbase配置为hbase.cluster.distributed=true, 无法连接上hadoop,执行./bin/hadoop fs -ls /hbase提示错误。

log中有如下错误:

2019-03-03 21:57:54,012 ERROR [master/localhost:16000:becomeActiveMaster] master.HMaster: Failed to become active master
java.net.ConnectException: Call From xxx-iMac/localhost to localhost:8020 failed on connection exception: java.net.ConnectException: Connection refused; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAcce

结果发现hadoop的etc/hadoop/core-site.xml中配置如下:

<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:8020</value>
</property>

而hbase的conf/hbase-site.xml中配置如下:

<property>
<name>hbase.rootdir</name>
<value>hdfs://localhost:9000/hbase</value>
</property>

发现端口不一致,所以连接不上。在hbase-site.xml中将9000也改为8020,停止hdfs和hbase,都重新启一下就好了。
这又是文档上的二者版本不一致导致的文档错误。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值