自定义 WebSphere 工作负载的迁移计划

准备工作

本文档假设您已经创建迁移并已有迁移计划文件。

修改迁移计划

复制并分析文件系统后,您可以在指定输出路径 ANALYSIS_OUTPUT_PATH/config.yaml 中创建的新目录中找到迁移计划。

根据需要修改迁移计划,然后保存更改。

查看迁移计划的详细信息和指导性注释以根据需要添加信息。

具体而言,请考虑针对以下部分的修改。

迁移计划结构

WebSphere 工作负载的迁移计划具有以下结构,您可以按照以下部分中的说明进行自定义。

# List of discovered WebSphere application servers and how to migrate their
# hosted applications to containers.
webSphereApplicationServers:
# The application server installation path.
- home: /opt/ibm/wlp
  applicationServerInfo:
    name: WebSphere Application Server
    profile: Liberty
    version: 23.0.0.4
    edition: Base
    # List of Java installations available to the application server.
    javaDevelopmentKits:
    - home: /opt/ibm/java
      vendor: IBM Corporation
      version:
        jdk: java version 1.8.0_361
        jre: Java(TM) SE Runtime Environment
        jvm: IBM J9 VM
  # List of hosted applications and how to migrate them to containers.
  applications:
  - path: /opt/ibm/wlp/usr/servers/defaultServer/apps/app.war
    # Application archives to be migrated into the target container.
    archives:
    - /opt/ibm/wlp/usr/servers/defaultServer/apps/app.war
    # Application configuration files to be migrated into the target container.
    configurations:
      serverXML: /opt/ibm/wlp/usr/servers/defaultServer/server.xml
      serverEnv:
      - /opt/ibm/wlp/usr/servers/defaultServer/server.env
      bootstrapProperties:
      - /opt/ibm/wlp/usr/servers/defaultServer/bootstrap.properties
      variableProperties:
      - /opt/ibm/wlp/usr/servers/defaultServer/variables/variable.properties
      jvmOptions:
      - /opt/ibm/wlp/usr/servers/defaultServer/jvm.options
    # Application resource files to be migrated into the target container.
    resources:
      locations:
      - /opt/ibm/wlp/usr/servers/defaultServer/resources/ports.xml
      libraries:
      - /opt/ibm/wlp/usr/servers/defaultServer/resources/postgresql.jar
      keystores:
      - /opt/ibm/wlp/output/defaultServer/resources/security/key.p12
      sharedResources:
        - /opt/ibm/wlp/usr/shared/resources/jdbc.jar
      additionalResources:
      - /opt/ibm/wlp/output/defaultServer/resources/mongodb.jar
    javaRuntime:
      se: SE8
      ee: EE7
      vendor: IBM Corporation
    targetJavaRuntime:
      se: SE8
      ee: EE7
      vendor: IBM Corporation
    targetApplicationServer:
      profile: Liberty
      version: 23.0.0.4
      edition: Base
    targetContainer:
      # The target container base image name.
      baseImage: ibmcom/websphere-liberty:full-java8-ibmjava-ubi
      # The application server installation path within the target container
      # base image.
      home: /opt/ibm/wlp
      # The application server default server name.
      server: defaultServer
      # The UID or name of the user configured within the target container
      # base image. Defaults to 1001 for Liberty profile.
      user: "1001"
      # The GID or name of the group configured within the target container
      # base image. Defaults to 0 for Liberty profile.
      group: "0"
      # Application ports to be exposed in Kubernetes artifacts.
      ports:
      - name: http-tcp-9080
        port: 9080
        protocol: TCP
      - name: https-tcp-9443
        port: 9443
        protocol: TCP
      # Specify whether discovered keystores are automatically converted to
      # Kubernetes secrets. Defaults to true.
      enableSecrets: true

排除应用

如需从迁移中排除应用,请从 applications 列表中移除相关应用。

  applications:
  # Exclude app1.war:
  # - path: app1.war
  #  ...
  - path: app2.war

控制应用文件

如需控制在迁移中包含或排除哪些应用文件,请更新 configurationsresources 字段。

  applications:
  - path: app.war
    resources:
      keystores:
      # Exclude key1.p12:
      # - key1.p12
      # Include key2.p12:
      - key2.p12
      additionalResources:
      # Exclude resource1.xml:
      # - resource1.xml
      # Include resource2.xml:
      - resource2.xml

自定义目标 Java 运行时

如需自定义应用的目标 Java 运行时,请更新 targetJavaRuntime 字段。

  applications:
  - path: app.war
    targetJavaRuntime:
      se: SE
      ee: EE
      vendor: VENDOR

替换以下内容:

  • SE:Java SE 版本。格式:[SE8|SE11|SE17]。
  • EE:Java EE 或 Jakarta EE 版本。格式:[EE7|EE8|EE9|EE10]。
  • VENDOR:Java 供应商。格式:[IBM Corporation|Oracle Corporation]。

自定义目标应用服务器

如需自定义应用的目标应用服务器,请更新 targetApplicationServer 字段。

  applications:
  - path: app.war
    targetApplicationServer:
      profile: PROFILE
      version: VERSION
      edition: EDITION

替换以下内容:

  • PROFILE:WebSphere 配置文件。格式:[Liberty|Traditional]。
  • TARGET_VERSION:WebSphere 版本号 (version)。
  • TARGET_EDITION:WebSphere 版本 (edition)。格式:[Base|Core|Open|ND]。

自定义目标容器

如需自定义要用于应用的目标容器,请更新 targetContainer 字段。

  applications:
  - path: app.war
    targetContainer:
      baseImage: BASE_IMAGE
      home: HOME
      server: SERVER
      user: USER
      group: GROUP

自定义 Kubernetes Secret

默认情况下,keystores 字段下列出的文件会迁移到 Kubernetes Secret。如需按原样迁移这些文件,您可以停用此功能。

  applications:
  - path: app.war
    resources:
      keystores:
      - key.p12
    targetContainer:
      # Do not migrate keystores to Kubernetes secrets:
      enableSecrets: false

自定义 Kubernetes 端口

如需控制 Kubernetes Pod 和 Service 开放哪些端口,请更新 ports 字段。

  applications:
  - path: app.war
    targetContainer:
      ports:
      # Exclude http-tcp-9080:
      # - name: http-tcp-9080
      #   port: 9080
      #   protocol: TCP
      # Include https-tcp-9443:
      - name: https-tcp-9443
        port: 9443
        protocol: TCP

后续步骤