HBase1.1.x is deployed on Hadoop 2.6.0 (partial distribution of three vm virtual machines)
download
Configure environment variable / etc/profile
#hbase export HBASE_HOME=/usr/local/soft/hbase-1.1.5 export PATH=$PATH:$HBASE_HOME/bin
Configure $HBase? Home / conf / hbase-env.sh
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 export HBASE_MANAGES_ZK=true
Configure $HBase? Home / conf / hbase-site.xml
<configuration> <property> <name> hbase.rootdir </name> <value>hdfs://192.168.0.11:9000/hbase</value> < description > hbase.rootdir is the shared directory of RegionServer, which is used to store HBase data persistently and is written to / tmp by default. If this configuration is not modified, the data will be lost when HBase is restarted. Generally, the file directory of HDFS is set here. For example, if NameNode runs on port 9090 of the namenode.Example.org host, it needs to be set to hdfs://namenode.example.org:9000/hbase </description> </property> <property> <name>hbase.cluster.distributed</name> <value>true</value> < description > this item is used to configure the deployment mode of HBase. false indicates stand-alone or pseudo distributed mode. true indicates incomplete distributed mode. </description> </property> </configuration>
Configure $HBase? Home / conf / regionservers
Delete the original only localhost
192.168.0.11
192.168.0.12
192.168.0.13
Copy hdfs-site.xml and core-site.xml of hadoop and put them under $HBASE_HOME/conf
cp /usr/local/soft/hadoop-2.6.0/etc/hadoop/hdfs-site.xml /usr/local/soft/hbase-1.1.5/conf cp /usr/local/soft/hadoop-2.6.0/etc/hadoop/core-site.xml /usr/local/soft/hbase-1.1.5/conf
Copy hbase to other nodes
# scp /etc/profile root@192.168.0.12:/etc/profile will not be overwritten scp /etc/profile root@192.168.0.12:/etc/ # scp /etc/profile root@192.168.0.13:/etc/profile will not be overwritten scp /etc/profile root@192.168.0.13:/etc/ scp -r /usr/local/soft/hbase-1.1.5 root@192.168.0.12:/usr/local/soft/ scp -r /usr/local/soft/hbase-1.1.5 root@192.168.0.13:/usr/local/soft/
Resolve startup warnings encountered by JDK8
If you use jdk8 or above, you will have the following warnings
Java HotSpotâ„¢ 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
Java HotSpotâ„¢ 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
Solution: all nodes vi /home/hadoop/app/hbase/conf/hbase-env.sh comment out the following lines (add the first line of the following lines)
# Configure PermSize. Only needed in JDK7. You can safely remove it for JDK8+ export HBASE_MASTER_OPTS="$HBASE_MASTER_OPTS -XX:PermSize=128m -XX:MaxPermSize=128m -XX:ReservedCodeCacheSize=256m" export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -XX:PermSize=128m -XX:MaxPermSize=128m -XX:ReservedCodeCacheSize=256m"
start-up
# Master node [root@master conf]# start-hbase.sh localhost: starting zookeeper, logging to /usr/local/soft/hbase-1.1.5/bin/../logs/hbase-root-zookeeper-master.out starting master, logging to /usr/local/soft/hbase-1.1.5/bin/../logs/hbase-root-master-master.out 192.168.0.13: starting regionserver, logging to /usr/local/soft/hbase-1.1.5/bin/../logs/hbase-root-regionserver-node2.out 192.168.0.12: starting regionserver, logging to /usr/local/soft/hbase-1.1.5/bin/../logs/hbase-root-regionserver-node1.out 192.168.0.11: starting regionserver, logging to /usr/local/soft/hbase-1.1.5/bin/../logs/hbase-root-regionserver-master.out [root@master conf]# jps 74322 HQuorumPeer 74388 HMaster 74518 HRegionServer 2903 ResourceManager 60745 Worker 2586 NameNode 2762 SecondaryNameNode 74797 Jps 61117 SparkSubmit 60653 Master # Each slave node [root@node1 conf]# jps 79111 DataNode 111161 Jps 79209 NodeManager 111116 HRegionServer 104094 Worker
Verification
[root@master conf]# hbase shell SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/usr/local/soft/hbase-1.1.5/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/local/soft/hadoop-2.6.0/share/hadoop/common/lib/slf4j-log4j12-1.7.5.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] 2019-12-05 01:53:56,821 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable HBase Shell; enter 'help<RETURN>' for list of supported commands. Type "exit<RETURN>" to leave the HBase Shell Version 1.1.5, r239b80456118175b340b2e562a5568b5c744252e, Sun May 8 20:29:26 PDT 2016 hbase(main):001:0>
You can use Ctrl+C to exit
Stop it
If there are more than one node, you can also start from HMaster on some other nodes
Start from HMaster
bin/hbase-daemon.sh start master
Note: if you need to start a region server separately, use similar commands
bin/hbase-daemon.sh start regionserver
If started from HMaster
Stop hbase stop HMaster on other nodes first
At the corresponding node bin / hbase-day.sh stop master
And then stop the rest
bin/start-hbase.sh
# Master node [root@master conf]# stop-hbase.sh stopping hbase.................... localhost: stopping zookeeper. [root@master conf]# jps 2903 ResourceManager 60745 Worker 75288 Jps 2586 NameNode 2762 SecondaryNameNode 61117 SparkSubmit 60653 Master # Other slave nodes [root@node1 conf]# jps 79111 DataNode 79209 NodeManager 111290 Jps 104094 Worker
Reference instructions (can be skipped)
Reference resources Teacher Ziyu's lab course
Configure Java? Home, HBase? Classpath, HBase? Management? ZK
HBase? Classpath is set to the conf directory under the local Hadoop installation directory (i.e. / usr/local/hadoop/conf) --- there is no configuration here for the time being, because Hadoop 2.6.0 does not have this directory, and others 2.6.0 does not configure this directory
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 export HBASE_CLASSPATH=/usr/local/hadoop/conf export HBASE_MANAGES_ZK=true
Teacher Ziyu's lab course is a stand-alone version No child nodes are configured
So I went to other tutorials
http://c.biancheng.net/view/6515.html
https://www.cnblogs.com/leffss/p/9184171.html