本次升级使用工具为苏研提供

1. 升级前准备操作

1.1 注意事项

● 迁移工具安装在辅助机中(不进行系统迁移的机器)

● 辅助机至少给迁移工具的安装预留 1.6G 内存空间

● 安装之前需要关闭防火墙和 SELinux 的特殊要求

● 工具安装环境需开启工具端口 18082

1.2 待升级系统

本次升级系统以centos7.6为例,升级软件支持centos7.x,redhat7.x,bclinx7.x到bclinux_for_openEuler21.10

升级过程对待升级系统性能没有绝对要求,但是要至少预留2G空间用户安装升级软件,根据时间情况预留一定空间用户备份系统(具体预留空间根据系统实际大小而定)

1.3. 辅助机

升级过程至少需要一台辅助机,升级软件需要安装在辅助机,辅助机和待升级节点不能是同一台机器

辅助机操作系统需要为centos7.6或者bclinux7.6

1.3 升级软件

升级使用软件为苏研提供天元易行迁移工具(欧拉),目前天元易行迁移工具(欧拉)仅支持 x86_64 和 ARM 64 位服务器,不支持 IBM PowerPCLE 等 架构服务器

在内网升级如果没有对应bclinux-for-euler2110,则需要通过iso镜像文件挂载内网yum源

2. 辅助机安装升级软件

2.1. 辅助机准备操作

执行以下命令查看防火墙是否开启

systemctl status firewalld

显示“inactive”表示防火墙没有开启

显示“active”表示防火墙开启。

