在測試環境下安裝openstack,因爲在centos6下安裝openstack,針對源的問題有不少,安裝起來很不順利!centos
可是在centos7下安裝卻很順利,因此考慮將服務器由centos6升級到centos7服務器
這個我是在測試機中運行的,建議不要用於實際環境工具
另外:操做前要記得整盤備份。測試
下面對這一升級過程進行記錄:ui
1.查看升級前的版本信息url
[root@openstack ~]# lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.8 (Final)
Release: 6.8
Codename: Finalcentos7
二、在「/etc/yum.repos.d/」目錄中建立文件upgradetool.repospa
[root@openstack ~]# cd /etc/yum.repos.d/ip
[root@openstack yum.repos.d]# touch upgradetool.repoio
把如下內容貼進upgradetool.repo
[root@openstack yum.repos.d]#vi upgradetool.repo
文件內容以下:
[upg]
name=CentOS-$releasever – Upgrade Tool
baseurl=http://dev.centos.org/centos/6/upg/x86_64/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
保存退出
三、安裝升級工具
[root@openstack ~]#yum install redhat-upgrade-tool preupgrade-assistant-contents
四、安裝完後,運行
[root@openstack ~]# preupg -l
CentOS6_7
查看支持的升級
五、執行升級分析
preupg僅僅是分析系統而不會執行任何任務,執行後它會給出一些建議告訴更新程序在更新的時候去搜索什麼。
[root@openstack ~]# preupg -s CentOS6_7
Preupg tool doesn’t do the actual upgrade.
Please ensure you have backed up your system and/or data in the event of a failed upgrade
that would require a full re-install of the system from installation media.
Do you want to continue? y/n
y
直到完成(跑至關長的時間,請耐心等待)
若是沒有提示出錯,能夠繼續下一步。不然請檢查!!!要所有PASS才能夠。
六、導入centos7源
[root@openstack ~]# rpm –import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7
七、升級系統
[root@openstack ~]# centos-upgrade-tool-cli –network 7 –instrepo=http://mirror.centos.org/centos/7/os/x86_64/
國內比較慢,可使用如下源
[root@openstack ~]# centos-upgrade-tool-cli –network 7 –instrepo=http://mirrors.163.com/centos/7/os/x86_64/
八、重啓系統,完成
[root@openstack ~]# reboot