1 hbase

2023/10/25

# 1 hbase

# 解压/opt/software

tar -xvf hbase-1.4.13-bin.tar.gz

# vim /etc/profile

export HBASE_HOME=/opt/hbase-1.4.13

export PATH=$PATH:$HBASE_HOME/bin

# vim /opt/software/hbase-1.4.13/conf/hbase-env.sh

export JAVA_HOME=/usr/java/jdk

# hbase命令

  1. 启动和停止 HBase

    启动 HBase:

    start-hbase.sh
    

    停止 HBase:

    stop-hbase.sh
    
  2. 查看 HBase 状态

    进入 HBase shell:

    hbase shell
    

    在 HBase shell 中,你可以使用 status 命令来查看 HBase 的状态:

    hbase(main):001:0> status
    
  3. 操作 HBase 表

    在 HBase shell 中,你可以使用各种命令来操作 HBase 表。例如,你可以使用 list 命令来查看所有的表:

    hbase(main):002:0> list
    

    创建表:

    hbase(main):003:0> create 'table_name', 'column_family'
    

    删除表:

    hbase(main):004:0> disable 'table_name'
    hbase(main):005:0> drop 'table_name'
    

    插入数据:

    hbase(main):006:0> put 'table_name', 'row_key', 'column_family:column', 'value'
    

    查询数据:

    hbase(main):007:0> get 'table_name', 'row_key'
    
  4. 查看 HBase 版本

    在 HBase shell 中,你可以使用 version 命令来查看 HBase 的版本:

    hbase(main):008:0> version