[root@fuzhuji_zfk ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2023-06-21 10:47:53 EDT; 5min ago
Docs: man:firewalld(1)
Main PID: 8765 (firewalld)
CGroup: /system.slice/firewalld.service
└─8765 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

Jun 21 10:47:53 fuzhuji_zfk.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
Jun 21 10:47:53 fuzhuji_zfk.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.

如果没有开启,执行以下命令查看端口是否开通

[root@fuzhuji_zfk ~]# firewall-cmd --query-port=18082/tcp
no

提示“no”表示端口未开通。

执行以下命令永久开通端口:

firewall-cmd --add-port=18082/tcp --permanent
[root@fuzhuji_zfk ~]# firewall-cmd --add-port=18082/tcp --permanent
success

重载配置后查看是否开通18082端口

firewall-cmd --reload
firewall-cmd --query-port=18082/tcp
[root@fuzhuji_zfk ~]# firewall-cmd --reload
success
[root@fuzhuji_zfk ~]# firewall-cmd --query-port=18082/tcp
yes
[root@fuzhuji_zfk ~]#

2.2. 安装升级工具

若辅助机器无可用 yum 源,需手动上传 bclinux-sysmt-core 的 rpm 包,然后通过本地镜像制作本地源, 再通过 yum 安装工具及其所需要的依赖。

将安装包上传到辅助机节点任意位置(本次以/mnt/soft为例)

cd /mnt
 mkdir soft
 cd soft
ls
[root@fuzhuji_zfk mnt]# cd /mnt
[root@fuzhuji_zfk mnt]# mkdir soft
[root@fuzhuji_zfk mnt]# cd soft
[root@fuzhuji_zfk soft]# ls
bclinux-sysmt-core-2.0.0-1.x86_64.rpm

安装此rpm包

yum install -y bclinux-sysmt-core-2.0.0-1.x86_64.rpm 
[root@fuzhuji_zfk soft]# yum install -y bclinux-sysmt-core-2.0.0-1.x86_64.rpm 
Loaded plugins: fastestmirror, langpacks
Examining bclinux-sysmt-core-2.0.0-1.x86_64.rpm: bclinux-sysmt-core-2.0.0-1.x86_64
Marking bclinux-sysmt-core-2.0.0-1.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package bclinux-sysmt-core.x86_64 0:2.0.0-1 will be installed
--> Processing Dependency: java-1.8.0-openjdk for package: bclinux-sysmt-core-2.0.0-1.x86_64
Determining fastest mirrors
 * base: mirrors.nju.edu.cn
 * extras: mirrors.nju.edu.cn
 * updates: mirrors.nju.edu.cn
base                                                                                | 3.6 kB  00:00:00     
extras                                                                              | 2.9 kB  00:00:00     
updates                                                                             | 2.9 kB  00:00:00     

Dependencies Resolved

===========================================================================================================
 Package                     Arch   Version                       Repository                          Size
===========================================================================================================
Installing:
 bclinux-sysmt-core          x86_64 2.0.0-1                       /bclinux-sysmt-core-2.0.0-1.x86_64 2.1 G
Installing for dependencies:
 atk                         x86_64 2.28.1-2.el7                  base                               263 k
 avahi-libs                  x86_64 0.6.31-20.el7                 base                                62 k
 cairo                       x86_64 1.15.12-4.el7                 base                               741 k
 tzdata-java                 noarch 2023c-1.el7                   updates                            186 k
 xorg-x11-font-utils         x86_64 1:7.5-21.el7                  base                               104 k
 xorg-x11-fonts-Type1        noarch 7.5-9.el7                     base                               521 k

Transaction Summary
===========================================================================================================
Install  1 Package (+66 Dependent packages)

Total size: 2.2 G
Total download size: 58 M
Installed size: 2.3 G
Downloading packages:
(1/66): avahi-libs-0.6.31-20.el7.x86_64.rpm                                         |  62 kB  00:00:00     
(2/66): atk-2.28.1-2.el7.x86_64.rpm                                                 | 263 kB  00:00:00     
                             | 1.9 MB  00:00:00     
(64/66): xorg-x11-fonts-Type1-7.5-9.el7.noarch.rpm                                  | 521 kB  00:00:00     
(65/66): tzdata-java-2023c-1.el7.noarch.rpm                                         | 186 kB  00:00:00     
(66/66): java-1.8.0-openjdk-headless-1.8.0.372.b07-1.el7_9.x86_64.rpm               |  33 MB  00:00:04     
-----------------------------------------------------------------------------------------------------------
Total                                                                       11 MB/s |  58 MB  00:00:05     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : libjpeg-turbo-1.2.90-8.el7.x86_64                                                      1/67 
  Installing : mesa-libglapi-18.3.4-12.el7_9.x86_64                                                   2/67 
                                63/67 
  Installing : 1:java-1.8.0-openjdk-devel-1.8.0.372.b07-1.el7_9.x86_64                               64/67 
  Installing : 1:tcl-8.5.13-8.el7.x86_64                                                             65/67 
  Installing : expect-5.45-14.el7_1.x86_64                                                           66/67 
  Installing : bclinux-sysmt-core-2.0.0-1.x86_64                                                     67/67 
Please enter /usr/local/x2openEuler/portal/service/ and execute bash service_init.sh to
start service.
  Verifying  : libXext-1.3.3-3.el7.x86_64                                                             1/67 
                                                    64/67 
  Verifying  : copy-jdk-configs-3.3-11.el7_9.noarch                                                  65/67 
  Verifying  : libX11-common-1.6.7-4.el7_9.noarch                                                    66/67 
  Verifying  : avahi-libs-0.6.31-20.el7.x86_64                                                       67/67 

Installed:
  bclinux-sysmt-core.x86_64 0:2.0.0-1                                                                      

Dependency Installed:
  atk.x86_64 0:2.28.1-2.el7                                                                                
  avahi-libs.x86_64 0:0.6.31-20.el7                                                                        
                                                    
  xorg-x11-font-utils.x86_64 1:7.5-21.el7                                                                  
  xorg-x11-fonts-Type1.noarch 0:7.5-9.el7                                                                  

Complete!

安装完成后运行升级程序

进入/usr/local/x2openEuler/portal/service目录,输入命令sh service_init.sh运行升级程序

cd /usr/local/x2openEuler/portal/service
sh service_init.sh
[root@fuzhuji_zfk soft]# cd /usr/local/x2openEuler/portal/service
[root@fuzhuji_zfk service]# ls -ltr
total 60
-rwxr-x---. 1 root root  3179 Apr 12 05:25 service_nginx.sh
-rwxr-x---. 1 root root 15381 Apr 12 05:25 service_init.sh
-rwxr-x---. 1 root root   231 Apr 12 05:25 service_gunicorn.sh
-rwxr-x---. 1 root root   762 Apr 12 05:25 service_daemon.sh
-rwxr-x---. 1 root root   591 Apr 12 05:25 nginx_x2openEuler.service
-rwxr-x---. 1 root root   579 Apr 12 05:25 gunicorn_x2openEuler.service
-rwxr-x---. 1 root root  1839 Apr 12 05:25 delete_file.sh
-rwxr-x---. 1 root root    57 Apr 12 05:25 const.conf
-rwxr-x---. 1 root root 14451 Apr 13 04:57 change_ip_x2openEuler.sh
#################################################################################
# 中间默认回车即可
[root@fuzhuji_zfk service]# sh service_init.sh 
Start Nginx service and Gunicorn service
Ip address list:
sequence_number         ip_address              device
[1]             	192.168.122.130       	ens33
Enter the sequence number of listed ip as web server ip(default: 1): 
Set the web server IP address 192.168.122.130
Please enter HTTPS port(default: 18082):
The HTTPS port 18082 is valid.  Set the HTTPS port to 18082 (y/n default: y):
Set the HTTPS port 18082
Please enter gunicorn port(default: 18080):
The GUNICORN port 18080 is valid.  Set the GUNICORN port to 18080 (y/n default: y):
Set the GUNICORN port 18080
The Nginx and Gunicorn ports are set up successfully.
Installing the django dependent environment.
The django dependency environment is installed successfully.
Generating the Django secret key.
Generate the Django secret key successfully.
Migrations for 'certificatemanager':
  /usr/local/x2openEuler/portal/src/certificatemanager/migrations/0001_initial.py
    - Create model CertificateInfo
    - Create model CertPathConfig
    - Create model ScheduleTask
Migrations for 'config':
  /usr/local/x2openEuler/portal/src/config/migrations/0001_initial.py
    - Create model RollbackFilterConfig
    - Create model UserConfig
Migrations for 'operationlogmanager':
  /usr/local/x2openEuler/portal/src/operationlogmanager/migrations/0001_initial.py
    - Create model OperationLog

Installed 2 object(s) from 1 fixture(s)
Encrypting phase successfully.
It may take a few minutes to generate the certificate, please wait...
Certificate generated successfully. You can import the root certificate to the browser to mask security alarms when you access the tool. The root certificate is stored in /usr/local/x2openEuler/portal/thirdapp/nginx-install/webui/ca.crt.
Web console is now running, go to: # https://192.168.122.130:18082/x2openEuler/#/login

在浏览器输入上方网址,选择继续访问

centos7.x升级openeuler详细操作教程_java

可以进入升级软件登录界面

centos7.x升级openeuler详细操作教程_国产化_02

初次登录需要自定义设置密码

centos7.x升级openeuler详细操作教程_前端_03

登录后界面

centos7.x升级openeuler详细操作教程_前端_04

3. 配置本地yum源

由于升级系统是在内网进行,下载升级所需要的安装包只能通过内网yum源获取,这里我们通过挂载欧拉镜像的方式获取内网yum源

3.1. 上传镜像源到辅助机

BCLinux-for-Euler-21.10-dvd-x86_64-230324.iso 存放到辅助结点的/mnt/iso 目录下

[root@fuzhuji_zfk service]# cd /mnt/iso/
[root@fuzhuji_zfk iso]# ls
BCLinux-for-Euler-21.10-dvd-x86_64-230324.iso

3.2. 安装httpd并启动服务

同样需要上传httpd的安装包到辅助机,在进行安装

将httpd的rpm安装包上传到/mnt/soft目录下进行安装

[root@fuzhuji_zfk soft]# cd /mnt/soft/
[root@fuzhuji_zfk soft]# ls -ltr
total 576408
-rw-r--r--. 1 root root 587387992 Jun 21 11:06 bclinux-sysmt-core-2.0.0-1.x86_64.rpm
-rw-r--r--. 1 root root   2849200 Jun 25 06:30 httpd-2.4.6-99.el7.centos.1.x86_64.rpm
[root@fuzhuji_zfk soft]# yum install -y httpd-2.4.6-99.el7.centos.1.x86_64.rpm
Loaded plugins: fastestmirror, langpacks
Examining httpd-2.4.6-99.el7.centos.1.x86_64.rpm: httpd-2.4.6-99.el7.centos.1.x86_64
Marking httpd-2.4.6-99.el7.centos.1.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-99.el7.centos.1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
============================================================================================================
 Package                      Arch                          Version                                        Repository                                                  Size
============================================================================================================
Installing:
 httpd                        x86_64                        2.4.6-99.el7.centos.1                          /httpd-2.4.6-99.el7.centos.1.x86_64                        9.4 M

Transaction Summary
============================================================================================================
Install  1 Package
Total size: 9.4 M
Installed size: 9.4 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : httpd-2.4.6-99.el7.centos.1.x86_64                                                                                                                       1/1 
  Verifying  : httpd-2.4.6-99.el7.centos.1.x86_64                                                                                                                       1/1
Installed:
  httpd.x86_64 0:2.4.6-99.el7.centos.1                                                                                                                         
Complete!

安装完成后启动相关服务

systemctl enable --now httpd
systemctl status httpd
[root@fuzhuji_zfk soft]# systemctl enable --now httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[root@fuzhuji_zfk soft]# 
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Sun 2023-06-25 06:32:32 EDT; 22s ago
     Docs: man:httpd(8)
           man:apachectl(8)
 Main PID: 32805 (httpd)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"
   CGroup: /system.slice/httpd.service
           ├─32805 /usr/sbin/httpd -DFOREGROUND
           ├─33361 /usr/sbin/httpd -DFOREGROUND
           ├─33362 /usr/sbin/httpd -DFOREGROUND
           ├─33363 /usr/sbin/httpd -DFOREGROUND
           ├─33364 /usr/sbin/httpd -DFOREGROUND
           └─33365 /usr/sbin/httpd -DFOREGROUND

Jun 25 06:32:06 fuzhuji_zfk.localdomain systemd[1]: Starting The Apache HTTP Server...
Jun 25 06:32:21 fuzhuji_zfk.localdomain httpd[32805]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fuzhuji_zfk.l...s message
Jun 25 06:32:32 fuzhuji_zfk.localdomain systemd[1]: Started The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.

3.3. 挂载镜像

在目录 /var/www/html下创建目录euler2110 ,然后将欧拉镜像挂载在此目录

欧拉镜像版本要选择everything

[root@fuzhuji_zfk /]# cd /var/www/html/
[root@fuzhuji_zfk html]# mkdir euler2110
[root@fuzhuji_zfk html]# mount -o loop /mnt/iso/BCLinux-for-Euler-21.10-everything-x86_64-230324.iso /var/www/html/euler2110/
mount: /dev/loop0 is write-protected, mounting read-only
# 此挂载方式关机重启后会失效

关闭系统防火墙

[root@fuzhuji_zfk html]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2023-06-25 04:58:39 EDT; 1h 42min ago
     Docs: man:firewalld(1)
 Main PID: 8713 (firewalld)
   CGroup: /system.slice/firewalld.service
           └─8713 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

Jun 25 04:58:39 fuzhuji_zfk.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
Jun 25 04:58:39 fuzhuji_zfk.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
[root@fuzhuji_zfk html]# systemctl stop firewalld
[root@fuzhuji_zfk html]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sun 2023-06-25 06:41:39 EDT; 1s ago
     Docs: man:firewalld(1)
  Process: 8713 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)
 Main PID: 8713 (code=exited, status=0/SUCCESS)

