[HBase-1] HBase installation configuration, using stand-alone zookeeper
1.HBase installation configuration, using stand-alone zookeeper
two。 Modify the environment variable:
The first machine is planned to be master, the second machine is RegionServer, and then start RegionServer on the first machine
Make a cluster
1 master
2 RegionServer
Execute on the machine: vi / etc/profile, and add the following:
Export HBASE_HOME=/usr/local/src/hbase
Export PATH=$PATH:$HBASE_HOME/bin
3. Modify the configuration file:
The time difference between the host and port hbase.masterhostip2:60000# time synchronization of vi / hbase/conf/hbase-site.xml # hbasemaster allows the hbase.master.maxclockskew 18000 shared directory to persist the hbase data # hdfs://hostip2:9000 to the already built hdfshbase.rootdirhdfs://hostip2:9000/hbase # whether to run distributed or not, false is the location of the snapshot of the stand-alone hbase.cluster.distributedtrue#zookeeper address hbase.zookeeper.quorumhostip3,hostip5#zookeeper configuration information, and the file where the zookeeper keeps the information The default is / tmp restart will lose hbase.zookeeper.property.dataDir/home/hadoop/hbase/tmp/zookeeper # 2181 clientPorthbase.zookeeper.property.clientPort 2181 with zookeeper
Vi / hbase/conf/hbase-env.sh
Export JAVA_HOME=/usr/java/jdk1.7.0_45 / / jdk installation directory export HBASE_CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar / / hadoop configuration file location export HBASE_MANAGES_ZK=false # if you use a standalone installation of zookeeper, this place is false, and the built-in setting is true
Vi / conf/regionservers
Hostip3hostip5
4 、. Put the hdfs-site.xml and core-site.xml of Hadoop under hbase/conf:
Hdfs-site.xml:
Dfs.replication 2
Core-site.xml:
Fs.defaultFS hdfs://hostip2:9000 hadoop.tmp.dir / usr/local/src/hadoop-2.6.4/hdpdata
5. Send the hbase directory to other machines and start master and regionserver respectively
. / hbase-daemon.sh start master./hbase-daemon.sh start regionserver
6. Web page view: http://hostip2:16010/
Process View jps
3201 Main9092 HRegionServer29125 HMaster13240 Jps16012 DataNode12766 ZooKeeperMain
7. Zookeeper view
. / zkCli.sh connection
[zk: localhost:2181 (CONNECTED) 1] ls / [zookeeper, hbase] [zk: localhost:2181 (CONNECTED) 2] ls / hbase [replication, meta-region-server, rs, splitWAL, backup-masters, table-lock, flush-table-proc, region-in-transition, online-snapshot, master, running, recovering-regions, draining, namespace, hbaseid, table] [zk: localhost:2181 (CONNECTED) 5] ls / hbase/rs [host1,16020,1543922854774, host2,16201,1543834531685]
8. Extension 1
If you want to start a double master,hbase-daemon.sh start master, you can't get up, because hbase-site.xml wrote
# Host and port hbase.masterIP1:60000 of hbasemaster
Need to use / hbase/bin >. / local-master-backup.sh start 2
Zk View
[zk: localhost:2181 (CONNECTED) 26] ls / hbase/backup-masters [host1,1543924655750]