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


       

             dfs.namenode.secondary.http-address

             hbase-master:9001

       

       

            dfs.namenode.name.dir

            file:/usr/hadoop/hadoop-2.7.7/dfs/name

       

       

            dfs.datanode.data.dir

            file:/usr/hadoop/hadoop-2.7.7/dfs/data

       

       

            dfs.replication

            2

       

       

            dfs.webhdfs.enabled

            true

       



 #  vi etc/hadoop/hdfs-site.xml

   

    

        fs.defaultFS

        hdfs://hbase-master:9000

    

    

        io.file.buffer.size

        131072

    

    

        hadoop.tmp.dir

        file:/usr/hadoop/hadoop-2.7.7/tmp

        Abase for other temporary   directories.

    



#  vi etc/hadoop/mapred-site.xml

                                                                            

        mapreduce.framework.name

                yarn

          

          

                  mapreduce.jobhistory.address

                  hbase-master:10020

          

          

                mapreduce.jobhistory.webapp.address

                hbase-master:19888

          




# 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


     


          


           hbase.rootdir


           hdfs://hbase-master:9000/hbase


         



         


           hbase.cluster.distributed


           true


         


         


           hbase.zookeeper.quorum


           hbase-master,hbase1,hbase2


         


         


           dfs.replication


           2


         

         

          hbase.master.info.port

          60010

        




# vi  conf/regionservers


hbase1

hbase2


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

在hbase-master jps查看应用进程



在hbase1,hbase2 jps查看进程





控制台界面

http://hbase-master:60010



祝君安装顺利!

你可能感兴趣的:(Hbase集群部署手册)