為 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
控制應用程式檔案
如要控管要納入或排除哪些應用程式檔案,請更新 configurations
和 resources
欄位。
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 版本。
- TARGET_EDITION:WebSphere 版本。格式:[Base|Core|Open|ND]。
自訂目標容器
如要自訂應用程式要使用的目標容器,請更新 targetContainer
欄位。
applications:
- path: app.war
targetContainer:
baseImage: BASE_IMAGE
home: HOME
server: SERVER
user: USER
group: GROUP
自訂 Kubernetes 密鑰
根據預設,keystores
欄位下列出的檔案會遷移至 Kubernetes 機密資料。如要原封不動地遷移這些檔案,可以停用這項功能。
applications:
- path: app.war
resources:
keystores:
- key.p12
targetContainer:
# Do not migrate keystores to Kubernetes secrets:
enableSecrets: false
自訂 Kubernetes 連接埠
如要控管 Kubernetes Pod 和服務公開的通訊埠,請更新 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
後續步驟
- 瞭解如何執行遷移作業。