轉載自: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集羣,仍是考慮異地備份重要數據,避免數據丟失,比起數據丟失的風險,多買幾臺服務器進行數據備份,不算什麼的,總之不到萬不得已,輕易不要升級集羣。