Personal homepage link: http://www.tongtongxue.com/archives/4669.html
software preparation
1、zookeeper-3.4.9.tar.gz
2、hbase-1.1.7-bin.tar.gz
Install Zookeeper
Since Hbase needs the collaborative management of zookpeeper, first install Zookeeper.
1. First download zookeeper from the Apache website;
2. Upload the zookeeper installation package to the linux server through the xshell tool, and then enter the decompression command:
tar -zxvf zookeeper-3.4.9.tar.gz
3. Enter the conf folder and create a new zoo.cfg configuration file, the configuration is as follows:
# The number of milliseconds of each tick tickTime=2000 # The number of ticks that the initial # synchronization phase can take initLimit = 10 # The number of ticks that can pass between # sending a request and getting an acknowledgement syncLimit=5 # the directory where the snapshot is stored. # do not use /tmp for storage, /tmp here is just # example sakes. dataDir=/opt/zookeeper/data # the port at which the clients will connect clientPort=2181 # the maximum number of client connections. # increase this if you need to handle more clients #maxClientCnxns=60 # # Be sure to read the maintenance section of the # administrator guide before turning on autopurge. # # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance # # The number of snapshots to retain in dataDir #autopurge.snapRetainCount=3 # Purge task interval in hours # Set to "0" to disable auto purge feature # autopurge.purgeInterval = 1
4. Configure environment variables
Open the configuration environment variables file
vi /etc/profile
Configure the following information
export ZOOKEEPER_HOME=/opt/zookeeper export PATH=$JAVA_HOME/bin:$HADOOP_HOME/bin:$ZOOKEEPER_HOME/bin:$PATH
5. Start Zookeeper
Before starting zookeeper, you can start up the hdfs environment of hadoop first, that is
sbin/start-dfs.sh
Then start zookeeper
zkServer.sh start
Install Hbase
1. Download hbase from the Apache website;
2. Upload the file to the linux server and unzip the file
tar -zxvf hbase-1.1.7-bin.tar.gz
3. Configure environment variables
export HBASE_HOME=/opt/hbase export PATH=$JAVA_HOME/bin:$HADOOP_HOME/bin:$ZOOKEEPER_HOME/bin:$HBASE_HOME/bin:$PATH
4. Edit hbase-env.sh
In the conf folder, find hbase-env.sh and modify it as follows:
# The java implementation to use. Java 1.7+ required. export JAVA_HOME=/opt/jdk1.7.0_67 # Extra Java CLASSPATH elements. Optional. export HBASE_CLASSPATH=/opt/hadoop/etc/hadoop # Tell HBase whether it should manage it's own instance of Zookeeper or not. export HBASE_MANAGES_ZK=true
5. Edit hbase-site.xml
In the conf folder, find the hbase-site.xml file and configure it as:
<configuration> <property> <name>hbase.rootdir</name> <value>hdfs://yunpan:9000/hbase</value> </property> <property> <name>hbase.zookeeper.quorum</name> <value>yunpan</value> </property> <property> <name>hbase.cluster.distributed</name> <value>true</value> </property> </configuration>
6. Start Hbase
start-hbase.sh
Pay attention to WeChat public account