Hbase偽分散式環境搭建

一介神符師發表於2020-10-25

1 軟體

OS:CentOS Linux release 7.8.2003 (Core)

Hadoop:hadoop-2.7.4.tar.gz

Hbase:hbase-1.4.13-bin.tar.gz

 

2 安裝Hadoop

wget http://archive.apache.org/dist/hadoop/common/hadoop-2.7.4/hadoop-2.7.4.tar.gz

具體步驟參考:

 

3 安裝Hbase

conf/hbase-site.xml

<configuration>
	<property>
		<name>hbase.rootdir</name>
		<value>hdfs://test:9000/hbase</value>
	</property>    
	<property>
		<name>hbase.cluster.distributed</name>
		<value>true</value>
	</property>
	<property>
		<name>hbase.zookeeper.quorum</name>
		<value>test</value>
	</property>
</configuration>

conf/hbase-env.sh

export JAVA_HOME=/opt/jdk
export HBASE_MANAGES_ZK=true
hadoop fs -mkdir /hbase
mkdir -p /opt/hbase/zookeeper

 

4 啟動關閉

bin/start-hbase.sh
bin/stop-hbase.sh

 

5 測試

bin/hbase shell
hbase(main):018:0> exit
# 檢視所有表
hbase(main):001:0> list

hbase(main):005:0> create 'test','c1','c2'

hbase(main):005:0>
put 'test','r1','c1:1','11'
put 'test','r1','c1:2','12'
put 'test','r1','c1:3','13'
put 'test','r1','c2:1','21'
put 'test','r1','c2:2','22'
put 'test','r2','c1:1','31'
put 'test','r2','c1:2','32'

hbase(main):014:0> scan 'test'

hbase(main):015:0> get 'test','r1',{COLUMN => 'c2:2'}

hbase(main):016:0> disable 'test'

hbase(main):017:0> drop 'test'

 

 

 

 

相關文章