Long-Term Supported Versions

    Common Operations

    Configuring a Repository

    Prerequisites

    • You have logged in to x2openEuler.
    • You are creating an upgrade, information collection and analysis, or configuration migration task.

    Procedure

    1. When creating a task, click Add Node and scroll down to Repository. Click Select on the right. The Select Repository page is displayed, as shown in Figure 1.

      NOTE
      By default, x2openEuler provides the aarch and x86_64 repositories of openEuler 20.03 LTS SP1.

      Figure 1 Select Repository

    2. In the Repository list on the left, select a repository and click OK.

    3. (Optional) Manage repositories.

      NOTICE

      • Ensure that the added repositories of the target OS are supported by x2openEuler. Otherwise, the upgrade will fail. At least everything and update must be added.
      • Modifying a repository may affect the normal running of other nodes that use the repository. Exercise caution when performing this operation.
      • Deleting a repository may affect the normal running of other nodes that use the repository. Exercise caution when performing this operation.
      • To add a repository:

        Click Add Repository in the upper right corner. On the displayed page, configure the repository by referring to the default repository. The suffix of the repository name is .repo. Click Save to complete the configuration.

      • To modify a repository:

        In the Repository list on the left, select a repository and click to open it for modification.

      • To delete a repository:

        In the Repository list on the left, select a repository and click to delete it.

    (Optional) Importing a Root Certificate for x2openEuler

    If a security warning is displayed when you use a browser to log in to x2openEuler, you can import a root certificate for x2openEuler so that the security warning will not be generated.

    The following uses Chrome 105.0 as an example to describe how to import a root certificate for x2openEuler.

    1. Log in to x2openEuler, click in the upper right corner, choose Web Server Certificate, and click Download Root Certificate.

    2. Open the browser and choose Settings > Privacy and security > Security > Manage certificates.

    3. In the Certificates dialog box displayed, select the Trusted Root Certification Authorities tab and click Import, as shown in Figure 2.

      Figure 2 Certificates

    4. In the Certificate Import Wizard dialog box displayed, click Next, as shown in Figure 3.

      Figure 3 Welcome to the Certificate Import Wizard

    5. In the File to Import dialog box displayed, click Browse, as shown in Figure 4.

      Figure 4 File to Import

    6. Select the certificate to be imported on the local PC.

    7. Click Next.

      In the Certificate Store dialog box displayed, set the certificate store as shown in Figure 5.

      Figure 5 Certificate Store

    8. Click Next and then Finish.

      The Security Warning dialog box is displayed.

    9. Click Confirm.

      "The import was successful" is displayed.

    10. Click OK to complete the import.

    11. Modify the mapping between the server IP address and the tool name in the local hosts file.

      1. Open the hosts file in C:\Windows\System32\drivers\etc.

        Figure 6 hosts

      2. Add the following content to the hosts file, save the file, and exit.

        <Server_IP_address> x2openEuler
        

        Example: 10.254.206.190 x2openEuler

    12. Open the browser, enter https://x2openEuler:port_number (for example, https://x2openEuler:8084) in the address box, and press Enter.

    Modifying SSH Configurations

    Modify the SSH configuration file of x2openEuler to configure the SSH timeout duration.

    1. Log in to the node where x2openEuler is deployed and run the following commands to go to the corresponding directory and open the conf.ini file:

      cd /usr/local/x2openEuler/portal/src/
      vi conf.ini
      
    2. Modify the configuration file content as required by referring to Table 1.

      Table 1 SSH parameters

      ParameterDescription
      long_cmd_timeoutTimeout duration for a command that takes long to execute, for example, a command for obtaining node logs. The default value is 600.
      tail_line_numberNumber of log lines displayed when you use tail to obtain node logs. The default value is 100.
      hostname_lengthLength of the host name, which is used to dynamically configure the length of a line in the command output. The default value is 100.
      cmd_timeoutTimeout duration for a command that does not take long to execute, for example, the whoami command. The default value is 10.
    3. Press Esc, type :wq, and press Enter to save the changes and exit.

    4. Run the following command to restart the SSH service for the configuration to take effect:

      systemctl restart sshd.service
      

    Disabling the SELinux Enforcing Mode

    To disable the SELinux enforcing mode on a node, perform the following operations:

    • Disabling the SELinux enforcing mode temporarily

      1. Query the SELinux status.

        sestatus
        

        If the value of Current mode is enforcing, the SELinux enforcing mode is enabled.

      2. Set the SELinux mode to permissive.

        setenforce 0
        
      3. Query the SELinux status again.

        If the value of Current mode is permissive, the SELinux enforcing mode is disabled temporarily.

      NOTICE
      The setting becomes invalid after the server is rebooted. When x2openEuler is used, service exceptions may occur.

    • Disabling SELinux enforcing mode permanently

      1. Query the SELinux status.

        sestatus
        

        If SELinux status is enabled, SELinux is enabled.

      2. Open the /etc/selinux/config file.

        vi /etc/selinux/config
        
      3. Press i to enter the insert mode and change SELINUX=enforcing to SELINUX=disabled.

      4. Press Esc, type :wq, and press Enter to save the change and exit.

      5. Reboot the server.

        reboot
        
      6. Query the SELinux status again.

        If the value of SELinux status is disabled, the SELinux enforcing mode is disabled.

    Changing the IP Address and Port Numbers of x2openEuler

    Prerequisites

    x2openEuler has been deployed.

    Procedure

    1. Use an SSH tool to remotely log in to the x2openEuler deployment environment and enter the Linux CLI.

    2. Run the following commands to stop x2openEuler.

      img NOTE
      Before changing the IP address and port numbers, you must stop x2openEuler.

      systemctl stop nginx_x2openEuler.service
      systemctl stop gunicorn_x2openEuler.service
      
    3. Change the IP address and port numbers.

      cd /usr/local/x2openEuler/portal/service/
      bash change_ip_x2openEuler.sh
      

      The command output is as follows:

      Start Nginx service and Gunicorn service
      =====================================================
      Original IP address and x2openEuler number: x.x.x.x:18082
      =====================================================
      Ip address list:
      sequence_number         ip_address              device
      [1]                     x.x.x.x                 br0
      [2]                     y.y.y.y                 br1
      Enter the sequence number of listed ip as web server ip(default: 1): 1
      Set the web server IP address y.y.y.y
      Please enter HTTPS port(default: 18082):19082
      The HTTPS port 19082 is valid.  Set the HTTPS port to 19082 (y/n default: y):y
      Set the HTTPS port 19082
      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.
      

      img NOTE
      x.x.x.x and y.y.y.y indicate the IP addresses of the x2openEuler deployment environment.

      • Before changing the IP address and port numbers, go to the /usr/local/x2openEuler/portal/service directory.
      • After the commands are executed, available IP addresses will be listed. You can select one of them.
      • Before changing the port numbers, ensure that the desired ports are not occupied to avoid port conflict. If the firewall is enabled in the x2openEuler deployment environment, open the new ports on the firewall. If the original ports are no longer used, close them on the firewall for security purposes.
      • After changing the port numbers, restart the tool-related services. For details, see Starting, Stopping, or Restarting Services.

    Starting, Stopping, or Restarting Services

    Prerequisites

    x2openEuler has been deployed.

    Procedure

    1. Use an SSH tool to remotely log in to the x2openEuler deployment environment and enter the Linux CLI.

    2. Run the following commands to start, stop, restart, or query services:

      systemctl start/stop/restart/status nginx_x2openEuler.service
      systemctl start/stop/restart/status gunicorn_x2openEuler.service
      

    Managing Logs

    Log Description

    Operation Logs

    Operation logs record information about the modification operations performed by users and scheduled tasks of the system. The following operations are logged:

    • User login and logout
    • File upload
    • Task creation
    • User creation or deletion
    • Locking or unlocking of users
    • User configuration modification
    • Password change
    • Report download or deletion
    • Setting of the maximum number of online users
    • Setting of the run log level
    • Certificate import or replacement
    • Setting of the certificate expiration alarm threshold
    • Weak password dictionary management
    • Working key update

    Run Logs

    Run logs record program running information that is necessary for R&D personnel or users to quickly locate and rectify faults.

    The following table describes the log files contained in the log package downloaded.

    Table 2 Run log files

    FileDescription
    certificate_manager.logRecords management operations on the x2openEuler certificate.
    config.logRecords operations on x2openEuler configurations.
    operationlog_manager.logRecords management operations on operation logs.
    requests.logRecords access requests.
    ssh_connect.logRecords SSH connections.
    user_manager.logRecords user management operations.
    work_key_manager.logRecords working key operations.
    cipher.logRecords password change operations of login users.
    get_node_finger_print.logRecords node fingerprint output.
    permission.logRecords x2openEuler permission changes.
    runlog_manager.logRecords operations of obtaining run logs.
    task_manager.logRecords upgrade task operations.
    weakpassword_manager.logRecords weak password changes.
    pre-execute.logRecords the logs of executing the pre-upgrade scripts on the upgrade node.
    post-execute.logRecords the logs of executing the post-upgrade scripts (after restart) on the upgrade node.
    execute.logRecords the logs of executing the post-upgrade scripts (before restart) on the upgrade node.
    NOTE
    Run logs are stored in /usr/local/x2openEuler/portal/logs/backend.

    Pre-upgrade script execution logs are stored in /opt/x2openEuler/scripts-execute/n-x.x.x.x/pre-execute.

    Post-upgrade script (after restart) execution logs are stored in /opt/x2openEuler/scripts-execute/n-x.x.x.x/post-execute.

    Post-upgrade script (before restart) execution logs are stored in /opt/x2openEuler/scripts-execute/n-x.x.x.x/post-execute-before-reboot.

    In the paths:

    n indicates the ID of the upgrade task, and x.x.x.x indicates the IP address of the node to be upgraded.

    Managing Operation Logs

    Prerequisites

    You have logged in to x2openEuler.

    NOTE

    • Common users can only view and download their own operation logs. The administrator can view operation logs of all users.
    • Operation logs are stored in the operaitonlogmanager_operationlog table of the MariaDB database of x2openEuler and saved as the /usr/local/x2openEuler/portal/logs/backend/operationlog_manager.log file.
    • The operation logs are retained for 30 days by default. x2openEuler automatically checks operation logs at 1:00:00 a.m. every day and deletes expired logs.

    Procedure

    1. On the WebUI, click in the upper right corner and choose Logs.

      On the Logs page displayed, click the Operation Logs tab, as shown in Figure 7.

      Figure 7 Operation Logs

    2. (Optional) Download the operation logs.

      Click Download to download the log file in CSV format.

    Managing Run Logs

    Prerequisites

    You have logged in to x2openEuler.

    NOTE

    • Only the administrator x2openEulerAdmin can view and download run logs and change the run log level.
    • The administrator can click , choose System Settings, and set the log level. The logs of the specified level and higher levels will be recorded.

    Procedure

    1. On the WebUI, click in the upper right corner and choose Logs.

      On the Logs page displayed, click the Run Logs tab, as shown in Figure 8.

      Figure 8 Run logs

    2. Click Download to download run logs.

      The run logs downloaded are in the following format:

      [Time] [Log_level] [Process_ID] [Thread_name] [Module_name:Function_name:Line_number] Log_details
      

      Example:

      [2020-08-20 09:50:21] [INFO] [processID:18508] [MainThread] [solution_api:get_solution_category:143] get_solution_category
      

      The log level indicates the importance of the log information. The default log level is INFO. The run logs are classified into the following levels:

      • DEBUG: debugging information for fault locating
      • INFO: key information about the normal running of the service
      • WARNING: unexpected system events that do not affect the running of the system
      • ERROR: errors that may not affect the application running

    Managing Users

    Resetting a Password

    Prerequisites

    You have logged in to x2openEuler.

    NOTE
    Only the administrator x2openEulerAdmin can reset passwords.

    Procedure

    1. On the WebUI, click in the upper right corner and choose User Management.

      The User Management page is displayed.

    2. Locate the user whose password needs to be reset and click Reset Password. The Reset Password dialog box is displayed, as shown in Figure 9. Table 3 describes the parameters.

      Figure 9 Reset Password

      Table 3 Parameters for resetting a password

      ParameterDescription
      User NameName of the user whose password needs to be reset. It cannot be changed when you reset the password.
      Administrator PasswordPassword of the administrator.
      New Password

      New password of the user. The password must meet the following complexity requirements:

      • Contains 8 to 32 characters.
      • Contains at least two types of the uppercase letters, lowercase letters, digits, and special characters (`~!@#$%^&*()-_=+\\|[{}];:'",<.>/?).
      • Cannot contain any space.
      • Cannot be the same as the user name.
      • Cannot be a password in the weak password dictionary.
      Confirm PasswordPassword re-entered for confirmation
    3. Reset the password according to Table 3 and click OK.

      NOTE
      If the password of a user who has logged in is reset, the user will automatically exit to the login page and needs to log in again using the new password.

    Deleting Users

    Prerequisites

    You have logged in to x2openEuler.

    NOTE

    • Only the administrator x2openEulerAdmin can delete users.
    • The default administrator cannot be deleted.

    Procedure

    1. On the WebUI, click in the upper right corner and choose User Management.

      The User Management page is displayed.

    2. Locate the user to be deleted, and click Delete in the Operation column.

      NOTICE
      Deleting a user will delete all historical data of the user. Exercise caution when performing this operation.

    3. Enter the password of the administrator and click OK.

    Changing the Current User Password

    Prerequisites

    You have logged in to x2openEuler.

    NOTE
    The password of an x2openEuler user is valid for 90 days by default. Change the password before it expires. If the password has expired, you need to change the password after login.

    Procedure

    1. Open the login user drop-down menu in the upper right corner and choose Change Password.

      The Change Password page is displayed, as shown in Figure 10. Table 4 describes the parameters.

      Figure 10 Change Password

      Table 4 Parameters for changing a password

      ParameterDescription
      User NameName of the current login user.
      Old PasswordOld password of the user.
      New Password

      Enter a new password. The password must meet the following complexity requirements:

      • Contains 8 to 32 characters.
      • Contains at least two types of the uppercase letters, lowercase letters, digits, and special characters (`~!@#$%^&*()-_=+\\|[{}];:'",<.>/?).
      • Cannot contain any space.
      • Cannot be the same as the user name.
      • Cannot be the same as the old password.
      • Cannot be the old password in reverse order.
      • Cannot be a password in the weak password dictionary.
      Confirm PasswordPassword re-entered for confirmation.
    2. Change the password according to Table 4 and click OK.

      NOTE
      After your password is changed, you will automatically exit to the login page and need to use the new password to log in to the system again.

    Managing the Weak Password Dictionary

    A weak password can be easily guessed or cracked. When a user sets or changes a password, the system checks the new password against the weak password dictionary. If a match is found, the user needs to set another password for security purposes.

    Prerequisites

    You have logged in to x2openEuler.

    NOTE

    • Users can view and search for weak passwords.
    • Only the administrator x2openEulerAdmin can add and delete weak passwords.
    • By default, 52 weak passwords are provided.
    • A maximum of 1,000 weak passwords can be configured.

    Procedure

    1. On the WebUI, click in the upper right corner and choose Weak Password Dictionary.

    2. Click New. A dialog box is displayed.

      Figure 11 Add Weak Password

    3. Enter the weak password to be added in the text box. The weak password must meet the following requirements:

      • Contains 8 to 32 characters.
      • Contains at least two types of the following characters:
        • Uppercase letters A to Z
        • Lowercase letters a to z
        • Digits 0 to 9
        • Special characters (`~!@#$%^&*()-_=+\|[{}];:'",<.>/?)
    4. Click OK.

      NOTE
      To delete a weak password, locate the weak password and click Delete in the Operation column. In the dialog box displayed, click OK.

    Managing the Web Server Certificate

    The web server certificate is used for secure communication between the client browser and a web server. It implements encrypted data transmission between the client and web server. For security purposes, replace the original certificate with your custom certificate and promptly update the certificate.

    Prerequisites

    You have logged in to x2openEuler.

    NOTE
    Only the administrator x2openEulerAdmin can generate a certificate signing request (CSR) file, import the web server certificate, download the root certificate, restart the system, and change the working key.

    Procedure

    1. On the WebUI, click in the upper right corner and choose Web Server Certificate.

    2. Query the information of the certificate, as shown in Figure 12. Table 5 describes the parameters.

      Figure 12 Web Server Certificate

      Table 5 Web server certificate parameters

      ParameterDescription
      Certificate NameName of the certificate.
      Expiration TimeTime when the certificate expires.
      StatusStatus of the certificate, which can be any of the following:
      Valid: The certificate is valid.
      About to expire: The remaining validity period of the certificate is less than or equal to the certificate expiration alarm threshold.
      Expired: The certificate has expired.
      NOTE
      • The tool automatically checks and updates the certificate status every day.
      • The default alarm threshold of the web server certificate is 90 days. The administrator can click and choose System Settings on the x2openEuler home page and set the certificate expiration alarm threshold. The value ranges from 7 to 180 days.
      OperationThe following operations can be performed:
      • Download the root certificate.
        NOTE
        If a security warning is displayed when you use a browser to log in to x2openEuler, you can import a root certificate for x2openEuler to ignore the security warning.
      • Generate a CSR file.
        NOTE
        CSR is short for certificate signing request. When a certificate applicant applies for a digital certificate, the cryptographic service provider (CSP) generates a private key and a CSR. After the certificate applicant submits the CSR file to a certificate authority (CA), the CA uses the private key of the root certificate to generate a public key file, that is, a certificate.
      • Import a web server certificate.
      • Restart the service.
      • Update the working key.

    Customizing and Importing a Web Server Certificate

    1. On the Web Server Certificate page, click Generate CSR File.

      The Generate CSR File page is displayed, as shown in Figure 13. Table 6describes the parameters.

      Figure 13 Generate a CSR file.

      Table 6 CSR file parameters

      ParameterDescription
      Country/RegionCountry/Region of the user.
      This parameter is mandatory. The value must be a two-letter country code.
      Province or StateProvince or state of the user.
      The value can contain a maximum of 128 characters, allowing letters, digits, hyphens (-), underscores (_), periods (.), and spaces.
      CityCity of the user.
      The value can contain a maximum of 128 characters, allowing letters, digits, hyphens (-), underscores (_), periods (.), and spaces.
      CompanyCompany of the user.
      The value can contain a maximum of 64 characters, allowing letters, digits, hyphens (-), underscores (_), periods (.), and spaces.
      DepartmentDepartment of the user.
      The value can contain a maximum of 64 characters, allowing letters, digits, hyphens (-), underscores (_), periods (.), and spaces.
      Common NameName of the user.
      This parameter is mandatory. The value can contain a maximum of 64 characters, allowing letters, digits, hyphens (-), underscores (_), periods (.), and spaces.
    2. Click OK to generate a CSR file.

    3. Export and send the CSR file to an SSL CA and apply for an SSL certificate. After obtaining the formal certificate, save it to the local host.

      NOTE
      You can also obtain a formal certificate by using a self-signed digital certificate based on the root certificate.

    4. Click Import Web Server Certificate. The Import Web Server Certificate page is displayed.

    5. Click , select the certificate to be imported, and click Upload.

      NOTE

      • The certificate file to be imported must be in *.crt, *.cer, or *.pem format and cannot exceed 1 MB.
      • The CSR file generated in 1 correlates with the server certificate applied from the CA. Do not generate a new CSR file before importing the server certificate. Otherwise, you have to use the new CSR file to apply for a new server certificate from the CA.
      • If the SSL certificate imported is not obtained from a CA, check whether the browser has the root certificate.
    6. Click OK to import the web server certificate.

    7. Click More and choose Restart Service for the certificate to take effect.

      NOTE
      If you manually restart the Nginx service on the server, the certificate does not take effect. You must restart the server on the WebUI.

    Updating the Working Key

    The working key is used to encrypt the password for starting the Nginx service. For security purposes, you are advised to update the working key periodically.

    1. On the WebUI, click in the upper right corner and choose Web Server Certificate.

    2. Click More and choose Update Working Key, as shown in Figure 14.

      Figure 14 Update Working Key

    3. Click More and choose Restart Service for the working key to take effect.

    Viewing the Release Information

    Prerequisites

    You have logged in to x2openEuler.

    Procedure

    1. Choose > About in the upper right corner.

    2. View information such as version and release date, as shown in Figure 15.

      Figure 15 Release information

    Viewing the Disclaimer

    Prerequisites

    You have logged in to x2openEuler.

    Procedure

    1. Choose > Disclaimer in the upper right corner, as shown in Figure 16.

      Figure 16 Disclaimer

    2. Read the disclaimer carefully.

    Querying Version Information on the CLI

    Command Function

    Query the version of the current x2openEuler.

    Syntax

    x2openEuler -v
    

    NOTE
    /usr/local/x2openEuler is the x2openEuler installation directory. Replace it with the actual directory.

    Example

    1. Run the following command to check whether the x2openEuler user has the login permission:

      vi /etc/passwd
      

      If the command output contains the following information, the user has the login permission. Otherwise, add the following content to the /etc/passwd file and save the file:

      x2openEuler:x:1000:1000::/home/x2openEuler:/bin/bash
      

      NOTE
      After the query operation is complete, restore the original configuration to ensure the security of the operating environment.

    2. Switch to the x2openEuler user.

      su x2openEuler
      

      Query the x2openEuler version.

      x2openEuler -v
      
    3. The returned information is the version of x2openEuler.

      x2openEuler x.x.x.x
      

    Configuring Rollback Consistency Check Filters

    Prerequisites

    You have logged in to x2openEuler.

    Procedure

    1. Choose > Rollback Consistency Check Filters in the upper right corner. The Rollback Consistency Check Filters page is displayed.

    2. Configure rollback consistency check filters by referring to Table 7. Regular expressions can be used in the configuration values.

      Table 7 Parameters

      ParameterDescription
      Software ConfigurationsSoftware configurations to be excluded from the consistency check.
      Software PackagesSoftware packages to be excluded from the consistency check.
      FilesFiles to be excluded from the consistency check.
      Service ConfigurationsService configurations to be excluded from the consistency check.
      Kernel ParametersKernel parameters to be excluded from the consistency check.
    3. Click OK to save the configurations.

      NOTE
      Some items may become inconsistent after the rollback. You can exclude these items from the rollback consistency check. The configuration takes effect after the next rollback.

    Generating and Configuring a Key

    Prerequisites

    • x2openEuler has been deployed.
    • An SSH remote connection tool has been installed on the local PC.

    Procedure

    1. Use an SSH tool to remotely log in to the node to be upgraded and enter the Linux CLI. Run the following commands to generate a key and change the public key name:

      ssh-keygen
      cd /root/.ssh
      mv id_rsa.pub authorized_keys
      

      NOTE

      • After entering the ssh-keygen command, input information as prompted.
      • After the name of id_rsa.pub is changed, ensure that the value of AuthorizedKeysFile in the /etc/ssh/sshd_config file is .ssh/authorized_keys.
    2. Open the /etc/ssh/sshd_config:

      vi /etc/ssh/sshd_config
      

      Uncomment the following content to enable key authentication:

      PubkeyAuthentication yes
      

      Then, press Esc, enter :wq, and press Enter to save the modification and exit.

    3. Run the following command to restart the SSH service for the configuration to take effect:

      systemctl restart sshd
      
    4. Transfer the id_rsa file to the node where x2openEuler is deployed.

    5. Use an SSH tool to remotely log in to the node to be upgraded and enter the Linux CLI.

    6. Move the id_rsa file on the node to be upgraded to the /opt/x2openEuler directory and run the following commands to change the permission, owner, and owner group of id_rsa:

      chown x2openEuler:x2openEuler id_rsa
      chmod 600 id_rsa
      
    7. When adding a node or importing nodes in a batch to x2openEuler, set Authentication Mode to Key authentication.

    Uploading an OS Database Support Package

    Prerequisites

    x2openEuler has been installed.

    An OS database support package has been downloaded to the local PC.

    Procedure

    1. Download an OS database support package from the openEuler extension repository to the local PC.

      This document uses the OS database support package required for upgrading CentOS 7.3 to openEuler 22.03 LTS as an example.

      1. Enter the following directory:

        openEuler-22.03-LTS/contrib/x2openEuler/noarch/Packages/
        

        NOTE
        In the path:

        • openEuler-22.03-LTS indicates the target OS.

        • noarch indicates the OS platform, which can be aarch or x86_64.

      2. Obtain the following OS database support packages:

        Table 8 OS database support packages

        PackageDescription
        x2openEuler-database-centos7.3-openEuler22.03-LTS-2.0.0.630-1.noarch.rpmOS database support package for upgrading the source OS to the target OS
        x2openEuler-database-centos7.3-2.0.0.630-1.noarch.rpmOS database support package of the source OS
        x2openEuler-database-openEuler22.03-LTS-2.0.0.630-1.noarch.rpmOS database support package of the target OS
    2. Use an SSH tool to remotely log in to the x2openEuler deployment environment and upload the OS database support packages to the following directory:

      /etc/x2openEuler/rpms/databases
      

      NOTE
      By default, x2openEuler supports CentOS 7.6 as the source OS and openEuler 20.03 LTS SP1 as the target OS. Therefore, if you need to upgrade other OSs to openEuler 20.03 LTS SP1, you do not need to upload the OS database support package of the target OS.

    3. Log in to the x2openEuler WebUI. When creating a task, choose CentOS 7.3 as the source OS and openEuler 22.03 LTS as the target OS.

    Customizing the Health Inspection

    Prerequisites

    • x2openEuler has been deployed.
    • The environment of the node to be upgraded has been checked.

    Procedure

    1. Use an SSH tool to log in to the node to be upgraded and enter the following path:

      /usr/lib/x2openEuler-upgrade/src/env_check/check_actor/
      
    2. Add an actor by referring to the following code, which checks whether the available memory is greater than 1 GB.

      NOTE
      An actor is a Python file. After composing the actor code on the local PC, upload the code to the /usr/lib/x2openEuler-upgrade/src/env_check/check_actor directory on the node to be upgraded. x2openEuler automatically reads and parses all actor files in check_actor, and executes the code in the corresponding processes. Execution of the actor does not require remote connection.

      # -*- coding: utf-8 -*-
      from src.env_check.check_actor.base_check_actor import BaseCheckActor, ReturnMessage
      from src.env_check.check_scheduler.register import register_func
      from src.utils.command.command_executor import CommandExecutor
      from src.utils.log.logger_generator import LoggerGenerator
      LOG = LoggerGenerator().get_logger()
      
      
      @register_func.register                               # Register, which automatically registers the actor and is mandatory
      class MemoryUsageStatisticsActor(BaseCheckActor):
          name = "MemoryUsageStatisticsActor"               # Actor name, which will be displayed on the frontend.
          description = "get memory usage statistics"       # Actor description, which will be displayed on the frontend.
          level = "Low"                                     # Actor level, which is reserved but not used
          sort = "100"                                      # Priority. Decimals are supported. A smaller value indicates a higher priority. The value cannot be less than 10.
          priority = "unnecessary"                          # Actor necessity, which can be mandatory or unnecessary. If a mandatory actor fails, the related step fails.
          task_type = (BaseCheckActor.task_type.SYSTEM_UPGRADE,)         # Actor type. An actor is executed when the type matches the task. SYSTEM_UPGRADE corresponds to environment check tasks.
      
          @staticmethod
          def run(node: dict):                              # node is a dictionary that records node-related information. To view the content, use LOG.info(node) to record it in logs. The run() method must be implemented.
              LOG.info("start to get memory usage info...")
              used_size, total_size = MemoryUsageStatisticsActor._get_memory_usage()                         # Obtains memory data.
              if used_size < 0 or total_size < 0 or total_size < 1024*1024:                                  # Compares memory sizes.
                  return ReturnMessage(result=BaseCheckActor.FAIL,                                                                     
                                      solution="Check the output of the free -k command.",
                                      failed_reason="Failed to obtain the memory usage by using the free -k command, or the memory value is less than 1 GB.")                     # A value of the ReturnMessage type must be returned.
              info = f"Memory usage (used memory/total memory): {round(used_size / 1024, 1)}MB / {round(total_size / 1024, 1)}MB"     
              return ReturnMessage(result=BaseCheckActor.SUCCESS, solution=info, failed_reason="")           # A value of the ReturnMessage type must be returned. If the actor fails, failed_reason and solution will be displayed on the frontend.
      
          @staticmethod
          def _get_memory_usage() -> (int, int):
              cmd = ["free", "-k"]                                                                           # The free -k command is used to obtain the used memory.
              stdout, _, return_code = CommandExecutor.run_single_cmd(cmd, timeout=15)                       # Executes the command. The return values are the command output, error output, and exit code.
              if return_code or not stdout:
                  return -1, -1
              for line in stdout.splitlines():
                  if not line.startswith('Mem:'):                                                            # Obtains key information.
                      continue
                  words = line.split()
                  total_size = int(words[1])
                  used_size = int(words[2])
                  return used_size, total_size
      
    3. Log in to x2openEuler, create an upgrade task, and perform the environment check after the upgrade.

    Customizing the Environment Check

    Prerequisites

    x2openEuler has been deployed.

    Procedure

    1. Use an SSH tool to log in to the node where x2openEuler is deployed and enter the following path:

      /usr/local/x2openEuler/portal/src/taskmanager/actors/env_check_actor
      
    2. Add an actor by referring to the following code.

      NOTE
      An actor is a Python file. After composing the actor code on the local PC, upload the code to the /usr/local/x2openEuler/portal/src/taskmanager/actors/env_check_actor directory on the node to be upgraded. x2openEuler automatically reads and parses all actor files in check_actor, and executes the code in the corresponding processes. Execution of the actor does not require remote connection.

      # -*- coding: utf-8 -*-
      from src.env_check.check_actor.base_check_actor import BaseCheckActor, ReturnMessage
      from src.env_check.check_scheduler.register import register_func
      from src.utils.command.command_executor import CommandExecutor
      from src.utils.log.logger_generator import LoggerGenerator
      LOG = LoggerGenerator().get_logger()
      
      
      @register_func.register                               # Register, which automatically registers the actor and is mandatory
      class MemoryUsageStatisticsActor(BaseCheckActor):
          name = "MemoryUsageStatisticsActor"               # Actor name, which will be displayed on the frontend.
          description = "get memory usage statistics"       # Actor description, which will be displayed on the frontend.
          level = "Low"                                     # Actor level, which is reserved but not used
          sort = "100"                                      # Priority. Decimals are supported. A smaller value indicates a higher priority. The value cannot be less than 10.
          priority = "unnecessary"                          # Actor necessity, which can be mandatory or unnecessary. If a mandatory actor fails, the related step fails.
          task_type = (BaseCheckActor.task_type.PRE_SYSTEM_UPGRADE,)         # Actor type. An actor is executed when the type matches the task. PRE_SYSTEM_UPGRADE corresponds to environment check tasks.
      
          @staticmethod           
          def run(node: dict):                              # node is a dictionary that records node-related information. To view the content, use LOG.info(node) to record it in logs. The run() method must be implemented.
              LOG.info("start to get memory usage info...")
              used_size, total_size = MemoryUsageStatisticsActor._get_memory_usage()                         # Obtains memory data.
              if used_size < 0 or total_size < 0 or total_size < 1024*1024:                                  # Compares memory sizes.
                  return ReturnMessage(result=BaseCheckActor.FAIL,                                                                     
                                      solution="Check the output of the free -k command.",
                                      failed_reason="Failed to obtain the memory usage by using the free -k command, or the memory value is less than 1 GB.")                     # A value of the ReturnMessage type must be returned.
              info = f"Memory usage (used memory/total memory): {round(used_size / 1024, 1)}MB / {round(total_size / 1024, 1)}MB"     
              return ReturnMessage(result=BaseCheckActor.SUCCESS, solution=info, failed_reason="")           # A value of the ReturnMessage type must be returned. If the actor fails, failed_reason and solution will be displayed on the frontend.
      
          @staticmethod
          def _get_memory_usage() -> (int, int):
              cmd = ["free", "-k"]                                                                           # The free -k command is used to obtain the used memory.
              stdout, _, return_code = CommandExecutor.run_single_cmd(cmd, timeout=15)                       # Executes the command. The return values are the command output, error output, and exit code.
              if return_code or not stdout:
                  return -1, -1
              for line in stdout.splitlines():
                  if not line.startswith('Mem:'):                                                            # Obtains key information.
                      continue
                  words = line.split()
                  total_size = int(words[1])
                  used_size = int(words[2])
                  return used_size, total_size
      
    3. After adding the actor, run the following command to restart the Gunicorn service.

      systemctl restart gunicorn_x2openEuler.service
      
    4. Log in to the x2openEuler WebUI and perform the environment check.

    Customizing the Pre-upgrade Check

    Prerequisites

    x2openEuler has been deployed.

    An upgrade task has been created.

    Procedure

    1. Use an SSH tool to log in to the node to be upgraded and enter the following path:

      /usr/lib/x2openEuler-upgrade/src/env_check/check_actor/
      
    2. Add an actor to the pre-upgrade check by referring to the following code, which checks whether the available memory is greater than 1 GB.

      NOTE
      An actor is a Python file. After composing the actor code on the local PC, upload the code to the /usr/lib/x2openEuler-upgrade/src/env_check/check_actor/ directory on the node to be upgraded where x2openEuler-upgrade is deployed. x2openEuler automatically reads and parses all actor files in check_actor, and executes the code in the corresponding processes. Execution of the actor does not require remote connection.

      # -*- coding: utf-8 -*-
      from src.env_check.check_actor.base_check_actor import BaseCheckActor, ReturnMessage
      from src.env_check.check_scheduler.register import register_func
      from src.utils.command.command_executor import CommandExecutor
      from src.utils.log.logger_generator import LoggerGenerator
      LOG = LoggerGenerator().get_logger()
      
      
      @register_func.register                               # Register, which automatically registers the actor and is mandatory
      class MemoryUsageStatisticsActor(BaseCheckActor):
          name = "MemoryUsageStatisticsActor"               # Actor name, which will be displayed on the frontend.
          description = "get memory usage statistics"       # Actor description, which will be displayed on the frontend.
          level = "Low"                                     # Actor level, which is reserved but not used
          sort = "100"                                      # Priority. Decimals are supported. A smaller value indicates a higher priority. The value cannot be less than 10.
          priority = "unnecessary"                          # Actor necessity, which can be mandatory or unnecessary. If a mandatory actor fails, the related step fails.
          task_type = (BaseCheckActor.task_type.AFTER_SYSTEM_CHECK,)         # Actor type. An actor is executed when the type matches the task. AFTER_SYSTEM_CHECK corresponds to environment check tasks.
      
          @staticmethod           
          def run(node: dict):                              # node is a dictionary that records node-related information. To view the content, use LOG.info(node) to record it in logs. The run() method must be implemented.
              LOG.info("start to get memory usage info...")
              used_size, total_size = MemoryUsageStatisticsActor._get_memory_usage()                         # Obtains memory data.
              if used_size < 0 or total_size < 0 or total_size < 1024*1024:                                  # Compares memory sizes.
                  return ReturnMessage(result=BaseCheckActor.FAIL,                                                                     
                                      solution="Check the output of the free -k command.",
                                      failed_reason="Failed to obtain the memory usage by using the free -k command, or the memory value is less than 1 GB.")                     # A value of the ReturnMessage type must be returned.
              info = f"Memory usage (used memory/total memory): {round(used_size / 1024, 1)}MB / {round(total_size / 1024, 1)}MB"     
              return ReturnMessage(result=BaseCheckActor.SUCCESS, solution=info, failed_reason="")           # A value of the ReturnMessage type must be returned. If the actor fails, failed_reason and solution will be displayed on the frontend.
      
          @staticmethod
          def _get_memory_usage() -> (int, int):
              cmd = ["free", "-k"]                                                                           # The free -k command is used to obtain the used memory.
              stdout, _, return_code = CommandExecutor.run_single_cmd(cmd, timeout=15)                       # Executes the command. The return values are the command output, error output, and exit code.
              if return_code or not stdout:
                  return -1, -1
              for line in stdout.splitlines():
                  if not line.startswith('Mem:'):                                                            # Obtains key information.
                      continue
                  words = line.split()
                  total_size = int(words[1])
                  used_size = int(words[2])
                  return used_size, total_size
      
    3. Log in to the x2openEuler WebUI and perform the pre-upgrade check again.

    Forcibly Deleting a Node

    Prerequisites

    x2openEuler has been installed.

    You have created a task involving node operations.

    Procedure

    NOTICE
    To ensure the security of the environment on the x2openEuler deployment node, do not perform operations on the database unless necessary.

    1. Use an SSH tool to log in to the x2openEuler deployment node, run the following command, and enter the password to log in to the database:

      mysql -u user -p
      

      NOTE
      user indicates the database user.

    2. Run the following SQL statement on the database terminal to forcibly delete the node:

      delete from taskmanager_report where step_id in (select id from taskmanager_step where node_id = (select id from taskmanager_node where ip_address='x.x.x.x' and port=22));
      delete from taskmanager_step where node_id = (select id from taskmanager_node where ip_address='x.x.x.x' and port=22);
      delete from taskmanager_node where ip_address='x.x.x.x' and port=22;
      

      NOTE
      In the statements, x.x.x.x indicates the IP address of the node to be upgraded, and 22 indicates the SSH port of the node to be upgraded.

    Forcibly Changing the Database Password

    Prerequisites

    x2openEuler has been deployed.

    Procedure

    NOTICE
    To ensure the security of the environment on the x2openEuler deployment node, do not perform operations on the database unless necessary.

    1. Use an SSH tool to remotely log in to the Linux CLI.

    2. Run the following command to log in to MariaDB:

      mysql -u root -p;
      
    3. After logging in to the database, run the following SQL statements to change the password of the x2openEuler user:

      use mysql;
      UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='x2openEuler';
      flush privileges;
      

      NOTE
      In the statements, password indicates the new password.

      After the password is set, exit the database terminal.

    4. Run the following command to synchronize the new password to x2openEuler:

      bash /usr/local/x2openEuler/portal/service/update_db_pwd.sh
      

    Bug Catching

    Buggy Content

    Bug Description

    Submit As Issue

    It's a little complicated....

    I'd like to ask someone.

    PR

    Just a small problem.

    I can fix it online!

    Bug Type
    Specifications and Common Mistakes

    ● Misspellings or punctuation mistakes;

    ● Incorrect links, empty cells, or wrong formats;

    ● Chinese characters in English context;

    ● Minor inconsistencies between the UI and descriptions;

    ● Low writing fluency that does not affect understanding;

    ● Incorrect version numbers, including software package names and version numbers on the UI.

    Usability

    ● Incorrect or missing key steps;

    ● Missing prerequisites or precautions;

    ● Ambiguous figures, tables, or texts;

    ● Unclear logic, such as missing classifications, items, and steps.

    Correctness

    ● Technical principles, function descriptions, or specifications inconsistent with those of the software;

    ● Incorrect schematic or architecture diagrams;

    ● Incorrect commands or command parameters;

    ● Incorrect code;

    ● Commands inconsistent with the functions;

    ● Wrong screenshots.

    Risk Warnings

    ● Lack of risk warnings for operations that may damage the system or important data.

    Content Compliance

    ● Contents that may violate applicable laws and regulations or geo-cultural context-sensitive words and expressions;

    ● Copyright infringement.

    How satisfied are you with this document

    Not satisfied at all
    Very satisfied
    Submit
    Click to create an issue. An issue template will be automatically generated based on your feedback.
    Bug Catching
    编组 3备份