
1、通过Java客户端连接Hbase,其中hbase通过zookeeper去管理,需要注意的是客户端端口。
通过在浏览器端输入地址查看:http://192.168.3.206:60010/master-status
可以看到端口与地址。
2、注意在win环境下,需要在
C:\Windows\System32\drivers\etc的hosts文件加上一句:
192.168.1.128 linuxname 服务器名称
原理:client要连接虚拟机的HMaster,HMaster的端口在虚拟机中hbase设置时60000,client首先通过${hbase.ip}:2181端口和hbase通信,hbase返回HMaster所在的机子的hostname(hbase是为集群设置的,对hosts很敏感),虚拟机中的hostname是localhost.localdomain,因此isa通过sn( ServerName sn )取到ip地址,因此需要在hosts设置HMaster所在的主机hostname的ip
注意是hostname
3、不要输入zookeeper管理habse文件地址。
常见错误:
This server is in the failed servers list: localhost/127.0.0.1:60000 本地没有映射。
org.apache.Hadoop.hbase.MasterNotRunningException: The node /tmp/zookeeper zookeeper启动问题,hbase在0.21.以后回自己管理zookeeper,不用手动去启动,执行./hbase-start.sh 命令,然后可以看到
Hmaster
HRegionserver
4、执行./stop-hbase.sh 如果报错 找不到pid hbase集群有问题 重新配置,否则将无法采集,找不到主机。