转载自:http://blog.csdn.net/levy_cui/article/details/52461377html
官方升级版本说明
http://docs.hortonworks.com/HDPDocuments/Ambari-2.4.0.1/bk_ambari-installation/content/determine_stack_compatibility.html
官方升级步骤
http://docs.hortonworks.com/HDPDocuments/Ambari-2.4.0.1/bk_ambari-upgrade/content/preparing_to_upgrade_ambari.html
官方HDP问题搜索
https://community.hortonworks.com/answers/index.html
Upgrade Ambari
1、升级前准备
Preparing to Upgrade
确认版本
Be sure to review the Release Notes for this Ambari release for Known Issues and Behavioral Changes.
拥有root权限
You must have root, administrative, or root-equivalent authorization on the Ambari server host and all servers in the cluster.
备份ambari数据库
You must backup the Ambari Server database.
备份好ambari.properties配置文件
You must make a safe copy of the Ambari Server configuration file found at /etc/ambari-server/conf/ambari.properties.
2、中止服务、下载新的ambari.repo
关闭Ambari Metrics
If you are running Ambari Metrics service in your cluster, stop the service. From Ambari Web, browse to Services > Ambari Metrics and select Stop from the Service Actions menu.
中止ambari-server
Stop the Ambari Server. On the host running Ambari Server:
ambari-server stop
中止ambari-agent
Stop all Ambari Agents. On each host in your cluster running an Ambari Agent:
ambari-agent stop
获取新的ambari.repo
Fetch the new Ambari repo and replace the old repository file with the new repository file on all hosts in your cluster.
wget -nv http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.4.0.1/ambari.repo -O /etc/yum.repos.d/ambari.repo
3、升级操做
Upgrade Ambari Server. On the host running Ambari Server:
yum clean all
yum info ambari-server
在ambari节点更新ambari-server
In the info output, visually validate that there is an available version containing "2.4"
yum upgrade ambari-server
显示以下成功:
Updated:
ambari-server.x86_64 0:2.4.0.1-1
Complete!
在全部节点更新ambari-agent
Upgrade all Ambari Agents. On each host in your cluster running an Ambari Agent:
yum upgrade ambari-agent
显示以下成功:
Updated:
ambari-agent.x86_64 0:2.4.0.1-1
Complete!
查看ambari-agent
After the upgrade process completes, check each host to make sure the new files have been installed:
rpm -qa | grep ambari-agent
升级ambari-server
Upgrade Ambari Server database schema. On the host running Ambari Server:
ambari-server upgrade
[root@testserver2 yum.repos.d]# ambari-server upgrade
Using python /usr/bin/python
Upgrading ambari-server
Updating properties in ambari.properties ...
WARNING: Can not find ambari.properties.rpmsave file from previous version, skipping import of settings
INFO: Can not find ambari-env.sh.rpmsave file from previous version, skipping restore of environment settings. ambari-env.sh may not include any user customization.
Fixing database objects owner
Ambari Server configured for Embedded Postgres. Confirm you have made a backup of the Ambari Server database [y/n] (y)?
Upgrading database schema
Adjusting ambari-server permissions and ownership...
Ambari Server 'upgrade' completed successfully.
启动ambari-server
Start the Ambari Server. On the host running Ambari Server:
ambari-server start
[root@testserver2 yum.repos.d]# ambari-server start
Using python /usr/bin/python
Starting ambari-server
Ambari Server running with administrator privileges.
Organizing resource files at /var/lib/ambari-server/resources...
Ambari database consistency check started...
No errors were found.
Ambari database consistency check finished
Server PID at: /var/run/ambari-server/ambari-server.pid
Server out at: /var/log/ambari-server/ambari-server.out
Server log at: /var/log/ambari-server/ambari-server.log
Waiting for server start....................
Ambari Server 'start' completed successfully.
全部节点启动ambari-agent
Start all Ambari Agents. On each host in your cluster running an Ambari Agent:
ambari-agent start
python
登陆ambari管理界面,查看版本,升级成功。数据库
打开管理界面后出现图中内容,使用’ctrl+shift+R’刷新下就行了。centos
4、增长新版本HDP
浏览Ambari Web > Admin > Stack and Versions.
点击Versions标签,你将看到已经安装的HDP版本
若是看不到已经安装(Current)的版本, 说明客户端没有更新完。
Admin > Manager Ambari > 左侧Versions
点击右上角的按钮Register Version,添加新的hdp版本。
8. 点击Install Packages就可以将hadoop升级到该HDP版本了。服务器
安装后点击upgrade,有两种升级模式,一种是保持服务运行升级,另外一种是中止服务升级,后者升级更快些markdown
点击Checks查看警告信息,须要检查TEZ服务,进入TEZ服务,选择“”run service check“”oop
提示是否升级测试
选择i have performed the clients will retry on their above. 以后proceedui
开始升级,我选择的是中止服务升级,过程当中会自动stop服务,有时候须要retrythis
最后确认是否完成升级,升级后没法回退到旧版本。
HDP2.5已经为当前版本
在添加新服务的时候已是新版本组件了
看了下hdfs中的数据还在
总结:
对于生产环境hadoop集群升级,绝对是个重量级工做,必定要有敬畏之心,以上升级步骤虽然看着不复杂,也很顺利的完成,我是在测试环境上进行的,没有一点心理负担,
若是是生产环境,不只须要中止服务,若是在过程当中出现问题,后果确定没法想象,新版本组件也须要在升级前进行测试,业务是否能够运行正常,须要大量的测试实践工做,建议若是真要升级hadoop集群,仍是考虑异地备份重要数据,避免数据丢失,比起数据丢失的风险,多买几台服务器进行数据备份,不算什么的,总之不到万不得已,轻易不要升级集群。