-
进入/usr
cd /usr -
解压hbase
tar -xzvf hbase-1.3.1-bin.tar.gz -
删除包
rm -rf hbase-1.3.1-bin.tar.gz -
修改文件名
mv hbase-1.3.1/ hbase -
修改profile
vi /etc/profile -
添加如下代码
export ZK_HOME=/usr/zookeeper
export HBASE_HOME=/usr/hbase
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$HADOOP_HOME/bin:${HBASE_HOME}:${ZK_HOME}/bin:$PATH
-
执行生效
source /etc/profile -
进入hbase cd /usr/hbase修改hbase-env.sh文件
vi conf/hbase-env.sh -
添加如下代码
export JAVA_HOME=/usr/java/jdk1.8.0_131
export HADOOP_HOME=/usr/hadoop
export HBASE_HOME=/usr/hbase
export HBASE_CLASSPATH=/usr/hadoop/etc/hadoop
export HBASE_PID_DIR=/usr/hbase/pids
export HBASE_MANAGES_ZK=false
-
修改配置文件hbase-site.xml
vi conf/hbase-site.xml -
添加如下代码
<configuration>
<!– Site specific YARN configuration properties –>
<property>
<name>hbase.rootdir</name>
<value>hdfs://centos201:9000/hbase</value>
<description>The directory shared byregion servers.</description>
</property>
<property>
<name>hbase.master</name>
<value>centos201</value>
</property>
<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>2181</value>
<description>Property from ZooKeeper’sconfig zoo.cfg. The port at which the clients will connect.
</description>
</property>
<property>
<name>zookeeper.session.timeout</name>
<value>120000</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>centos201,centos202,centos203</value>
</property>
<property>
<name>hbase.tmp.dir</name>
<value>/usr/hbase/tmp</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
</configuration> -
创建tmp
mkdir tmp mkdir pids -
修改regionservers文件
vi conf/regionservers -
添加如下代码
centos201
centos202
centos203 -
授权
chown -R wuyang:wuyang /usr/hbase/ -
切换用户
su wuyang -
启动
首先要启动hdfs和zookeeperbin/start-hbase.sh
-
查看
bin/hbase shell
- 测试
status - 退出
exit
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/9076.html