当前位置:   article > 正文

docker 环境下ambari-2.1.0离线升级hdp2.2.6.0 to hdp2.3.0.0_ambari2.6 升级 hdp3.0

ambari2.6 升级 hdp3.0

准备:

首先搭建好docker的centos容器环,详见:http://blog.csdn.net/moxuqiang_dm/article/details/47083437
在创建容器的过程当中,最值得注意的是数据卷的挂载,因为hdp的安装文件很大,且容器的根目录默认只分配10G,并且docker容器是存储在根目录下的,这样就会造成宿主根目录不够用的情况;(说明一下我实验用的机器大概配置是I3处理器以及16G的内存,这样的配置对于安装hdp有点困难,实验中我创建了三个容器来安装hdp,还有两个容器来安装ambari-server 和mysql-server特别是内存,所以建议内存的配置大于16G)

部署图:

这里写图片描述

ambari安装及配置:

由于ambari在收集集群信息的时候需要借助于ambari-metrics-collector,所以不建议直接用ambari的rpm安装;

1.ambari本地仓库配置

a:官网上获得ambari tarball的下载链接:

http://s3.amazonaws.com/public-repo-1.hortonworks.com/index.html 
  • 1

这个地址很难打开,下载到ambari-2.1.0的压缩包后,解压到http服务下的默认目录下:/var/www/html
b:下载仓库配置文件进行修改

cd /etc/yum.repos.d/  && wget http://s3.amazonaws.com/dev.hortonworks.com/ambari/centos6/2.x/BUILDS/2.1.0-1409/ambaribn.repo
  • 1

c:刚才解压的ambari路径作为仓库的访问URL,实验修改如下:

#VERSION_NUMBER=2.1.0-1409
[AMBARI.2.1.0-2.x]
name=Ambari 2.x
baseurl=http://172.17.42.25/ambari-2.1.0/centos6/
gpgcheck=1
gpgkey=http://172.17.42.25/ambari-2.1.0/centos6/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

d:到hortonworks官网获取hdp的压缩包:

http://docs.hortonworks.com/HDPDocuments/Ambari-2.1.0.0/bk_Installing_HDP_AMB/content/_hdp_stack_repositories.html
  • 1

得到安装包后解压到httpd服务默认目录下:/var/www/html

e:到相应的容器中安装ambari-server 和ambari-agent

yum install -y ambari-server
yum install -y ambari-agent
  • 1
  • 2

f:创建ambari数据库及相应的用户(hive,oozie数据后面会用)

CREATE USER 'ambari' IDENTIFIED BY 'bigdata';create database ambari;grant all privileges on ambari.* to ambari @"%" identified by "bigdata";FLUSH PRIVILEGES;CREATE USER 'hive' IDENTIFIED BY 'hive';create database hive;grant all privileges on hive.* to hive @"%" identified by "hive";FLUSH PRIVILEGES;CREATE USER 'oozie' IDENTIFIED BY 'oozie';create database oozie;grant all privileges on oozie.* to oozie @"%" identified by "oozie";FLUSH PRIVILEGES; 
  • 1

g:根据提示配置ambari-server

ambari-server setup
  • 1

h:修改ambari-agent访问ambari-server的地址

vi /etc/ambari-agent/conf/ambari-agent.ini 
hostname=172.17.42.21
  • 1
  • 2

i:最后登陆ambari页面来安装hdp
这里需要注意的是在自定义配置服务那一步;由于我们之前挂载了两个数据卷

docker run -itd --net=none --privileged=true -v /home/docker/centos_1:/usr/hdp -v /home/docker/data/centos_1:/datas --hostname=hdp1.urun --name=centos_1 centos6-ssh
  • 1

datanode 和name node 会同时会配置两个目录(/usr/hdp/hadoop/……以及/datas/hadoop/…)来存储数据,但是/usr/hdp/是我们所有服务的默认安装目录,如果数据存储在这里或者在目录有任何文件或目录都会在升级hdp时出错,所以这里不能有任何东西,这应该也算ambari的一个bug

升级HDP到2.3.0.0

要求:

a.根据hortonworks要求,安装了的服务都必须启动,最好没有任何警告;
b.hdfs 必须是ha模式;
c.所有已安装的服务不能在处于Maintenance 模式;
d.建议hive metastore 和yarn resourceManager都是ha模式;
e.在升级过程中hive metastore需要转换端口,检查安装hdp的容器的端口10010没有被使用;
f.备份好hive和oozie的数据库
g.还有其他的要求,但一般都满足的;

上传数据

在以上要求都被满足的情况下,分别在hdfs,hive,hbase创建一些数据,以便检查升级是否成功;以下是一些脚本,使用hdfs用户来执行以下脚本;

----login to hdfs ---

su -l hdfs

----hive-----

create table tblDetail(orderNum String,itemid String,name String) row format delimited fields terminated by ','  lines terminated by '\n';

load data local inpath '/usr/hdp/current/hive-client/detail.txt' into table tblDetail;


-----hbase-----

create 'member','m_id','address','info'

put'member','scutshuxue','info:age','24'

put'member','scutshuxue','info:birthday','1987-06-17'

put'member','scutshuxue','info:company','alibaba'

put'member','scutshuxue','address:contry','china' 

put'member','scutshuxue','address:province','zhejiang' 

put'member','scutshuxue','address:city','hangzhou' 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26

注意,测试数据必须能用hdfs用户来访问;

获取集群状态并使集群进入安全模式

执行以下命令,使用hdfs用户来执行;

hdfs fsck / -files -blocks -locations > dfs-old-fsck-1.log
hdfs dfsadmin -report > dfs-old-report-1.log
hadoop dfs -ls -R / > dfs-old-lsr-1.log

//使集群进入安全模式;
hdfs dfsadmin -safemode enter
hdfs dfsadmin -saveNamespace

//进行hdfs升级状态;
hdfs dfsadmin -finalizeUpgrade
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

注册stack version并安装hdp2.3.0.0

a.到ambari版本管理注册新版本,注意注册的名称格式,不然会导致ambari打不开, 我里使用的是这样的后缀格式:0.0-2557,这些可以在每个解压的rpm包名中找到;
b.注册后配置URL并保存版本信息;
c.安装hdp

升级hdp及其过程描述;

在ambari的版本管理页面点击Performing the Upgrade进行升级;

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/705716
推荐阅读
相关标签
  

闽ICP备14008679号