lib下拷貝hadoop的hadoop-core-1.1.2.jar文件,刪除原來文件shell
hbase-env.shoop
export JAVA_HOME=/opt/jdk1.6.0_12/ export HBASE_MANAGES_ZK=false
hbase-site.xmlcode
<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <configuration> <property> <name>hbase.rootdir</name> <value>hdfs://localhost:9000/hbase</value> </property> <property> <name>hbase.cluster.distributed</name> <value>true</value> </property> </configuration>
啓動xml
bin/start-hbase.sh
進入shellhadoop
bin/hbase shell
//建表,表名、列族get
hbase(main):002:0> create 'tab1','fam1'it
//列出全部的表io
hbase(main):003:0> listclass
//插表,表名、行名、列族:列名、值jdk
hbase(main):004:0> put 'tab1','row1','fam1:col1','val1'
//查看錶中的信息
hbase(main):007:0> scan 'tab1'
//get指令獲取表中的一行數據
hbase(main):008:0> get 'tab1','row2'
//delete刪除一行數據
hbase(main):009:0> delete 'tab1','row2','fam1:col2'
//刪除表
hbase(main):011:0> disable 'tab1'
hbase(main):012:0> drop 'tab1'