ITPub博客

首页 > 数据库 > SQL on Hadoop > arm麒麟环境安装hbase

arm麒麟环境安装hbase

原创 SQL on Hadoop 作者:joshliu 时间:2021-03-03 16:34:05 0 删除 编辑

1、下载安装包,并上传服务器

2、创建安装目录,并解压安装包

[root@node2 ~]# mkdir /usr/local/hbase
[root@node2 ~]# tat -zxf hbase-1.2.0-cdh5.16.2-arm64.tar.gz -C /usr/local/hbase

3、修改配置文件

[root@node2 ~]# cd /usr/local/hbase/hbase-1.2.0-cdh5.16.2/conf
[root@node2 conf]# cat hbase-env.sh
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-1.h5.ky10.aarch64
export HBASE_MANAGES_ZK=false
[root@node2 conf]# cat hbase-site.xml
<configuration>
	    <property>
                <name>hbase.rootdir</name>
                <value>hdfs://node2:9000/hbase</value>
        </property>
        <property>
                <name>hbase.cluster.distributed</name>
                <value>true</value>
        </property>
        <property>
                <name>hbase.zookeeper.quorum</name>
                <value>node2,node3,node4,</value>
        </property>
        <property>
                <name>hbase.zookeeper.property.dataDir</name>
                <value>/usr/local/zookeeper/apache-zookeeper-3.5.5-bin/data</value>
        </property>
</configuration>
[root@node2 conf]# vi regionservers 
node2
node3
node4

4、添加环境变量

[root@node2 conf]# cat /etc/profile ## 各节点均添加如下环境变量,并生效
#hbase
export HBASE_HOME=/usr/local/hbase/hbase-1.2.0-cdh5.16.2
export PATH=$HBASE_HOME/bin:$PATH
[root@node2 conf]# source /etc/profile

5、拷贝到其他节点

[root@node2 conf]# cd
[root@node2 ~]# scp -r /usr/local/hbase node3:$PWD
[root@node2 ~]# scp -r /usr/local/hbase node4:$PWD

6、启动hbase

[root@node2 ~]# start-hbase.sh

7、查看服务进程和hbase shell访问hbase数据库

[root@node2 ~]# jps
214710 QuorumPeerMain
256628 Jps
236692 DataNode
236276 NameNode
246203 HRegionServer
[root@node2 ~]# hbase shell
hbase(main):012:0> list
TABLE                                                                                                                
0 row(s) in 0.0170 seconds
=> []
hbase(main):013:0> create 'user11','base_info'
0 row(s) in 1.2500 seconds
=> Hbase::Table - user11
hbase(main):019:0> list
TABLE                                                                                                                
user11                                                                                                               
1 row(s) in 0.0170 seconds
=> ["user11"]
hbase(main):014:0> put 'user11', 'rowkey_10', 'base_info:username', 'asklfjl'
0 row(s) in 0.2020 seconds
hbase(main):015:0> put 'user11', 'rowkey_10', 'base_info:birthday', '2014-07-10'
0 row(s) in 0.0090 seconds
hbase(main):016:0> put 'user11','rowkey_10','base_info:sex','1'
0 row(s) in 0.0070 seconds
hbase(main):017:0> put 'user11','rowkey_10','base_info:address','北京市'
0 row(s) in 0.0120 seconds
hbase(main):018:0> scan 'user11'
ROW                            COLUMN+CELL                                                                           
 rowkey_10                     column=base_info:address, timestamp=1614760178080, value=\xE5\x8C\x97\xE4\xBA\xAC\xE5\
                               xB8\x82                                                                               
 rowkey_10                     column=base_info:birthday, timestamp=1614760177227, value=2014-07-10                  
 rowkey_10                     column=base_info:sex, timestamp=1614760177256, value=1                                
 rowkey_10                     column=base_info:username, timestamp=1614760177111, value=asklfjl                     
1 row(s) in 0.0570 seconds
hbase(main):020:0>


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/69985104/viewspace-2760932/,如需转载,请注明出处,否则将追究法律责任。

下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2020-10-09

  • 博文量
    74
  • 访问量
    30979