您的位置:首页 > 其它

利用yum升级cdh hbase0.90至0.94(即chd3-》cdh4)

2013-12-13 16:51 447 查看

一. 集群布局

haoop06 thrift server、hbase master、zookeeper server

hadoop01~04 thrift server、hbase regionserver、zookeeper

hadoop07、hadoop08 thrift server、hbase regionserver、zookeeper

二. 编辑repository文件

# vi /etc/yum.repos.d/cloudera-cdh4.repo

[cloudera-cdh4]

name=Cloudera's Distribution for Hadoop, Version 4

baseurl=http://archive.cloudera.com/cdh4/redhat/5/x86_64/cdh/4/

gpgkey = http://archive.cloudera.com/cdh4/redhat/5/x86_64/cdh/RPM-GPG-KEY-cloudera
gpgcheck = 1

或到以下网址去下载所需的repo文件

http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH4/latest/CDH-Version-and-Packaging-Information/cdhvd_topic_2.html

三. 关闭并删除已有hbase

1. 停止thrift server和clients,停止集群

# service hadoop-hbase-thrift stop

# service hadoop-hbase-master stop

# service hadoop-hbase-regionserver stop

2. 停止zookeeper server

# service hadoop-zookeeper-server stop

3. 将zookeeper从cdh3升级至cdh4

(1)删除zookeeper

# service hadoop-zookeeper-server stop (hadoop06 only)

# yum remove hadoop-zookeeper-server (hadoop06 only)

# yum remove hadoop-zookeeper

(2)安装zookeeper基础包

# yum install zookeeper

(3)安装zookeeper server

# yum install zookeeper-server (hadoop06 only)

(4)编辑/etc/zookeeper/conf/zoo.cfg文件

# vi /etc/zookeeper/conf/zoo.cfg

# The number of milliseconds of each tick

tickTime=2000

# The number of ticks that the initial

# synchronization phase can take

initLimit=10

# The number of ticks that can pass between

# sending a request and getting an acknowledgement

syncLimit=5

# the directory where the snapshot is stored.

dataDir=/var/zookeeper

# the port at which the clients will connect

clientPort=2181

server.0=hadoop06.ihep.ac.cn:2888:3888

(5)启动zookeeper server

四. 安装cdh4版本的hbase

1. 安装hbase

# yum install hbase

2. 安装master (hadoop06 only)

# yum install hbase-master

3. 安装regionserver (except hadoop06)

# yum install hbase-regionserver

4. 安装thriftserver

# yum install hbase-thrift

5. 安装hbase-rest

# yum install hbase-rest

6. 配置hbase-site.xml文件 (cdh4的该文件位于/etc/hbase/conf.dist/目录下,将该目录下的文件拷贝到/etc/hbase/conf下)

# vi /etc/hbase/conf/hbase-site.xml

<configuration>

<property>

<name>hbase.rootdir</name>

<value>hdfs://hadoop06.ihep.ac.cn:8008/hbase</value>

<description>The directory shared by region servers and into

which HBase persists. The URL should be 'fully-qualified'

to include the filesystem scheme. For example, to specify the

HDFS directory '/hbase' where the HDFS instance's namenode is

running at namenode.example.org on port 9000, set this value to:

hdfs://namenode.example.org:9000/hbase. By default HBase writes

into /tmp. Change this configuration else all data will be lost

on machine restart.

</description>

</property>

<property>

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

<value>60000</value>

<description>The port the HBase Master should bind to.</description>

</property>

<property>

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

<value>true</value>

<description>The mode the cluster will be in. Possible values are

false for standalone mode and true for distributed mode. If

false, startup will run all HBase and ZooKeeper daemons together

in the one JVM.

</description>

</property>

<property>

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

<value>hadoop06.ihep.ac.cn</value>

<description>Comma separated list of servers in the ZooKeeper Quorum.

For example, "host1.mydomain.com,host2.mydomain.com,host3.mydomain.com".

By default this is set to localhost for local and pseudo-distributed modes

of operation. For a fully-distributed setup, this should be set to a full

list of ZooKeeper quorum servers. If HBASE_MANAGES_ZK is set in hbase-env.sh

this is the list of servers which we will start/stop ZooKeeper on.

</description>

</property>

<property>

<name>hbase.zookeeper.sission.timeout</name>

<value>60000</value>

</property>

<property>

<name>hbase.zookeeper.property.clientPort</name>

<value>2181</value>

<description>Property from ZooKeeper's config zoo.cfg.

The port at which the clients will connect.

</description>

</property>

<property>

<name>hbase.master</name>

<value>hadoop06.ihep.ac.cn</value>

</property>

<property>

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

<value>60010</value>

<description>The port for the HBase Master web UI.

Set to -1 if you do not want a UI instance run.

</description>

</property>

<property>

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

<value>0.0.0.0</value>

<description>The bind address for the HBase Master web UI

</description>

</property>

<property>

<name>hbase.regionserver.lease.period</name>

<value>60000</value>

<description>HRegion server lease period in milliseconds. Default is

60 seconds. Clients must report in within this period else they are

considered dead.</description>

</property>

<property>

<name>hbase.rpc.timeout</name>

<value>60000</value>

</property>

<property>

<name>hbase.rest.port</name>

<value>60050</value>

</property>

</configuration>

# vi /etc/hbase/conf/regionservers

hadoop01.ihep.ac.cn

hadoop02.ihep.ac.cn

hadoop03.ihep.ac.cn

hadoop04.ihep.ac.cn

hadoop07.ihep.ac.cn

hadoop08.ihep.ac.cn

7. 启动hbase

# service zookeeper-server start

# service hbase-master

# service hbase-regionserver

# service hbase-thrift

8. 命令调整

# mv /usr/bin/hbase /usr/bin/hbase.bak (或将其删除)

# export PATH=$PATH:/usr/lib/hbase/bin (或将其写入~/.bash_profile文件中)

9. 测试安装是否成功(任选其一即可)

(1)打开http://hadoop06.ihep.ac.cn:60010/master-status网页

(2)hbase shell

查看hadoop版本:hadoop version

手动更新locate数据库:updatedb

yum查询已安装软件:yum list installed

启动图形界面:/usr/sbin/gdm start

查看hdfs中文件大小:hadoop fs -du hdfs路径
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: