我要评分
获取效率
正确性
完整性
易理解

Configuring the General Middleware Migration Process

You can add Java middleware to the configuration file and follow the general migration process to enable its migration.

Procedure

  1. Use an SSH client to log in as the DevKit installation user and obtain the scanning rule file.

    The scanning rule file can be obtained from /opt/DevKit/devkitplugins/porting/cmd/bin/resources/sysmig_disk_scan_classifier.json.

  2. Use the SSH client to log in to the source node (x86) as the root user and place the obtained scanning rule file in the same directory as the node information collection script.
  3. Configure the scanning rule file.
    1
    vi sysmig_disk_scan_classifier.json
    

    Press i to enter the insert mode, and add the following content in bold (for example):

    {
      "linux_binary_classifiers": [
        {
          "cli_category": "MIDDLEWARE",
          "category": 3,
          "file_glob": "**/target/nacos-server.jar",
          "version_pattern": "(?m)Implementation-Version:\\s(?P<version>[0-9]+[.0-9]*)",
          "version_file": "MANIFEST.MF",
          "package": "Nacos",
          "supplier": "Alibaba",
          "type": "BINARY",
          "metadata_type": "MIDDLEWARE_WEB_ALIBABA_NACOS",
          "company_type": "Open-source",
          "relative_directory_hierarchy": "../",
          "mig_process_type": 1
        },
        {
          "cli_category": "RUNTIME_JAVA",
          "category": 3,
          "file_glob": "**/java",
          "version_pattern": "(?m)(\\x00java\\x00|\\x00|\\x00-Djava.class.path=%s)(?P<release>[0-9]+[.0-9]*(\\x00)+)?(?P<version>\\d+(\\.\\d)+[^\\x00]+)(\\x00openjdk)?(\\x00java)?\\x00",
          "version_file": "../release",
          "package": "JDK",
          "supplier": "JDK",
          "type": "BINARY",
          "metadata_type": "JAVA_RUNTIME_BINARY",
          "company_type": "Open-source",
          "relative_directory_hierarchy": "../",
          "mig_process_type": 0
        },  
        ...
      ],
      "middleware_jar_classifiers": [
        {
          "cli_category": "MIDDLEWARE",
          "category": 3,
          "file_glob": "**/weblogic.jar",
          "version_pattern": "(?m)Implementation-Version: (?P<version>[0-9]+[.0-9]*)",
          "version_file": "MANIFEST.MF",
          "package": "WebLogic",
          "supplier": "Oracle Corporation",
          "type": "BINARY",
          "metadata_type": "MIDDLEWARE_WEB_WEBLOGIC",
          "company_type": "Commercial",
          "relative_directory_hierarchy": "../../../../../",
          "mig_process_type": 0
        },  
        ...
      ], 
        ...
    }

    The software types are as follows. For details about the parameter description, see Table 1.

    • linux_binary_classifiers: software with non-compressed files, such as binary files and text files, in Linux.
    • middleware_jar_classifiers: software that needs to be extracted in Linux. The feature files are in the JAR format.
    Table 1 Rule description

    Parameter

    Option

    Required

    Description

    cli_category

    APP_JAVA/RUNTIME_JAVA/MIDDLEWARE/DATABASE/HARDWARE/OS

    Yes

    Software type. Set it to MIDDLEWARE.

    • APP_JAVA
    • RUNTIME_JAVA
    • MIDDLEWARE
    • DATABASE
    • HARDWARE
    • OS

    category

    1/2/3/4

    Yes

    Software type. Set it to 3.

    • 1: OS
    • 2: database
    • 3: middleware
    • 4: Java

    use_file_regex

    true/false

    No

    Indicates whether to use regular expression matching for the feature file. The default value is false.

    • false: The file_glob file must start with **/, which is followed by the file path.
    • true: Configure a regular expression for file_glob.

    file_glob

    -

    Yes

    Feature file, which is used to identify the software and match the software version.

    Example: **/nginx

    NOTE:

    The version matching priorities are file_glob and version_file in descending order.

    version_pattern

    -

    Yes

    Version. Regular expression, which is used to match the feature file. If there is no regular expression, leave it blank.

    version_file

    -

    No

    Version file name, which is used to match the version. This parameter is mandatory for middleware_jar_classifiers. The file contains the software version information.

    package

    -

    Yes

    Official software name, for example, Nginx.

    supplier

    -

    Yes

    Software vendor name, for example, Nginx, Inc.

    type

    BINARY

    Yes

    Software type. Set it to BINARY.

    metadata_type

    DATABASE_OTHER/MIDDLEWARE_WEB_OTHER

    Yes

    Software type.

    • Enter DATABASE_OTHER for databases.
    • Enter MIDDLEWARE_WEB_OTHER for middleware.

    company_type

    Self-owned/Open-source/Commercial/--

    Yes

    Indicates whether it is open-sourced.

    relative_directory_hierarchy

    -

    Yes

    Installation directory. Relative path to the feature file found based on file_glob.

    For example, if the installation directory is the parent directory of the feature file, enter ../.

    mig_process_type

    0/1

    Yes

    Identifies the middleware migration process.

    • 0: supported migration path.
    • 1: If the middleware is implemented in Java, cross-platform migration is supported, following the general middleware migration process.
  4. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.