Hadoop-HBase 单机部署

一、系统版本

        Linux系统 wdOS-1.0-x86_64.iso

       关于wdOS说明

       1 安装简单,快速,去掉了安装过程中不必要的烦锁操作和不必要的选择
       2 可选安装集成web环境,如lamp,lnmp,lnamp,并可相互自由切换使用
       3 可选安装集成wdcp管理系统,可方便管理服务器和站点,数据库,FTP等
       4 小巧,整个ISO文件就600M左右,快载快速,也可方便刻录光盘
       5 安全,稳定,高效。

       安装系统时,请选择选项【3】。装个纯净版的就好。

二、 测试环境安装

       软件版本

       hadoop-2.4.1.tar.gz  jdk-7u65-linux-i586.tar.gz   hbase-0.96.2-hadoop2-bin.tar.gz

       1、 系统环境准备

              修改linux的主机名hostname

                     #vim /etc/sysconfig/network

                     如:hostname=master

              设置IP地址与主机名称映射关系

                    #vim/etc/hosts

                     如:192.168.2.135master

                    如有必要,可创建hadoop用户或者hbase用户

                        #groupadd hadoop

                        #useradd –g hadoop hadoop

                        #passwd hadoop

                 输入新密码

             免密登录

                      #ssh-keygen–t rsa

                     #cpid_rsa.pub authorized_keys

                     #chmod600 authorized_keys

       2、 安装jdk

              #tar –zxvf jdk-7u65-linux-i586.tar.gz

              #mv jdk1.7_6_05 jdk1.7

              #vim /etc/profile

              export  JAVA_HOME=/usr/local/chit/jdk1.7

              export  CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib

              export  PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH

       3、 安装hadoop

              #tar –zxvf hadoop-2.4.1.tar.gz

              配置hadoop环境变量

              export   JAVA_HOME=/usr/local/chit/jdk1.7

              export   HADOOP_HOME=/usr/local/chit/hadoop-2.4.1

              export   CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib

              export   PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$PATH

              配置文件

              hadoop-env.sh

              设置正确的java_home

              配置文件core-site.xml

[html]  view plain  copy
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>  
  3. <!--  
  4.   Licensed under the Apache License, Version 2.0 (the "License");  
  5.   you may not use this file except in compliance with the License.  
  6.   You may obtain a copy of the License at  
  7.   
  8.     http://www.apache.org/licenses/LICENSE-2.0  
  9.   
  10.   Unless required by applicable law or agreed to in writing, software  
  11.   distributed under the License is distributed on an "AS IS" BASIS,  
  12.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
  13.   See the License for the specific language governing permissions and  
  14.   limitations under the License. See accompanying LICENSE file.  
  15. -->  
  16.   
  17. <!-- Put site-specific property overrides in this file. -->  
  18.   
  19. <configuration>  
  20.         <property>  
  21.                 <name>fs.default.name</name>  
  22.                 <value>hdfs://master:9000</value>  
  23.         </property>  
  24.         <property>  
  25.                 <name>hadoop.tmp.dir</name>  
  26.                 <value>/home/hadoop/data/tmp</value>  
  27.         </property>  
  28.         <property>  
  29.                 <name>dfs.data.dir</name>  
  30.                 <value>/home/hadoop/data/hdfsdata</value>  
  31.         </property>  
  32. </configuration>               

             格式化文件

             进入hadoop的bin目录下

             #hadoop namenode –format

             启动hdfs

             进入hadoop的sbin目录下

             #start-dfs.sh

             测试是否成功

             #jps

             查看进程

             Namenode

             Secondnamenode

             datanode

             浏览器地址访问http://ip:50070

       4、 安装HBase

             #tar –zxvf hbase-0.96.2-hadoop2-bin.tar.gz

             修改配置文件hbase-env.sh

             JAVA_HOME=……

             export HBASE_MANAGES_ZK=true

             修改配置文件hbase-site.xml

[html]  view plain  copy
  1. <configuration>  
  2.         <property>  
  3.                 <name>hbase.rootdir</name>  
  4.                 <value>hdfs://master:9000/hbase</value>  
  5.         </property>  
  6.         <property>  
  7.                 <name>hbase.master</name>  
  8.                 <value>hdfs://master:6000</value>  
  9.         </property>  
  10.         <property>  
  11.                 <name>hbase.zookeeper.property.dataDir</name>  
  12.                 <value>/home/hadoop/data/zookeeper</value>  
  13.         </property>  
  14.         <property>  
  15.                 <name>hbase.cluster.distributed</name>  
  16.                 <value>true</value>  
  17.         </property>  
  18.         <property>  
  19.                 <name>hbase.zookeeper.quorum</name>  
  20.                 <value>192.168.2.135</value>  
  21.         </property>  
  22. </configuration>  

            启动hbase了

            进入hbase的bin目录下,执行start-hbase.sh

            验证是否成功

            #jps

            HRegionServer HMaster  HQuorumPeer

            浏览器地址验证http://ip:60010

 



http://blog.csdn.net/sun_aichao/article/details/50282441

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值