Jun 25 04:58:39 fuzhuji_zfk.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
Jun 25 04:58:39 fuzhuji_zfk.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
Jun 25 06:41:37 fuzhuji_zfk.localdomain systemd[1]: Stopping firewalld - dynamic firewall daemon...
Jun 25 06:41:39 fuzhuji_zfk.localdomain systemd[1]: Stopped firewalld - dynamic firewall daemon.

在浏览器打开http://ip地址/euler2110出现下图则代表挂载成功

centos7.x升级openeuler详细操作教程_openeuler_05

4. 系统升级

4.1. 登录x2openEuler

在浏览器(谷歌浏览器72.0及以上版本)中打开:https://部署辅助机的ip:端口号/x2openEuler/#/login

第一次进入登录界面输入用户名和密码,用户名默认为x2openEulerAdmin,密码为自己设定。设定好密码后,将重新进入登录页面。用前面设定好的密码重新登录。

centos7.x升级openeuler详细操作教程_openeuler_06

选择新建任务–>系统升级

centos7.x升级openeuler详细操作教程_服务器_07

选择添加节点

centos7.x升级openeuler详细操作教程_国产化_08

待升级节点要和辅助机节点在同一网段下

填写相关信息,在升级前先查看待升级节点系统信息

[root@localhost ~]# cat /etc/os-release 
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
[root@localhost ~]# cat /etc/redhat-release 
CentOS Linux release 7.6.1810 (Core) 
[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]# hostnamectl
   Static hostname: localhost.localdomain
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 7b52ccee24244c15ac0f0858010e6d08
           Boot ID: cd3b13ff6afd49ee87823b4ef3e699e4
    Virtualization: vmware
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-957.el7.x86_64

