hbase windowns 下, Will not attempt to authenticate using SASL (无法定位登录配置)

来源:互联网 发布:json转换为字符串 编辑:程序博客网 时间:2024/05/29 15:56
Hbase异常(无法定位登录配置)
散仙,最近再用Sqoop从Mysql数据库里向Hbase里导入数据,导入成功后,在eclipse上使用Java Hbase API的连接集群,打印所有数据,结果一运行程序,日志显示无法定位登录配置,具体信息如下:

2013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:java.library.path=D:\soft\Java\jdk1.6.0_32\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;D:/soft/Java/jdk1.7.0_04/bin/../jre/bin/server;D:/soft/Java/jdk1.7.0_04/bin/../jre/bin;D:/soft/Java/jdk1.7.0_04/bin/../jre/lib/amd64;D:\Python;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;D:\soft\Java\jdk1.7.0_04/bin;D:\soft\Java\jdk1.7.0_04/jre/bin ;E:\SSHClient;D:\soft\eclipse;;.2013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:java.io.tmpdir=C:\Users\qin\AppData\Local\Temp\2013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:java.compiler=<NA>2013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:os.name=Windows 72013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:os.arch=amd642013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:os.version=6.12013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:user.name=qin2013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:user.home=C:\Users\qin2013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:user.dir=D:\eclipseworkspace\myfirst2013/12/29-02:20:46  INFO ZooKeeper:438 - Initiating client connection, connectString=192.168.120.129:2181 sessionTimeout=180000 watcher=hconnection2013/12/29-02:20:46  INFO RecoverableZooKeeper:104 - The identifier of this process is 9308@qin-PC2013/12/29-02:20:46  INFO ClientCnxn:966 - Opening socket connection to server namenode/192.168.120.129:2181. Will not attempt to authenticate using SASL (无法定位登录配置)


其实这个信息,并不是Hbase的异常,而是客户端找不到zookeeper的解析地址,由于Hbase是通过hostname解析IP地址的(DNS),Zookeeper只会返回Hbase的域名,需要客户端通过DNS或本地hosts文件进行解析。
解决办法:
在Linux上,在/etc/hosts文件中添加Hbase Master节点的域名及IP地址映射,
在Windows上,修改C:\Windows\system32\etc\hosts文件,添加Hbase Master节点的域名及IP地址映射。
截图如下:








至此,就可以正常使用了,再次启动程序,已经发现没有刚才的问题了
0 0
原创粉丝点击