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

  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"
 

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部