Hbase集群部署手册

环境准备

3台Linux Centos7 机器

  192.168.0.176    hbase-master

192.168.0.220    hbase1

192.168.0.105    hbase2

部署步骤

[if !supportLists]1、 [endif]JDK安装及环境变量

Jdk版本: 1.8

解压tar  -zxvf jdk-version.gz.tar

环境变量设置:

      vi /etc/profile

export JAVA_HOME=/usr/jdk/jdk1.8.0_181

export PATH=$JAVA_HOME/bin:$PATH

export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

[if !supportLists]2、 [endif]Hosts修改

      vi /etc/hosts

      192.168.0.176    hbase-master

192.168.0.220    hbase1

192.168.0.105    hbase2

[if !supportLists]3、 [endif] Zokeeper安装,集群

版本: 3.4.10

解压

# tar -zxvf zokeeper-version.gz.tar

修改zoo.cfg增加集群配置

server.0=hbase-master:2888:3888

server.1=hbase1:2888:3888

server.2=hbase2:2888:3888

修改data/myid

hbase-master对应写入 0   

hbase1写入 1  

hbase2写入 2

分别启动

./zkServer.sh start

[if !supportLists]4、 [endif] SSH免秘钥

先在hbase-master上做ssh 免密钥

     yum install open-ssh*

     ssh-keygen -t rsa -P “”

     cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys 

     service sshd restart

ssh localhost测试验证

Copy秘钥

ssh-copy-id  hbase1拷贝秘钥到hbase1

ssh-copy-id  hbase2拷贝秘钥到hbase2   

同理在hbase1 , hbase2上操作同样的步骤

[if !supportLists]5、 [endif] Hadoop安装及配置

版本:hadoop-2.7.7

解压hadoop-2.7.7压缩包

环境变量

export HADOOP_HOME=/usr/hadoop/hadoop-2.7.7

export PATH=$HADOOP_HOME/bin:$PATH

修改配置文件

      cd  /usr/hadoop/hadoop-2.7.7

# vi etc/hadoop/hadoop-env.sh

修改JAVA_HOME

 export JAVA_HOME=/usr/jdk/jdk1.8.0_181

      #  vi  etc/hadoop/hdfs-site.xml

<configuration>

       <property>

             <name>dfs.namenode.secondary.http-address</name>

             <value>hbase-master:9001</value>

       </property>

       <property>

            <name>dfs.namenode.name.dir</name>

            <value>file:/usr/hadoop/hadoop-2.7.7/dfs/name</value>

       </property>

       <property>

            <name>dfs.datanode.data.dir</name>

            <value>file:/usr/hadoop/hadoop-2.7.7/dfs/data</value>

       </property>

       <property>

            <name>dfs.replication</name>

            <value>2</value>

       </property>

       <property>

            <name>dfs.webhdfs.enabled</name>

            <value>true</value>

       </property>

</configuration>

 #  vi etc/hadoop/hdfs-site.xml

   <configuration>

    <property>

        <name>fs.defaultFS</name>

        <value>hdfs://hbase-master:9000</value>

    </property>

    <property>

        <name>io.file.buffer.size</name>

        <value>131072</value>

    </property>

    <property>

        <name>hadoop.tmp.dir</name>

        <value>file:/usr/hadoop/hadoop-2.7.7/tmp</value>

        <description>Abase for other temporary   directories.</description>

    </property>

</configuration>

#  vi etc/hadoop/mapred-site.xml

<configuration>

          <property>                                                                  

        mapreduce.framework.name

                <value>yarn</value>

          </property>

          <property>

                  <name>mapreduce.jobhistory.address</name>

                  <value>hbase-master:10020</value>

          </property>

          <property>

                <name>mapreduce.jobhistory.webapp.address</name>

                <value>hbase-master:19888</value>

          </property>

</configuration>

# vi  etc/hadoop/slaves

  hbase1

hbase2

同步配置信息到hbase1, hbase2节点

hbase-master启动   sbin/start-dfs.sh

jps查看hbase-master进程

jps查看hbase1,hbase2进程

控制台界面

http://hbase-master:50070/

[if !supportLists]6、 [endif]Hbase安装及配置

版本:hbase-2.1.0

解压habse压缩包

环境变量配置

export HBASE_HOME=/usr/hbase/hbase-2.1.0

export PATH=$HBASE_HOME/bin:$PATH

修改配置文件

     # vi conf/hbase-env.sh

      export JAVA_HOME=/usr/jdk/jdk1.8.0_181

export HBASE_MANAGES_ZK=false

     # vi conf/hbase-site.xml

     <configuration>

          <property>

           <name>hbase.rootdir</name>

           <value>hdfs://hbase-master:9000/hbase</value>

         </property>

         <property>

           <name>hbase.cluster.distributed</name>

           <value>true</value>

         </property>

         <property>

           <name>hbase.zookeeper.quorum</name>

           <value>hbase-master,hbase1,hbase2</value>

         </property>

         <property>

           <name>dfs.replication</name>

           <value>2</value>

         </property>

         <property>

          <name>hbase.master.info.port</name>

          <value>60010</value>

        </property>

</configuration>

# vi  conf/regionservers

hbase1

hbase2

在hbase-master上启动  bin/start-hbase.sh

在hbase-master jps查看应用进程

在hbase1,hbase2 jps查看进程

控制台界面

http://hbase-master:60010

祝君安装顺利!

    原文作者:Kafka_6392
    原文地址: https://www.jianshu.com/p/43929afaa9aa
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