学习资料
下载HBase可以从HBase的官网或者清华大学的镜像中下载。
tar xzvf hbase-2.5.5-hadoop3-bin.tar.gz cd hbase-4.0.0-alpha-1-SNAPSHOT/
create 'tempTable','f1','f2','f3' put 'tempTable' ,'r1','f1:c1' ,'hello,db' scan 'tempTable' get 'tempTable', 'r1' , {COLUMN=>'f1:c1'} disable 'tempTable' drop 'tempTable'
独立运行的HBase的守护进程都在一个JVM中运行,这些守护进程包括aster, RegionServers, and ZooKeeper。
tar zxvf hbase-2.5.5-hadoop3-bin.tar.gz
Hbase的主要配置文件是conf/hbase-env.sh和conf/hbase-site.xml在conf/hbase-env.sh中添加JAVA_HOME
conf/hbase-env.sh
conf/hbase-site.xml
JAVA_HOME
export JAVA_HOME=/home/wy/software/jdk1.8.0_202
conf/hbase-site.xml的默认配置是
<property> <name>hbase.cluster.distributed</name> <value>false</value> </property> <property> <name>hbase.tmp.dir</name> <value>./tmp</value> </property> <property> <name>hbase.unsafe.stream.capability.enforce</name> <value>false</value> </property>
数据默认写到了当前文件的tmp下
tmp
此处也可以配置Hbase数据写到hdfs文件系统当中
<property> <name>hbase.cluster.distributed</name> <value>true</value> </property> <property> <name>hbase.rootdir</name> <value>hdfs://server:8020/hbase</value> </property>
./bin/start-hbase.sh
Hbase运行成功后有一个简单的管理界面http://localhost:16010/