hbase系统搭建

hbase系统搭建

2012-07-25 12:25 by zhenjing, 1168 阅读, 0 评论, 收藏, 编辑

相关软件版本:

jdk-6u32-linux-x64.bin

tar xzvf hadoop-1.0.2.tar.gz

tar xzvf hbase-0.92.1-security.tar.gz

jdk-6u32-linux-x64.bin

注:目前已经有更高版本

0. 设置集群机器的hostname;

1. 建立hadoop用户,如hadoop;

2. 配置ssh(简单办法:先在单机上生成ssh key pair文件,将授权文件拷贝到相应的机器上)

3. 安装java、hadoop、hbase。

4. 配置hadoop:core-site.xml 、core-site.xml 、mapred-site.xml 、taskcontroller.cfg、master、slavers、hadoop-env.sh、/etc/hosts、

环境变量(/etc/profile): 

# hadoop env
export JAVA_HOME=/usr/share/java
export JRE_HOME=$JAVA_HOME/jre
export HADOOP_CONF=/home/oicq/hadoop/conf

HADOOP_HOME=/home/oicq/hadoop/hadoop
enxport PATH=$PATH:/usr/share/java/bin:/home/oicq/hadoop/hadoop/bin:/home/oicq/hadoop/hbase/bin

5. 安装snappy:

复制代码
#! /bin/bash

tar xzvf snappy-1.0.5.tar.gz

cd snappy-1.0.5

./configure

make

make install

cp .libs/libsnappy.*  ../hadoop/lib/native/Linux-amd64-64/
复制代码

6. 编译本地库(因原始安装包不支持suse,才需要)

切换到./hadoop/src/native目录, 执行下面脚本:

复制代码
#! /bin/bash

export JAVA_HOME=/usr/share/java

export HADOOP_NATIVE_SRCDIR=/home/oicq/hadoop/hadoop/src/native

export JVM_DATA_MODEL=64

export OS_NAME=Linux

export OS_ARCH=amd64

chmod 755 configure

./configure  CFLAGS="-DHADOOP_SNAPPY_LIBRARY"

touch src/org/apache/hadoop/io/compress/snappy/org_apache_hadoop_io_compress_snappy_SnappyCompressor.h

touch src/org/apache/hadoop/io/compress/snappy/org_apache_hadoop_io_compress_snappy_SnappyDecompressor.h

touch src/org/apache/hadoop/io/compress/zlib/org_apache_hadoop_io_compress_zlib_ZlibCompressor.h

touch src/org/apache/hadoop/io/compress/zlib/org_apache_hadoop_io_compress_zlib_ZlibDecompressor.h

touch src/org/apache/hadoop/security/org_apache_hadoop_security_JniBasedUnixGroupsMapping.h

touch src/org/apache/hadoop/security/org_apache_hadoop_security_JniBasedUnixGroupsNetgroupMapping.h

touch src/org/apache/hadoop/security/org_apache_hadoop_io_nativeio_NativeIO.h

make clean

make

cp ./.libs/libhadoop.*  http://www.cnblogs.com/lib/native/Linux-amd64-64/
复制代码

注:hadoop从0.92开始已包含snappy的集成接口,但默认编译本地库时并不打开,需要明确指定才行。

./configure  CFLAGS="-DHADOOP_SNAPPY_LIBRARY" 至关重要。

7.配置hbase:hbase-env.sh、hbase-site.xml、regionservers;

8. (可选)启用hadoop-metrics.properties、hadoop-metrics.properties

 

上述步骤是在1)无法在线安装;2)非hadoop支持系统; 情况下采用的本地编译安装方式。

posted @ 2012-11-21 21:52  蜗牛123  阅读(249)  评论(0编辑  收藏  举报