准备
- 获取阿里云提供的HBase tar包,有两种方式可以获得:
- 方式一:直接下载完整压缩包,里面已经拥有了访问Lindorm所需的全部依赖,并做了功能增强。下载地址 : 数据库连接 -> 连接信息 -> hbase shell下载。
- 方式二:直接从HBase官方网站下载你所需版本的HBase的tar包。并按照历史版本适配(Jar包替换)的指导,拷贝相应版本的jar包拷贝至tar包解压后的lib目录中。
配置
在解压后的tar包中的conf/目录下的hbase-site.xml文件中,加入如下配置:
<configuration>
<!--
集群的连接地址,在控制台页面的数据库连接界面获得(注意公网地址和VPC内网地址)
-->
<property>
<name>hbase.zookeeper.quorum</name>
<value>ld-xxxx-proxy-hbaseue.hbaseue.xxx.rds.aliyuncs.com:30020</value>
</property>
<!--
设置用户名密码,默认root:root,可根据实际情况调整
-->
<property>
<name>hbase.client.username</name>
<value>root</value>
</property>
<property>
<name>hbase.client.password</name>
<value>root</value>
</property>
</configuration>
使用Shell访问
进入tar包解压路径里的bin/目录,输入./hbase shell
。就可以开始使用原生的HBase Shell访问Lindorm(默认log文件在hbase tar包解压后的logs目录下)。
Shell的详细使用方法可以参见HBase Shell入门。
使用Shell连接只能做简单的DDL操作和数据读写操作,管理接口如balance、move等集群管理命令都已经被禁用,详细请参见使用限制部分。