התאמה אישית של תוכנית ההעברה לעומסי עבודה של 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 secrets. כדי להעביר את הקבצים האלה כמו שהם, אפשר להשבית את התכונה הזו.

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

התאמה אישית של יציאות Kubernetes

כדי לקבוע אילו יציאות נחשפות על ידי Kubernetes Pods ו-Services, מעדכנים את השדה 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

המאמרים הבאים