Red Hat Enterprise Linux 6 升级 Red Hat Enterprise Linux 7 经验分享

2016-10-13 15:24:23 +08:00
 wsgzao

前言

因为交易系统部的同事提出了一个新的需求要将现有的 RHEL6.7 升级至 RHEL7.1(最好保留数据升级),之前对于小版本的升级无论是 CentOS 还是 Redhat 都可以直接通过 yum update 的方式实现软件包和内核的迭代更新,但是这次的需求经过 Redhat 知识库的研究发现这几乎是一个不可能轻松实现的任务,原因就是 Redhat 压根不支持大版本之间的升级,考虑到跨版本兼容性问题和原厂不做技术支持这两点,通过和 Redhat 二线电话沟通也确认了最终的实现方案,就是先备份相关重要配置和数据格式化 /分区保留其它文件系统,重装后在把数据迁移回来。整个过程虽然提不上什么惊心动魄,但至少翻阅了大量材料,官方虽然给出了跨版本升级的步骤,但实现的代价和要求真的太高,这里一并分享出来方便大家学习和思考。

How do I upgrade from RHEL 6 to RHEL 7? Reinstall

更新记录

2016 年 10 月 13 日 - 初稿

阅读原文 - https://wsgzao.github.io/post/rhel-upgrade/

扩展阅读

红帽支持 RHEL 主版本之间的升级吗?- https://access.redhat.com/zh_CN/solutions/1388653 How do I upgrade from RHEL 6 to RHEL 7? - https://access.redhat.com/solutions/637583


红帽支持 RHEL 主版本之间的升级吗?

Environment

Issue

Resolution

Red Hat Enterprise Linux 4, 5, 6

红帽 不支持 RHEL 主版本之间的跨大版本升级。(主版本以整数表示。比如, RHEL 5 和 RHEL 6 都是不同的主版本。)

不同主版本之间的跨大版本升级,不会保留所有系统设置、服务配置和自定义设置。因此, 红帽强烈建议重新安装系统,以进行主版本之间的升级 。建议在运行着的服务器旁,使用新的服务器安装一个全新的 RHEL ,然后把原有的设 置、软件和数据迁移到新服务器上,以确保系统和软件能在新服务器上正确运行。 这还有助于确保数据安全地从备份转移到新的系统。

还有方法可以不进行全新安装,来进行升级。要实现这个功能,插入新版本的安装光盘,然后在 boot 命令行中输入:

# linux upgradeany

这将引导您进行与 普通的安装过程很相近的升级步骤。再次说明,这个过程红帽是不予支持的。进行完这个升级操作后,如果您联系红帽技术支持,红帽只会当作全新的安装来提供支持。升级过程中产生的问题是不予支持的。任何时候出现的问题如果疑似与升级过程有关,红帽将要求您重新安装系统。

Comment

可参考文档, Red Hat Enterprise Linux 6 Installation Guide, Chapter 37. Upgrading Your Current System

升级或重新安装系统后,请重新注册系统,请参考 Red Hat Enterprise Linux 6 Installation Guide, Chapter 37. Upgrading Your Current System

Red Hat Enterprise Linux 7

对于特定的使用情况,红帽支持从 Red Hat Enterprise Linux 6 升级到 Red Hat Enterprise Linux 7 。更多信息,请参考以下文档:

如有问题,请联系红帽全球支持服务 file a support case ,或在 Discussions area of the Customer Portal 中进行讨论。

How do I upgrade from RHEL 6 to RHEL 7

Environment

Red Hat Enterprise Linux 6.x to Red Hat Enterprise Linux 7

<table border="1"> <tr> <th>Product Variant</th> <th>x86 Architecture</th> <th>x86_64 Architecture</th> <th>IBM Power</th> <th>IBM z Systems</th> </tr> <tr> <td>Desktop Edition</td> <td>Not supported</td> <td>Not supported</td> <td>N/A</td> <td>N/A</td> </tr> <tr> <td>Workstation Edition</td> <td>Not supported</td> <td>Not supported</td> <td>N/A</td> <td>N/A</td> </tr> <tr> <td>Server Edition</td> <td>Not supported</td> <td><font color="blue">Supported</font></td> <td><font color="blue">Supported[1]</font></td> <td><font color="blue">Supported[2]</font></td> </tr> <tr> <td>HPC Compute Node</td> <td>Not supported</td> <td><font color="blue">Supported</font></td> <td>N/A</td> <td>N/A</td> </tr> <tr> <td>Server running CloudForms software</td> <td>N/A</td> <td>Not supported</td> <td>N/A</td> <td>N/A</td> </tr> </table>

