欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

NoSql选型:Hbase+hadoop想说爱你不容易之单机配置(二)

程序员文章站 2022-07-14 21:21:54
...
Hbase+hadoop想说爱你不容易之单机配置(一),看起来很容易啊,怎么不容易呢?
过程是这样的,先前hbase-site.xml文件是这样配置的
<value>hdfs://129.42.13.118:9000/hbase</value>

于是得到如下错误
java.lang.IllegalArgumentException: Wrong FS: hdfs://129.42.13.118:9000/hbase, expected: hdfs://icache-9200.site:9000
	at org.apache.hadoop.fs.FileSystem.checkPath(FileSystem.java:310)
	at org.apache.hadoop.hdfs.DistributedFileSystem.checkPath(DistributedFileSystem.java:99)
	at org.apache.hadoop.hdfs.DistributedFileSystem.getPathName(DistributedFileSystem.java:155)
	at org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:453)
	at org.apache.hadoop.fs.FileSystem.exists(FileSystem.java:648)
	at org.apache.hadoop.hbase.master.HMaster.<init>(HMaster.java:204)
	at org.apache.hadoop.hbase.LocalHBaseCluster.<init>(LocalHBaseCluster.java:94)
	at org.apache.hadoop.hbase.LocalHBaseCluster.<init>(LocalHBaseCluster.java:78)
	at org.apache.hadoop.hbase.master.HMaster.doMain(HMaster.java:1229)
	at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:1274)

怀疑原因:多个hostname和ip(129.42.13.118)对应,导致应用程序识别出现误差,程序很可能只是记录了一个hostname与上述ip对应。
于是改成hdfs://icache-9200.site:9000/hbase配置,重启hadoop和hbase后,使用java的客户端程序http://lxiaodao.iteye.com/admin/blogs/604896验证测试正常。