Hbase使用

  • 配置hbase-env.sh
    export JAVA_HOME=/opt/app/jdk1.7.0_67
  • 配置regionservers
    bigdata.eclipse.com
  • 配置hbase-site.xml

    <property >
        <name>hbase.tmp.dir</name>
        <value>/opt/app/hbase-0.98.6-hadoop2/data</value> 
    </property>
    
    <property >
        <name>hbase.rootdir</name>
        <value>hdfs://bigdata.eclipse.com:8020/hbase</value> 
    </property>
    
    <property >
        <name>hbase.cluster.distributed</name>
        <value>true</value> 
    </property>
    
    <property>
        <name>hbase.zookeeper.quorum</name>
        <value>bigdata.eclipse.com</value> 
    </property>
  • 启动hbase

    bin/hbase-daemon.sh start master bin/hbase-daemon.sh start regionserver
  • 启动hbase的shell命令
    bin/hbase shell
  • 基本命令
1create table
   create 'student','info'
2、list table
   list
3、insert data
   put 'student','10010','info:name','zhangsan'
   put 'student','10010','info:age','10'
   put 'student','10010','info:address','beijing'
   put 'student','10020','info:name','lisi'
   put 'student','10020','info:age','10'
   put 'student','10020','info:age','14'
   put 'student','10030','info:name','wangwu'
4、query data
   1)get 'student','10010'
   2)scan 'student'
   3)scan 'student', {STARTROW => '10010',STOPROW => '10030'}
5delete data
   delete 'student','10010'

你可能感兴趣的:(Hbase使用)