关闭待升级节点防火墙

systemctl stop fiurewalld

填写升级信息

centos7.x升级openeuler详细操作教程_国产化_09

centos7.x升级openeuler详细操作教程_服务器_10

repo源选择自定义

添加repo源

centos7.x升级openeuler详细操作教程_前端_11

添加下面信息

[shengji]
name=shengji
baseusrl=http://192.168.122.130/euler2110/
enabled=1
gpgcheck=0

centos7.x升级openeuler详细操作教程_java_12

点击确定

centos7.x升级openeuler详细操作教程_openeuler_13

再次点击确定

centos7.x升级openeuler详细操作教程_openeuler_14

4.2. 环境检查

进入环境检查阶段

centos7.x升级openeuler详细操作教程_国产化_15

4.3. 升级前环境检查

下一步,升级前检查

centos7.x升级openeuler详细操作教程_前端_16

4.3. 升级

预检查通过,下一步,进行升级操作

centos7.x升级openeuler详细操作教程_前端_17

centos7.x升级openeuler详细操作教程_国产化_18

centos7.x升级openeuler详细操作教程_服务器_19

升级成功,等待重启完成

centos7.x升级openeuler详细操作教程_openeuler_20

重启完成

centos7.x升级openeuler详细操作教程_java_21

升级后环境检查

