centos 7.9 迁移到 openEuler22.03-LTS-SP3

openEuler移植案例 | 移植操作指南 | openEuler社区官网

How to Upgrade CentOS 7 to CentOS 8 Linux (tecmint.com)

  cat /etc/redhat-release 
CentOS Linux release 7.9.2009 (Core)

需要两台机器,

不通过原因 在待升级节点检查是否有安装x2openEuler-core时, 发现已经安装了,不能作为升级节点。该节点为:

解决方案 请到待升级节点使用‘rpm -qa | grep x2openEuler-core’命令检查是否有安装包, 请换一台机器

下载x2openEuler-core-3.0.0-20240125.x86_64.rpm

wget https://repo.oepkgs.net/openEuler/rpm/openEuler-20.03-LTS-SP1/contrib/x2openEuler/x86_64/Packages/x2openEuler-core-3.0.0-20240125.x86_64.rpm


 yum install -y x2openEuler-core-3.0.0-20240125.x86_64.rpm 

 更换阿里yum源

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
curl -s -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -s -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
 
sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo

 使用mariadb,需要先设置密码

[root@localhost ~]# cd /usr/local/x2openEuler/portal/service/

[root@localhost service]# ll
total 84
-rwxr-x---. 1 root root 14616 Jan 25  2024 change_ip_x2openEuler.sh
-rwxr-x---. 1 root root    57 Jan 25  2024 const.conf
-rwxr-x---. 1 root root  1897 Jan 25  2024 delete_file.sh
-rwxr-x---. 1 root root   579 Jan 25  2024 gunicorn_x2openEuler.service
-rwxr-x---. 1 root root  6143 Jan 25  2024 mariadb.sh
-rwxr-x---. 1 root root   591 Jan 25  2024 nginx_x2openEuler.service
-rwxr-x---. 1 root root   784 Jan 25  2024 service_daemon.sh
-rwxr-x---. 1 root root   237 Jan 25  2024 service_gunicorn.sh
-rwxr-x---. 1 root root 16497 Jan 25  2024 service_init.sh
-rwxr-x---. 1 root root  3237 Jan 25  2024 service_nginx.sh
-rwxr-x---. 1 root root  1614 Jan 25  2024 set_ssh_host_key_check_config.sh
-rwxr-x---. 1 root root  3107 Jan 25  2024 update_db_pwd.sh
-rwxr-x---. 1 root root   828 Jan 25  2024 upgrade_migrate_data.sh

[root@localhost service]# yum install mariadb -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.bupt.edu.cn
 * extras: mirrors.bupt.edu.cn
 * updates: mirrors.bupt.edu.cn
Package 1:mariadb-5.5.68-1.el7.x86_64 already installed and latest version
Nothing to do
[root@localhost service]# systemctl enable mariadb --now
[root@localhost service]# systemctl status mariadb
● mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2024-08-19 04:55:43 CST; 2min 30s ago
 Main PID: 1503 (mysqld_safe)
   CGroup: /system.slice/mariadb.service
           ├─1503 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
           └─1669 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/l...



[root@localhost service]# mysql -uroot 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 5.5.68-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 
MariaDB [(none)]> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [mysql]> update user set Password = password('*') where user ='root';
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4  Changed: 4  Warnings: 0

MariaDB [mysql]> 
MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

MariaDB [mysql]> \q
Bye
[root@localhost 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) Y
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
Ip address list:
sequence_number         ip_address              device
[1]             	10.8.8.7       	ens33
Enter the sequence number of listed ip as web server ip(default: 1): 
Set the web server IP address 10.8.8.7
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
To ensure successful running of the tool, enable the web service port and reload the configuration as follows:
   1.Enable the web service port: firewall-cmd --add-port=18082/tcp --permanent
   2.Reload the configuration: firewall-cmd --reload
   3.Check whether the port is enabled: firewall-cmd --query-port=18082/tcp
Are you agree to run the above command to enable the port?(y/n,default:y)
Port 18082 is enabled successfully.
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://10.8.8.7:18082/x2openEuler/#/login

 https://10.8.8.7:18082/x2openEuler/#/login

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"
 

### 将 CentOS 迁移到国产操作系统的方案 #### 使用 Anolis OS 替代 CentOS 的方法 对于希望从 CentOS 8.x 进行迁移的情况,可以考虑采用龙蜥操作系统(Anolis OS)。此过程涉及利用 `yum` 工具中的 `distro-sync` 功能来同步并更新现有的系统软件包至兼容版本。具体步骤如下: ```bash sudo dnf install https://mirrors.aliyun.com/anolis/RPM-GPG-KEY-Alibaba-Anolis sudo dnf config-manager --add-repo=https://mirrors.aliyun.com/anolis/$releasever/AppStream/x86_64/os/ sudo dnf config-manager --set-enabled anolis-os-appstream sudo dnf clean all sudo dnf distro-sync -y ``` 上述命令序列会逐步配置新的仓库源,并最终执行整个系统的同步升级[^1]。 #### 统信 UOS 提供的自动化迁移解决方案 针对更广泛的 CentOS 用户群体,尤其是那些寻求简化迁移流程的企业级用户而言,统信软件提供了专门设计用于辅助 CentOS 向其自主研发的操作系统——UOS (UnionTech Operating System) 转型的专业化工具和服务。这类工具旨在最小化因更换基础架构所带来的影响,在不改变现有硬件设施的前提下实现无缝过渡,从而有效减少转换期间可能产生的额外开支和风险[^2]。 #### 安装与部署银河麒麟服务器操作系统 KylinOS 如果目标是转向由国防科技大学研发的支持多核处理器技术的安全可靠平台,则可以选择安装银河麒麟高级服务器操作系统 V10 版本。该产品不仅具备良好的稳定性和安全性特性,而且能够满足政府机关以及大型企业的严格需求。以下是基本安装指导概要: 1. 准备好 ISO 映像文件并通过虚拟机或物理介质启动; 2. 按照屏幕提示选择语言和地区设置; 3. 设置键盘布局和其他初始化参数; 4. 创建必要的分区结构并指定根目录位置; 5. 开始正式安装程序直至完成重启进入新环境。 以上即为基于不同类型的国产操作系统所提供的三种主流迁移路径介绍[^3]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值