1). Upload, unzip, rename, modify environment variables/etc/profile
2). Modify the Hbase-env.sh file
// Java Installation Path // hbase classpath export hbase_manages_zk=true// by HBase itself responsible for starting and shutting down Zookeeper
3). Edit the Hbase-site.xml file
< Property> <name>Hbase.rootdir</name>HDFs root path for data storage in//hbase<value>Hdfs://hadoop01:9000/hbase</value></ Property>< Property> <name>hbase.cluster.distributed</name>whether the//hbase is installed in a distributed environment<value>True</value></ Property>< Property>//Specify the ZK node location for HBase, because the above specified HBase manages ZK itself<name>Hbase.zookeeper.quorum</name> <value>Hadoop01</value></ Property>< Property> <name>Dfs.replication</name>//pseudo-distributed environment with a replica number of 1<value>1</value></ Property>
4). ( optional ) file Regionservers
//This file specifies the regionservers, where the child node is located hadoop01 (that is, the native hostname or IP)
5). Start HBase
Before starting HBase, make sure that Hadoop is healthy and can write to the file *******
startup script : start-hbase.sh?
authentication Method : (1) Execute JPS, discover new 3 Java process, namely Hmaster, Hregionserver, Hquorumpeer
(2) using a browser to access http://hadoop01:60010
6). Shell operation
Command:hbase Shell enters the terminal of the shell operation.
For an issue where the DELETE key cannot be used in a shell terminal using SECURECRT: In SecureCRT, click "Options" "Session Options" "Terminal" "emulation", the right terminal chooses Linux, in the HBase shell as input error, press CTRL + DELETE key Can be deleted!
7). Basic operation
Creating a table create
-- " Note that there is no end;" "The Row Key is natural and does not have to be specified manually" --Create ' table name ', ' column family 1 ', ' column family 2 ', ' column family n '
Create ' Users ','user_id','address',' Info'
View table information Describe
List ---See how many tables Describe ' users '-- See the information on the users table, this ugly
Delete Table drop
Drop -- Delete a table
Insert Data Put
-Put ' table name ', ' Row key ', ' column family: Column ', ' column value '
Put'Users','xiaoming','User_id:id','007' --BULK INSERT, each line ends with wood;Put'Users','xiaoming','Info:age',' -'put'Users','xiaoming','Info:birthday','1987-06-17'put'Users','xiaoming','Info:company','Alibaba'put'Users','xiaoming','Address:contry',' China'put'Users','xiaoming','address:province','Zhejiang'put'Users','xiaoming','address:city','Hangzhou'put'Users','Zhangyifei','Info:birthday','1987-4-17'put'Users','Zhangyifei','Info:favorite','movie'put'Users','Zhangyifei','Info:company','Alibaba'put'Users','Zhangyifei','Address:contry',' China'put'Users','Zhangyifei','address:province','Guangdong'put'Users','Zhangyifei','address:city','Jieyang'put'Users','Zhangyifei','Address:town','Xianqiao'
Querying all data in a RowKey
Getting Started with HBase