centos7.x升级openeuler详细操作教程_服务器_22

4.3. 环境清理

检查完成后清理升级软件

centos7.x升级openeuler详细操作教程_openeuler_23

清理完成,如有问题,下载日志查看相关信息,没有问题,选择删除升级任务

centos7.x升级openeuler详细操作教程_openeuler_24

登录升级后的节点,查看操作系统信息

[root@localhost ~]#  cat /etc/os-release
NAME="BigCloud Enterprise Linux"
VERSION="21.10 (LTS-SP2)"
ID="bclinux"
VERSION_ID="21.10"
PRETTY_NAME="BigCloud Enterprise Linux For Euler 21.10 LTS"
ANSI_COLOR="0;31"
[root@localhost ~]# cat /etc/redhat-release 
BigCloud Enterprise Linux For Euler release 21.10 (LTS-SP2)
[root@localhost ~]# uname -a
Linux localhost.localdomain 4.19.90-2107.6.0.0100.oe1.bclinux.x86_64 #1 SMP Wed Dec 1 19:59:44 CST 2021 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]# hostnamectl
   Static hostname: localhost.localdomain
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 4192080af16f4dee8d7d40286a4dd35b
           Boot ID: 5575a9660e84460b9d808c6dc054120b
    Virtualization: vmware
  Operating System: BigCloud Enterprise Linux For Euler 21.10 LTS
            Kernel: Linux 4.19.90-2107.6.0.0100.oe1.bclinux.x86_64
      Architecture: x86-64

5. 问题说明

5.1 yum配置问题

选择挂载的升级源镜像要选择everything版本

例如BCLinux-for-Euler-21.10-everything-x86_64

镜像下载地址:https://mirrors.cmecloud.cn/bclinux/oe21.10/ISO/x86_64/release/

否则有可能出现缺少文件玩儿

5.2. 缺少database

升级软件已经内置升级centos7.6,bclinux7.6到openeuler的database,如升级centos7.x,或者bclinux7.x,redhat7.x则需要下载对应的database

下载地址:https://repo.oepkgs.net/openEuler/rpm/openEuler-20.03-LTS-SP1/contrib/x2openEuler/x86_64/Packages/


阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6
标签: centos