通过 x2openEuler 工具,将 centos 7.8 迁移至 OpenEuler 上,实际感受迁移过程。
x2openEuler https://docs.openeuler.org/zh/docs/20.03_LTS_SP1/docs/x2openEuler/x2openEuler.html
环境准备
下载 x2openEuler 安装包
wget https://repo.oepkgs.net/openEuler/rpm/openEuler-20.03-LTS-SP1/contrib/x2openEuler/x86_64/Packages/x2openEuler-core-3.0.0-20240118.x86_64.rpm
安装 x2openEuler
开始之前,关闭防火墙,selinux等常规操作
安装升级rpm
[root@olnode01 data]# dnf install x2openEuler-core-3.0.0-20240118.x86_64.rpm
OS 27 kB/s | 2.5 kB 00:00
everything 32 kB/s | 2.5 kB 00:00
EPOL 32 kB/s | 2.5 kB 00:00
debuginfo 30 kB/s | 2.5 kB 00:00
source 30 kB/s | 2.4 kB 00:00
update 26 kB/s | 2.2 kB 00:00
update-source 35 kB/s | 2.7 kB 00:00
Dependencies resolved.
================================================================================================
Package Architecture Version Repository Size
================================================================================================
Installing:
x2openEuler-core x86_64 3.0.0-20240118 @commandline 552 M
Installing dependencies:
expect x86_64 1:5.45.4-7.oe2203sp3 OS 241 k
mariadb x86_64 1:10.5.22-1.oe2203sp3 OS 6.0 M
mariadb-common x86_64 1:10.5.22-1.oe2203sp3 OS 28 k
mariadb-config x86_64 1:10.5.22-1.oe2203sp3 OS 8.4 k
mariadb-errmsg x86_64 1:10.5.22-1.oe2203sp3 OS 232 k
mariadb-server x86_64 1:10.5.22-1.oe2203sp3 OS 18 M
mysql-selinux noarch 1.0.0-2.oe2203sp3 everything 34 k
perl-DBD-MariaDB x86_64 1.21-3.oe2203sp3 OS 122 k
Installing weak dependencies:
mariadb-backup x86_64 1:10.5.22-1.oe2203sp3 OS 6.6 M
mariadb-gssapi-server x86_64 1:10.5.22-1.oe2203sp3 OS 14 k
mariadb-server-utils x86_64 1:10.5.22-1.oe2203sp3 OS 1.1 M
Transaction Summary
================================================================================================
Install 12 Packages
Total size: 584 M
Total download size: 32 M
Installed size: 2.3 G
Is this ok [y/N]: y
Downloading Packages:
(1/11): expect-5.45.4-7.oe2203sp3.x86_64.rpm 145 kB/s | 241 kB 00:01
(2/11): mariadb-common-10.5.22-1.oe2203sp3.x86_64.rpm 235 kB/s | 28 kB 00:00
(3/11): mariadb-config-10.5.22-1.oe2203sp3.x86_64.rpm 82 kB/s | 8.4 kB 00:00
(4/11): mariadb-errmsg-10.5.22-1.oe2203sp3.x86_64.rpm 92 kB/s | 232 kB 00:02
(5/11): mariadb-gssapi-server-10.5.22-1.oe2203sp3.x86_64.rpm 87 kB/s | 14 kB 00:00
(6/11): mariadb-backup-10.5.22-1.oe2203sp3.x86_64.rpm 634 kB/s | 6.6 MB 00:10
(7/11): mariadb-10.5.22-1.oe2203sp3.x86_64.rpm 336 kB/s | 6.0 MB 00:18
(8/11): perl-DBD-MariaDB-1.21-3.oe2203sp3.x86_64.rpm 48 kB/s | 122 kB 00:02
(9/11): mysql-selinux-1.0.0-2.oe2203sp3.noarch.rpm 20 kB/s | 34 kB 00:01
(10/11): mariadb-server-10.5.22-1.oe2203sp3.x86_64.rpm 454 kB/s | 18 MB 00:40
(11/11): mariadb-server-utils-10.5.22-1.oe2203sp3.x86_64.rpm 33 kB/s | 1.1 MB 00:35
------------------------------------------------------------------------------------------------
Total 714 kB/s | 32 MB 00:46
retrieving repo key for OS unencrypted from http://repo.openeuler.org/openEuler-22.03-LTS-SP3/OS/x86_64/RPM-GPG-KEY-openEuler
OS 60 kB/s | 3.0 kB 00:00
Importing GPG key 0xB675600B:
Userid : "openeuler <openeuler@compass-ci.com>"
Fingerprint: 8AA1 6BF9 F2CA 5244 010D CA96 3B47 7C60 B675 600B
From : http://repo.openeuler.org/openEuler-22.03-LTS-SP3/OS/x86_64/RPM-GPG-KEY-openEuler
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : mariadb-config-1:10.5.22-1.oe2203sp3.x86_64 1/12
Installing : mariadb-common-1:10.5.22-1.oe2203sp3.x86_64 2/12
Installing : mariadb-errmsg-1:10.5.22-1.oe2203sp3.x86_64 3/12
Running scriptlet: mysql-selinux-1.0.0-2.oe2203sp3.noarch 4/12
Installing : mysql-selinux-1.0.0-2.oe2203sp3.noarch 4/12
Running scriptlet: mysql-selinux-1.0.0-2.oe2203sp3.noarch 4/12
libsemanage.semanage_direct_install_info: Overriding mysql module at lower priority 100 with module at priority 200.
uavc: op=setenforce lsm=selinux enforcing=0 res=1uavc: op=load_policy lsm=selinux seqno=2 res= Installing : perl-DBD-MariaDB-1.21-3.oe2203sp3.x86_64 5/12
Installing : expect-1:5.45.4-7.oe2203sp3.x86_64 6/12
Installing : mariadb-1:10.5.22-1.oe2203sp3.x86_64 7/12
Installing : mariadb-backup-1:10.5.22-1.oe2203sp3.x86_64 8/12
Installing : mariadb-gssapi-server-1:10.5.22-1.oe2203sp3.x86_64 9/12
Running scriptlet: mariadb-server-1:10.5.22-1.oe2203sp3.x86_64 10/12
Installing : mariadb-server-1:10.5.22-1.oe2203sp3.x86_64 10/12
Running scriptlet: mariadb-server-1:10.5.22-1.oe2203sp3.x86_64 10/12
Running scriptlet: x2openEuler-core-3.0.0-20240118.x86_64 11/12
Installing : x2openEuler-core-3.0.0-20240118.x86_64 11/12
Running scriptlet: x2openEuler-core-3.0.0-20240118.x86_64 11/12
Please enter /usr/local/x2openEuler/portal/service/ and execute bash service_init.sh to start service.
Installing : mariadb-server-utils-1:10.5.22-1.oe2203sp3.x86_64 12/12
Running scriptlet: mysql-selinux-1.0.0-2.oe2203sp3.noarch 12/12
Running scriptlet: mariadb-server-utils-1:10.5.22-1.oe2203sp3.x86_64 12/12
Verifying : expect-1:5.45.4-7.oe2203sp3.x86_64 1/12
Verifying : mariadb-1:10.5.22-1.oe2203sp3.x86_64 2/12
Verifying : mariadb-backup-1:10.5.22-1.oe2203sp3.x86_64 3/12
Verifying : mariadb-common-1:10.5.22-1.oe2203sp3.x86_64 4/12
Verifying : mariadb-config-1:10.5.22-1.oe2203sp3.x86_64 5/12
Verifying : mariadb-errmsg-1:10.5.22-1.oe2203sp3.x86_64 6/12
Verifying : mariadb-gssapi-server-1:10.5.22-1.oe2203sp3.x86_64 7/12
Verifying : mariadb-server-1:10.5.22-1.oe2203sp3.x86_64 8/12
Verifying : mariadb-server-utils-1:10.5.22-1.oe2203sp3.x86_64 9/12
Verifying : perl-DBD-MariaDB-1.21-3.oe2203sp3.x86_64 10/12
Verifying : mysql-selinux-1.0.0-2.oe2203sp3.noarch 11/12
Verifying : x2openEuler-core-3.0.0-20240118.x86_64 12/12
Installed:
expect-1:5.45.4-7.oe2203sp3.x86_64
mariadb-1:10.5.22-1.oe2203sp3.x86_64
mariadb-backup-1:10.5.22-1.oe2203sp3.x86_64
mariadb-common-1:10.5.22-1.oe2203sp3.x86_64
mariadb-config-1:10.5.22-1.oe2203sp3.x86_64
mariadb-errmsg-1:10.5.22-1.oe2203sp3.x86_64
mariadb-gssapi-server-1:10.5.22-1.oe2203sp3.x86_64
mariadb-server-1:10.5.22-1.oe2203sp3.x86_64
mariadb-server-utils-1:10.5.22-1.oe2203sp3.x86_64
mysql-selinux-1.0.0-2.oe2203sp3.noarch
perl-DBD-MariaDB-1.21-3.oe2203sp3.x86_64
x2openEuler-core-3.0.0-20240118.x86_64
Complete!
除了 x2openEuler 之外,主要还安装了 mariadb 数据库
安装 x2openEuler
cd /usr/local/x2openEuler/portal/service
bash service_init.sh
[root@olnode01 service]# bash service_init.sh
Start the MariaDB custom configuration for the use of the x2openEuler tool.
Has MariaDB been installed on the server and can be used properly? [Y/n] (default: n) y
Enter the password of the root user of the MariaDB again:
Set the password of the x2openEuler user for MariaDB:
If the selected database already exists, it will be overwritten.
Use default x2openEulerDb database? [Y/n] (default: Y)
Enter password:
MariaDB is configured successfully.
If authentication is enabled,
the SSH connection fails after the fingerprint of the machine changes.
Please confirm whether public key authentication is not required for SSH connection(y/n default: n):
Start Nginx service and Gunicorn service
Not support the current OS: openEuler release 22.03 (LTS-SP3).
Only CentOS 7.x, CentOS 8.x and openEuler are supported.
Ip address list:
sequence_number ip_address device
[1] 192.168.2.5 enp0s3
[2] 10.0.3.15 enp0s8
[3] 192.168.3.3 enp0s9
Enter the sequence number of listed ip as web server ip(default: 1): 3
Set the web server IP address 192.168.3.3
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
Migrations for 'taskmanager':
/usr/local/x2openEuler/portal/src/taskmanager/migrations/0001_initial.py
- Create model Node
- Create model Repo
- Create model Report
- Create model SoftwareAssessment
- Create model Step
- Create model Task
- Create model SoftwareAssessmentReport
Migrations for 'usermanager':
/usr/local/x2openEuler/portal/src/usermanager/migrations/0001_initial.py
- Create model User
- Create model FailedLogin
- Create model LockedIp
- Create model UserExtend
Migrations for 'weakpasswordmanager':
/usr/local/x2openEuler/portal/src/weakpasswordmanager/migrations/0001_initial.py
- Create model WeakPassword
Operations to perform:
Apply all migrations: auth, certificatemanager, config, contenttypes, operationlogmanager, sessions, taskmanager, usermanager, weakpasswordmanager
Running migrations:
Applying contenttypes.0001_initial... OK
Applying contenttypes.0002_remove_content_type_name... OK
Applying auth.0001_initial... OK
Applying auth.0002_alter_permission_name_max_length... OK
Applying auth.0003_alter_user_email_max_length... OK
Applying auth.0004_alter_user_username_opts... OK
Applying auth.0005_alter_user_last_login_null... OK
Applying auth.0006_require_contenttypes_0002... OK
Applying auth.0007_alter_validators_add_error_messages... OK
Applying auth.0008_alter_user_username_max_length... OK
Applying auth.0009_alter_user_last_name_max_length... OK
Applying auth.0010_alter_group_name_max_length... OK
Applying auth.0011_update_proxy_permissions... OK
Applying auth.0012_alter_user_first_name_max_length... OK
Applying certificatemanager.0001_initial... OK
Applying config.0001_initial... OK
Applying operationlogmanager.0001_initial... OK
Applying sessions.0001_initial... OK
Applying taskmanager.0001_initial... OK
Applying usermanager.0001_initial... OK
Applying weakpasswordmanager.0001_initial... OK
Installed 1 object(s) from 1 fixture(s)
Installed 1 object(s) from 1 fixture(s)
Installed 13 object(s) from 1 fixture(s)
Installed 52 object(s) from 1 fixture(s)
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.3.3:18082/x2openEuler/#/login
密码设置成: x2open@1234
查看服务进程
[root@olnode01 service]# ps -ef|grep python
root 957 1 0 15:16 ? 00:00:02 /usr/bin/python3 -Es /usr/sbin/tuned -l -P
x2openE+ 9323 1 0 15:25 ? 00:00:00 /bin/bash /usr/local/x2openEuler/portal/service/service_gunicorn.sh /usr/local/x2openEuler/portal/thirdapp/python-install/bin/gunicorn -c resources/gunicorn-conf.py resources.wsgi
x2openE+ 9325 9323 0 15:25 ? 00:00:00 /usr/local/x2openEuler/portal/thirdapp/python-install/bin/python3 /usr/local/x2openEuler/portal/thirdapp/python-install/bin/gunicorn -c resources/gunicorn-conf.py resources.wsgi
x2openE+ 9345 9325 0 15:25 ? 00:00:01 /usr/local/x2openEuler/portal/thirdapp/python-install/bin/python3 /usr/local/x2openEuler/portal/thirdapp/python-install/bin/gunicorn -c resources/gunicorn-conf.py resources.wsgi
root 10260 4606 0 15:28 pts/1 00:00:00 grep --color=auto python
[root@olnode01 service]# ps -ef|grep mariadb
mysql 5557 1 0 15:23 ? 00:00:00 /usr/libexec/mariadbd --basedir=/var/lib/mysql/
root 10263 4606 0 15:28 pts/1 00:00:00 grep --color=auto mariadb
当前版本
[root@olnode01 webui]# rpm -qa x2openEuler-core
x2openEuler-core-3.0.0-20240118.x86_64
登陆使用
https://192.168.3.3:18082/x2openEuler/#/login
初始化密码
重启服务
[root@olnode01 webui]# rpm -qa x2openEuler-core
x2openEuler-core-3.0.0-20240118.x86_64
[root@olnode01 webui]# init 6
systemctl start mariadb
systemctl start nginx_x2openEuler.service
systemctl start gunicorn_x2openEuler.service
# django.db.utils.OperationalError: (2003, "Can't connect to MySQL server on '127.0.0.1' ([Errno 111] Connection refused)")
# 遇到上面的错误再次重启即可
创建升级任务
准备好被升级的系统
[root@mysqldb etc]# cat centos-release
CentOS Linux release 7.8.2003 (Core)
这是一个以二进制形式安装了 MySQL 数据库的主机
输入被升级系统的信息和选择目标OS信息
https://docs.openeuler.org/zh/docs/20.03_LTS_SP1/docs/x2openEuler/FeatureGuide.html
SHA256 ED25519 FWax7fck4TGEidPrZCqOZsZ+Yyq69xijrAXle2bIrRY
SHA256 RSA ssAWfnoOebOMOinTXVitTXkOTeCMseGkvj6uMP38dtQ
SHA256 ECDSA 03kB6juavFHZbVAtdquULJxFe3fXW2HifYU4h7/zjrI
MD5 ED25519 e0:5a:46:d8:2e:62:6a:6a:f0:47:77:8a:ca:db:1c:10
MD5 RSA cb:75:96:8a:2c:d8:3e:d8:86:e0:54:b8:e9:6c:3a:69
MD5 ECDSA f2:c8:55:40:73:ab:66:7e:86:de:be:a4:53:27:df:06
到此完成了升级任务的创建,确认无误后点击确认按钮开始升级
升级任务管理
首页这里发现有丰富的帮助引导
环境检查
检查不通过,似乎是网络问题
重试就好了
升级前检查
点击上一步的开始检查按钮
检查中
这里就开始下载目标OS ISO文件?是否应该可以有本地下载好的镜像上传上去?
检查通过
目标主机检查文件-文件在目标主机上
/opt/x2openEuler-upgrade/output/upgrade-check/d74fda75-be7e-11ee-bd85-08002774f1d0/hw_compat-d74fda75-be7e-11ee-bd85-08002774f1d0.json
{
"summary": {
"system_info": {
"manufacturer": "innotek GmbH",
"product_name": "VirtualBox"
},
"bios_info": {
"vendor": "innotek GmbH",
"version": "VirtualBox"
},
"cpu_info": {
"architecture": "x86_64",
"model_name": "12th Gen Intel(R) Core(TM) i7-1255U"
},
"generate_time": "20240129162315",
"is_virtual_machine": true
},
"count_info": {
"all_cards_count": "0",
"compatible_cards_count": "0",
"cards_proportion": "100%",
"total_proportion": "100%",
"level_zero_num": 0,
"level_one_num": 0,
"level_two_num": 0,
"level_three_num": 0
},
"table": []
}
各个标签页的内容
升级前检查报告
配置文件升级策略
业务软件评估报告
硬件兼容性评估报告
软件冲突检查报告
检查日志-最后一个日志tab页
2024-01-29 16:23:18,893 - Client_IP:192.168.3.4 - USER_ID:0 - INFO - GrubCheckActor register success
2024-01-29 16:23:18,893 - Client_IP:192.168.3.4 - USER_ID:0 - INFO - import src.env_check.check_actor.env_check.grub_check_actor success
2024-01-29 16:23:18,894 - Client_IP:192.168.3.4 - USER_ID:0 - INFO - src.env_check.check_actor.env_check.high_important_dir_mount_check_actor
2024-01-29 16:23:18,894 - Client_IP:192.168.3.4 - USER_ID:0 - INFO - HighImportantDirMountCheckActor register success
xxxxxxxxxxxxxxxxx
2024-01-29 16:36:14,521 - Client_IP:192.168.3.4 - USER_ID:0 - UUID:d74fda75-be7e-11ee-bd85-08002774f1d0 - INFO - check results are re-saved: /opt/x2openEuler-upgrade/output/upgrade-check/d74fda75-be7e-11ee-bd85-08002774f1d0/check_result-d74fda75-be7e-11ee-bd85-08002774f1d0.json
2024-01-29 16:36:14,522 - Client_IP:192.168.3.4 - USER_ID:0 - UUID:d74fda75-be7e-11ee-bd85-08002774f1d0 - INFO - Upgrade results are re-saved: /opt/x2openEuler-upgrade/output/upgrade-check/d74fda75-be7e-11ee-bd85-08002774f1d0/upgrade-d74fda75-be7e-11ee-bd85-08002774f1d0.json
2024-01-29 16:36:14,522 - Client_IP:192.168.3.4 - USER_ID:0 - UUID:d74fda75-be7e-11ee-bd85-08002774f1d0 - INFO - check file conflicts finished
x2openEuler 下载的内容
[root@olnode01 database_2.0.0.630]# pwd
/etc/x2openEuler/database_2.0.0.630
[root@olnode01 database_2.0.0.630]# ls
centos6.8 centos7.6 centos8.2 openEuler20.03-LTS-SP1
centos6.8-openEuler20.03-LTS-SP1 centos7.6-openEuler20.03-LTS-SP1 centos8.2-openEuler20.03-LTS-SP1
[root@olnode01 database_2.0.0.630]#
升级
[root@mysqldb ~]# ps -ef|grep 4927
root 4927 1 0 10:15 ? 00:00:00 sh /opt/x2openEuler-upgrade/upgrade/8d884abd-3ee7-4894-a70c-dacafefce75b.sh
root 4931 4927 0 10:15 ? 00:00:00 sh /usr/lib/x2openEuler-upgrade/src/centos2openEuler.sh upgrade /opt/x2openEuler-upgrade/upgrade/upgrade-pkg.json /opt/x2openEuler/repo_files/migrate-x86.repo /usr,/run,/boot,/var,/etc empty_dir /.osbak crashkernel=512M,net.ifnames=1,biosdevname=0 /opt/x2openEuler-upgrade/pkg_download_dir
root 7434 6035 0 10:17 pts/0 00:00:00 grep --color=auto 4927
升级到95%失败了
- 具体错误如下:
Running scriptlet: java-11-openjdk-headless-1:11.0.21.9-1.oe1.x86_64 1/1
Preparing : 1/1
Upgrading : java-11-openjdk-headless-1:11.0.21.9-1.oe1.x86_64 1/2Error unpacking rpm package java-11-openjdk-headless-1:11.0.21.9-1.oe1.x86_64
Verifying : java-11-openjdk-headless-1:11.0.21.9-1.oe1.x86_64 1/2
Verifying : java-11-openjdk-headless-1:11.0.21.0.9-1.el7_9.x86_6 2/2
Failed:
java-11-openjdk-headless-1:11.0.21.0.9-1.el7_9.x86_64
java-11-openjdk-headless-1:11.0.21.9-1.oe1.x86_64
Error: Transaction failed
[ ERROR ] - [initramfs]: dnf upgrade system error.
[ ERROR ] - [initramfs]: failed to upgrade your system.
[ ERROR ] - [initramfs]: failed to upgrade system.
[ ERROR ] - [x2openEuler-upgrade] - failed to upgrade system
6
##THE END##
- 查看java包
[root@mysqldb ~]# rpm -qa|grep java
javapackages-tools-5.3.0-3.oe1.noarch
tzdata-java-2023c-1.el7.noarch
python3-javapackages-5.3.0-3.oe1.noarch
java-11-openjdk-11.0.21.9-1.oe1.x86_64
javapackages-filesystem-5.3.0-3.oe1.noarch
java-1.8.0-openjdk-headless-1.8.0.392.b08-2.oe1.x86_64
java-11-openjdk-devel-11.0.21.9-1.oe1.x86_64
java-11-openjdk-headless-11.0.21.0.9-1.el7_9.x86_64
- 手动dnf安装依然失败
[root@mysqldb ~]# dnf install java-11-openjdk-headless-1:11.0.21.9-1.oe1.x86_64
Last metadata expiration check: 0:01:51 ago on Tue 30 Jan 2024 10:47:31 AM CST.
Dependencies resolved.
========================================================================================================================================
Package Architecture Version Repository Size
========================================================================================================================================
Upgrading:
java-11-openjdk-headless x86_64 1:11.0.21.9-1.oe1 local-repo 39 M
Transaction Summary
========================================================================================================================================
Upgrade 1 Package
Total size: 39 M
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Running scriptlet: java-11-openjdk-headless-1:11.0.21.9-1.oe1.x86_64 1/1
Preparing : 1/1
Upgrading : java-11-openjdk-headless-1:11.0.21.9-1.oe1.x86_64 1/2
Error unpacking rpm package java-11-openjdk-headless-1:11.0.21.9-1.oe1.x86_64
Verifying : java-11-openjdk-headless-1:11.0.21.9-1.oe1.x86_64 1/2
Verifying : java-11-openjdk-headless-1:11.0.21.0.9-1.el7_9.x86_64 2/2
Failed:
java-11-openjdk-headless-1:11.0.21.0.9-1.el7_9.x86_64 java-11-openjdk-headless-1:11.0.21.9-1.oe1.x86_64
Error: Transaction failed
- 怀疑是rpm包的问题,找到
local-repo
/etc/yum.repos.d/migrate-x86_copy.repo
[local-repo]
name=local-repo
baseurl=file:///opt/x2openEuler-upgrade
enabled=1
gpgcheck=0
priority=1
- 在升级包目录下找到该文件
[root@mysqldb x2openEuler-upgrade]# dnf list|grep headless
gdb-headless.x86_64 9.2-7.oe1 @local-repo
java-1.8.0-openjdk-headless.x86_64 1:1.8.0.392.b08-2.oe1 @local-repo
java-11-openjdk-headless.x86_64 1:11.0.21.0.9-1.el7_9 @System
java-1.8.0-openjdk-headless-slowdebug.x86_64 1:1.8.0.392.b08-2.oe1 openEuler-2003-lts-sp1-update
java-1.8.0-openjdk-headless-slowdebug.x86_64 1:1.8.0.392.b08-2.oe1 update
java-11-openjdk-headless.x86_64 1:11.0.21.9-1.oe1 local-repo
java-11-openjdk-headless-slowdebug.x86_64 1:11.0.21.9-1.oe1 openEuler-2003-lts-sp1-update
java-11-openjdk-headless-slowdebug.x86_64 1:11.0.21.9-1.oe1 update
java-latest-openjdk-headless.x86_64 1:21.0.0.35-1.rolling.oe1 openEuler-2003-lts-sp1-update
java-latest-openjdk-headless.x86_64 1:21.0.0.35-1.rolling.oe1 update
[root@mysqldb pkg_download_dir]# pwd
/opt/x2openEuler-upgrade/pkg_download_dir
[root@mysqldb pkg_download_dir]# ls -ltr|grep headless
-rw-r----- 1 root root 40215640 Nov 17 18:53 java-1.8.0-openjdk-headless-1.8.0.392.b08-2.oe1.x86_64.rpm
-rw-r----- 1 root root 41329520 Nov 24 20:02 java-11-openjdk-headless-11.0.21.9-1.oe1.x86_64.rpm
-rw-r----- 1 root root 3275392 Dec 1 18:49 gdb-headless-9.2-7.oe1.x86_64.rpm
从镜像中找到这个文件进行对比
https://mirrors.aliyun.com/openeuler/openEuler-20.03-LTS-SP1/update/x86_64/Packages/?spm=a2c6h.25603864.0.0.3a6a6442zyi3bb
对比结果却是一致的
[root@mysqldb pkg_download_dir]# md5sum java-11-openjdk-headless-11.0.21.9-1.oe1.x86_64.rpm
cbf9a124d6278edb59e0dd4dac20b39a java-11-openjdk-headless-11.0.21.9-1.oe1.x86_64.rpm
[root@mysqldb pkg_download_dir]# md5sum /tmp/java-11-openjdk-headless-11.0.21.9-1.oe1.x86_64.rpm
cbf9a124d6278edb59e0dd4dac20b39a /tmp/java-11-openjdk-headless-11.0.21.9-1.oe1.x86_64.rpm
回退
找不到原因,先回退了
删除掉java*
[root@mysqldb yum.repos.d]# rpm -qa|grep -i java
javapackages-tools-3.4.1-11.el7.noarch
tzdata-java-2023c-1.el7.noarch
python-javapackages-3.4.1-11.el7.noarch
java-11-openjdk-devel-11.0.21.0.9-1.el7_9.x86_64
java-11-openjdk-11.0.21.0.9-1.el7_9.x86_64
java-11-openjdk-headless-11.0.21.0.9-1.el7_9.x86_64
[root@mysqldb yum.repos.d]# yum remove java-11*
Loaded plugins: fastestmirror, langpacks, priorities
Resolving Dependencies
--> Running transaction check
---> Package java-11-openjdk.x86_64 1:11.0.21.0.9-1.el7_9 will be erased
---> Package java-11-openjdk-devel.x86_64 1:11.0.21.0.9-1.el7_9 will be erased
---> Package java-11-openjdk-headless.x86_64 1:11.0.21.0.9-1.el7_9 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
===============================================================================================================================
Package Arch Version Repository Size
===============================================================================================================================
Removing:
java-11-openjdk x86_64 1:11.0.21.0.9-1.el7_9 @updates 578 k
java-11-openjdk-devel x86_64 1:11.0.21.0.9-1.el7_9 @updates 5.2 M
java-11-openjdk-headless x86_64 1:11.0.21.0.9-1.el7_9 @updates 164 M
Transaction Summary
===============================================================================================================================
Remove 3 Packages
Installed size: 170 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Erasing : 1:java-11-openjdk-devel-11.0.21.0.9-1.el7_9.x86_64 1/3
Erasing : 1:java-11-openjdk-11.0.21.0.9-1.el7_9.x86_64 2/3
Erasing : 1:java-11-openjdk-headless-11.0.21.0.9-1.el7_9.x86_64 3/3
Verifying : 1:java-11-openjdk-headless-11.0.21.0.9-1.el7_9.x86_64 1/3
Verifying : 1:java-11-openjdk-11.0.21.0.9-1.el7_9.x86_64 2/3
Verifying : 1:java-11-openjdk-devel-11.0.21.0.9-1.el7_9.x86_64 3/3
Removed:
java-11-openjdk.x86_64 1:11.0.21.0.9-1.el7_9 java-11-openjdk-devel.x86_64 1:11.0.21.0.9-1.el7_9
java-11-openjdk-headless.x86_64 1:11.0.21.0.9-1.el7_9
Complete!
[root@mysqldb yum.repos.d]# rpm -qa|grep -i java
javapackages-tools-3.4.1-11.el7.noarch
tzdata-java-2023c-1.el7.noarch
python-javapackages-3.4.1-11.el7.noarch
[root@mysqldb yum.repos.d]# rpm -qa|grep -i jdk
copy-jdk-configs-3.3-10.el7_5.noarch
重新初始化升级
升级成功
这次顺利完成升级步骤
升级后环境检查
开始检查
检查进行中
检查结束
登陆OS查看
[root@mysqldb ~]# cat /etc/os-release
NAME="openEuler"
VERSION="20.03 (LTS-SP1)"
ID="openEuler"
VERSION_ID="20.03"
PRETTY_NAME="openEuler 20.03 (LTS-SP1)"
ANSI_COLOR="0;31"
[root@mysqldb ~]# cd /.osbak/
[root@mysqldb .osbak]# du -sh *
153M boot
64M etc
11M opt
20K root
61M run
2.7M tools
7.3G usr
1.4G var
[root@mysqldb .osbak]#
清理环境
检查 MySQL 是否能正常启动
[root@mysqldb .osbak]# du -sh *
153M boot
64M etc
11M opt
20K root
61M run
2.7M tools
7.3G usr
1.4G var
[root@mysqldb .osbak]# du -sh *
du: cannot access '*': No such file or directory
[root@mysqldb .osbak]# cd /tmp
[root@mysqldb tmp]# cd /.o
-bash: cd: /.o: No such file or directory
[root@mysqldb tmp]# /etc/init.d/mysqld start
Starting MySQL. SUCCESS!
[root@mysqldb tmp]# ps -ef|grep mysql
avahi 880 1 0 15:48 ? 00:00:00 avahi-daemon: running [mysqldb.local]
root 8076 1 0 15:55 pts/0 00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/data/mysql/3306/data --pid-file=/usr/local/mysql/mysql.pid
mysql 8659 8076 5 15:55 pts/0 00:00:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/data/mysql/3306/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/data/mysql/3306/log/error.log --pid-file=/usr/local/mysql/mysql.pid --socket=/usr/local/mysql/mysql.sock --port=3306
root 8689 7806 0 15:55 pts/0 00:00:00 grep --color=auto mysql
[root@mysqldb tmp]# mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.43-log MySQL Community Server (GPL)
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
root@localhost 15:55:44 [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
| world |
+--------------------+
5 rows in set (0.00 sec)
至此,centos7.8 升级到 openEuler 20.03-LTS-SP1 完成。整个升级过程如果顺利的话,并不需要多少人工介入,其中回退功能则十分方便的在出问题的时候进行回滚操作,赞一个~~