hadoop-2.2.0+zookeeper-3.4.5+hbase-0.96.1单机安装指南

一 配置hadoop-2.2.0

  1.配置hadoop-2.2.0/etc/hadoop/hadoop-env.sh文件,添加如下配置:

     export JAVA_HOME=/home/username/jdk1.7.0_40

 2.在配置文件hadoop-2.2.0/etc/hadoop/core-site.xml中添加如下配置:

        <property>
    <name>fs.defaultFS</name>
        <value>hdfs://localhost:9000</value>
     </property>

 3.在配置文件hadoop-2.2.0/etc/hadoop/hdfs-site.xml中添加如下配置:

<property>
<name>dfs.namenode.name.dir </name>
<value>/usr/local/hadoop2/datalog1,/usr/local/hadoop2/datalog2</value>
</property>
<property>
<name>dfs.datanode.data.dir </name>
<value>/usr/local/hadoop2/data1,/usr/local/hadoop2/data2</value>
</property>
<property>
<name>dfs.replication</name>
<value>2</value>
</property>
<property>
<name>dfs:permissions</name>
<value>false</value>
</property>
<property>
<name>dfs.support.append</name>
<value>true</value>
</property> 

4.在启动hadoop之前,进入hadoop-2.2.0/bin目录,执行./hdfs namenode -format;

5.进入hadoop-2.2.0/sbin目录下,执行./start-all.sh,启动hadoop;

5.执行jps,查看启动的模块;

6.执行./stop-all.sh,停止hadoop;

7.通过http://localhost:50070在web页面查看HDFS;

二 配置zookeeper-3.4.5

 1.将原始文件zoo-sample.cfg更名为zoo.cfg,并修改里面的端口号:clientPort=2181

2.进入zookeeper-3.4.5/bin目录执行 ./zkServer.sh start,启动zookeeper;

3.执行./zkServer.sh stop,停止zookeeper;

三配置hbase-0.96.1

1.在apache官网下载hbase-0.96.1.-hadoop2包;

2.在配置文件hbase-0.96.1-hadoop2/conf/hbase-env.sh中添加如下配置:

export JAVA_HOME=/home/username/jdk1.7.0_40
export HBASE_HOME=/home/username/hbase-0.96.1/hbase-0.96.1-hadoop2
export PATH=$PATH:/home/username/hbase-0.96.1/hbase-0.96.1-hadoop2/bin
export HBASE_MANAGES_ZK=false  //false表示不使用hbase自带的zookeeper,true表示使用自带的zookeeper;

3.在hbase-0.96.1-hadoop2/conf/hbase-site.xml中添加如下配置:

<property>
<name>hbase.rootdir</name>
<value>hdfs://localhost:9000/hbase</value>
<description>The directory shared by region servers.
Should be fully-qualified to include the filesystem to use.
E.g: hdfs://NAMENODE_SERVER:PORT/HBASE_ROOTDIR
</description>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.master</name>
<value>localhost:60000</value>
<description>The host and port that the HBase master runs at.
</description>
</property>

4.启动hbase,进入hbase-0.96.1-hadoop2/bin目录,执行 ./start-hbase.sh 

5.执行jps,有如下模块启动

 NameNode
 DataNode
 SecondaryNameNode
 HRegionServer
 ResourceManager
 NodeManager
 QuorumPeerMain
 HMaster
6.访问http://localhost:60010/master-status,可以通过web页面查看hbase;


四 总结

   HBase和Hadoop版本不兼容,这个是最隐蔽的错误,会出现各自莫名的错误,因此在部署Hbase时,要考虑兼容性。HBase和Hadoop的兼容情况参见下面:
hadoop-2.2.0+zookeeper-3.4.5+hbase-0.96.1单机安装指南_第1张图片


在部署过程中遇到的兼容性的问题可以参考此文章,http://hi.baidu.com/macrohuang/item/0c4b6b4c1a929416886d103b

你可能感兴趣的:(hadoop,zookeeper,hbase)