Download hbase-2.2.1-bin.tar.gz and execute the installation command:
[hadoop@hadoop01 ~]$ tar -zxvf hbase-2.2.1-bin.tar.gz
Check the installation directory:
[hadoop@hadoop01 ~]$ cd hbase-2.2.1
[hadoop@hadoop01 hbase-2.2.1]$ ls -l
total 872
drwxr-xr-x. 4 hadoop hadoop 4096 Sep 10 14:26 bin
-rw-r--r--. 1 hadoop hadoop 128367 Sep 9 09:16 CHANGES.md
drwxr-xr-x. 2 hadoop hadoop 178 Sep 10 14:26 conf
drwxr-xr-x. 7 hadoop hadoop 80 Sep 10 14:28 hbase-webapps
-rw-rw-r--. 1 hadoop hadoop 262 May 2 2018 LEGAL
drwxrwxr-x. 6 hadoop hadoop 8192 Sep 21 23:30 lib
-rw-rw-r--. 1 hadoop hadoop 129312 Sep 10 14:31 LICENSE.txt
-rw-rw-r--. 1 hadoop hadoop 519346 Sep 10 14:31 NOTICE.txt
-rw-r--r--. 1 hadoop hadoop 1477 Sep 9 09:16 README.txt
-rw-r--r--. 1 hadoop hadoop 82873 Sep 9 09:16 RELEASENOTES.md
Enter the installation directory conf, edit hbase-env.sh, hbase-site, regionservers file :
[hadoop@hadoop01 hbase-2.2.1]$ cd conf
[hadoop@hadoop01 conf]$ ls
hadoop-metrics2-hbase.properties hbase-site.xml
hbase-env.cmd log4j.properties
hbase-env.sh regionservers
hbase-policy.xml
hbase-env.sh file
[hadoop @ hadoop01 conf] $ gedit hbase-env.sh
modified content:
Export the JAVA_HOME = / usr / Java / jdk1.8.0_11 /
Export HBASE_MANAGES_ZK = #flase to false indication independent zookeeper
hbase-site file:
[hadoop@hadoop01 conf]$ gedit hbase-site.xml 编辑内容: <configuration> <property> <name>hbase.master</name>#hbasemaster的主机和端口 <value>hadoop01:16010</value> </property> <property> <name>hbase.rootdir</name>#共享目录,持久化hbase数据
<value>hdfs://hadoop01:9000/hbase</value> </property> <property> <name>hbase.cluster.distributed</name>#是否分布式运行,false即为单机 <value>true</value> </property> <property> <name>hbase.zookeeper.quorum</name>#zookeeper地址
<value>hadoop01,hadoop02,hadoop03</value> </property> <property> <name>hbase.master.maxclockskew </ name >#时间同步允许的时间差
< value > 180000 </ value > </ Property >
<-! hbase.unsafe.stream.capability.enforce: local file system is set to false, indicating hdfs set to true.
However, according to the official manual of instructions HBase: HBase from 2.0.0 using the default start asyncfs. -> < Property > < name > hbase.unsafe.stream.capability.enforce </ name > < value > to false </ value >
</ Property > </ Configuration ><description> Controls whether HBase will check for stream capabilities (hflush/hsync). Disable this if you intend to run on LocalFileSystem, denoted by a rootdir with the 'file://' scheme, but be mindful of the NOTE below. WARNING: Setting this to false blinds you to potential data loss and inconsistent system state in the event of process and/or node failures. If HBase is complaining of an inability to use hsync or hflush it's most likely not a false positive. </description>
Note: Our test environment using a HBase 2.2.1, although so here is a clustered environment, but also directly set the parameter to false, then restart Hbase Master, back to normal. HBase or use a version less than 2.0.0, this error is also avoided
regionservers file :
[root @ hadoop01 conf] # gedit regionservers
edit content:
hadoop02
hadoop03
Configuration environment variable:
[hadoop@hadoop01 ~]$ gedit ~/.bash_profile
文本需要添加的内容:
#hbase
export HBASE_HOME=/home/hadoop/hbase-2.2.1
export PATH=$HBASE_HOME/bin:$PATH
export HADOOP_CLASSPATH=$HBASE_HOME/lib/*
[hadoop@hadoop01 ~]$ source ~/.bash_profile
Copy to other nodes:
[Hadoop hadoop01 @ ~] $ -R & lt hbase SCP-2.2.1 hadoop02: ~ /
[Hadoop hadoop01 @ ~] $ -R & lt hbase SCP-2.2.1 hadoop03: ~ /
Start Stop command hbase:
[Hadoop hadoop01 @ ~] ~ $ CD / HBase-2.2.1
[@ hadoop01 Hadoop HBase-2.2.1] $ bin / start-hbase.sh - start HBase
[@ Hadoop HBase-hadoop01 2.2.1] $ JPS - - show the process
16720 the ResourceManager
16866 the NodeManager
19427 QuorumPeerMain --zookeeper process
22387 Jps
16455 SecondaryNameNode
16075 the NameNode
22062 HMaster --hbase process
[hadoop @ hadoop01 hbase-2.2.1] $ bin / stop-hbase.sh
Note: Starting reported as abnormal
java.lang.IllegalStateException: The procedure WAL relies on the ability to hsync for proper operation during component failures, but the underlying filesystem does not support doing so. Please check the config value of 'hbase.procedure.store.wal.use.hsync' to set the desired level of robustness and ensure the config value of 'hbase.wal.dir' points to a FileSystem mount that can provide it.
hbase-site.xml configuration increases
<property>
<name>hbase.unsafe.stream.capability.enforce</name>
<value>false</value>
</property>
hbase Web version Net: http: //192.168.1.100: 16010 / master
-status Note: The interface changes later versions HBASE1.0 web client access to 16010, 192.168.1.100 for my linux port address
Start and test hbase:
[hadoop@hadoop01 hbase-2.2.1]$ jps --查看进程HMaster是否启动
11264 HMaster
11573 Jps
8566 DataNode
8426 NameNode
9642 QuorumPeerMain
8795 SecondaryNameNode
9053 ResourceManager
9197 NodeManager
[hadoop@hadoop01 hbase-2.2.1]$ hbase shell --进入shell模式
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/hadoop/hadoop-3.2.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hadoop/hbase-2.2.1/lib/client-facing-thirdparty/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
HBase Shell
Use "help" to get list of supported commands.
The Use "Exit" to quit the this Interactive shell.
The For Reference, Please from Visit: http://hbase.apache.org/2.0/book.html#shell
Version 2.2.1, rf93aaf770cce81caacbf22174dfee2860dbb4810, 2019 Nian 09 Yue 10 Tuesday, 14:28 : 27 CST
Took 0.0027 seconds The
HBase (main): 001: 0> Create 'test1', 'F11' - Create table test1
Created table test1
Took 2.8262 seconds The
=> :: Hbase the table - test1
HBase (main): 002: 0> List - - display table
TABLE
test1
. 1 Row (S)
Took 0.0274 seconds The
=> ["test1"]
HBase (main): 003: 0> PUT 'test1', 'ID001', 'F11: UID', '001' - to insert data
Took 0.2699 seconds
hbase (main): 004: 0 > scan 'test1' - View Data
ROW COLUMN the CELL +
ID001 column = F11: UID, timestamp = 1569686397247, value = 001
. 1 Row (S)
Took 0.0697 seconds The
HBase (main): 005: 0> DESCRIBE 'test1' - See table structure
Table test1 is ENABLED
test1
COLUMN FAMILIES DESCRIPTION
{NAME => 'f11', VERSIONS => '1', EVICT_BLOCKS_ON_CLOSE => 'false', NEW_VERSION_BEHAVIOR => 'false', KEEP_DELETED_CELLS => 'FALSE', CACHE_DATA_ON_WRITE => 'false', DATA_BLO
CK_ENCODING => 'NONE', TTL => 'FOREVER', MIN_VERSIONS => '0', REPLICATION_SCOPE => '0', BLOOMFILTER => 'ROW', CACHE_INDEX_ON_WRITE => 'false', IN_MEMORY => 'false', CACHE_
BLOOMS_ON_WRITE => 'false', PREFETCH_BLOCKS_ON_OPEN => 'false', COMPRESSION => 'NONE', BLOCKCACHE => 'true', BLOCKSIZE => '65536'}
1 row(s)
QUOTAS
0 row(s)
Took 0.Seconds The 1465
HBase (main): 006: 0> drop 'test1' - remove a table
ERROR:.. The Table test1 IS IT Enabled Disable First
the For the try Usage 'Help "drop"'
Took 0.0235 seconds The
NOTE: This deletes table fails, follow the prompts, and now the table status is valid and can not be deleted. Test1 table must first state failed to successfully remove.
HBase (main): 008: 0> disable 'test1'
Took 1.3230 seconds The
HBase (main): 009: 0> drop 'test1'
Took .9026 seconds The
HBase (main): 010: 0> List
TABLE
0 Row (S)
0.0111 seconds The Took
=> []
HBase (main): 011: 0> Exit - Exit shell mode
[hadoop @ hadoop01 hbase-2.2.1] $