[1] Red Hat Enterprise Linux for Power, big endian [2] Red Hat Enterprise Linux for IBM z Systems

Issue

Resolution

Red Hat Enterprise Linux 7 (RHEL 7) is the first major release of RHEL to allow in-place upgrades from the previous RHEL major release (RHEL 6). An in-place upgrade offers a way of upgrading a system to a new major release of Red Hat Enterprise Linux by replacing the existing operating system.

This RHEL 6 to RHEL 7 upgrade procedure is fully supported if your Red Hat Enterprise Linux system meets the following criteria:

Latest Red Hat Enterprise Linux 6: Before upgrading to the latest RHEL 7, you must start with RHEL 6 and update your system to have the latest RHEL 6 packages installed. (This is covered in the procedure below.)

All Server editions (except x86): All server editions (except x86) of Red Hat Enterprise Linux 6 can be upgraded with this procedure. Upgrades of RHEL Workstation and Desktop systems are not supported. Upgrades for the POWER architecture is supported. SEE TABLE ABOVE. Upgrade from 32-bit architecture is not supported.

Limited package groups: The upgrade process handles only the following package groups and packages: Minimal (@minimal), Base (@base), Web Server (@web-server), DHCP Server, File Server (@nfs-server), and Print Server (@print-server). Although upgrades of other packages and groups are not supported, in some cases, packages can be uninstalled from the RHEL 6 system and reinstalled on the upgraded RHEL 7 system without a problem. SEE TABLE BELOW.

The supported use cases for upgrading RHEL 6 to RHEL 7:

<table> <thead> <tr> <th></th> <th>Supported</th> <th>Unsupported</th> </tr> </thead> <tbody> <tr> <td>Source to Upgrade</td> <td>The latest RHEL-6.X</td> <td>RHEL 6.4 and earlier</td> </tr> <tr> <td>File Systems</td> <td>Like-file system upgrades
For example ext3 to ext3, ext4 to ext4, xfs to xfs</td> <td>Unlike-file system upgrades
For example ext4 to xfs</td> </tr> <tr> <td>GNOME, KDE</td> <td>None</td> <td>All GNOME, KDE installs</td> </tr> <tr> <td>Packages/Groups</td> <td>Minimal (@minimal)
Base (@base)
Web Server (@web-server)
DHCP Server
File Server (@nfs-server)
Print Server</td> <td>All others</td> </tr> <tr> <td>Virtualization</td> <td>KVM, VMWare</td> <td>Microsoft Hyper-V (coming soon)</td> </tr> <tr> <td>Red Hat Software Collections</td> <td>Using tested process</td> <td>All others</td> </tr> <tr> <td>High Availability</td> <td>None</td> <td>All</td> </tr> </tbody> </table>

The upgrade procedure consists of the following basic steps:

  1. Prepare for Upgrade: Make sure your system is backed up and up to date before beginning the preupgrade.
  2. Install the Preupgrade Assistant: Enable the required repositories and install the preupgrade packages.
  3. Run the Preupgrade Assistant: Check your system for upgrade issues before running the actual upgrade. No changes are made to your system and you can repeat this step until all issues are dealt with.
  4. Run the Upgrade: Perform the actual upgrade.
  5. Provide Feedback: Create a debug log to send to Red Hat in case there are problems.

实践步骤

核心目标为格式化 /分区,保留其它文件系统,做好相应备份重装 RHEL7

生产环境当前系统版本为 RHEL6.7 ,推荐升级至 RHEL7.1 或者更新的版本

通过 RHEL7.1 的 ISO 引导至 INSTALLATION SUMMARY

安装结束后恢复备份数据

4584 次点击
所在节点    Linux
4 条回复
gotounix
2016-10-13 15:50:09 +08:00
一般用 RHEL 的很少重装升级,除非迫不得已,如果跑了大型业务系统,特别是配置繁杂的简直要命。
pmpio
2016-10-13 16:22:08 +08:00
我一般将业务系统放在独立分区上,业务系统包括应用程序、配置和数据。然后升级大版本时保留这些磁盘分区即可,新装系统时记得装好同样的、业务系统依赖的软件包。
defunct9
2016-10-13 21:01:40 +08:00
什么乱七糟八的。三句就完了,备份,升级,复制
id4alex
2016-10-14 09:37:31 +08:00
有些配置文件还是回写到 /etc/ 有些数据可能会在 /var 下面...总之很危险

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/312523

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX