Henry
发布于 2024-09-28 / 51 阅读
0
0

PEGA 8.7 升级至 PEGA Infinity 23

背景

调研 PEGA 8.x 升级至 PEGA Infinity 23,因此做个记录,仅供学习参考。

前置条件

请确保以下软件已安装,版本可根据个人需求进行变更

Note: 记得备份!备份!备份!

升级步骤

容器镜像申请

官方教程

添加 PEGA Helm 仓库

官方教程

使用 helm repo add 指令添加 PEGA helm 仓库

root@k8s-master:/vm-server/dev/pega23/helm# helm repo add pega https://pegasystems.github.io/pega-helm-charts
"pega" has been added to your repositories

验证仓库列表

root@k8s-master:/vm-server/dev/pega23/helm# helm search repo pega
NAME                    CHART VERSION   APP VERSION     DESCRIPTION                                       
pega/pega               3.24.2                          Pega installation on kubernetes                   
pega/addons             3.24.2          1.0             A Helm chart for Kubernetes                       
pega/backingservices    3.24.2                          Helm Chart to provision the latest Search and R...

下载 helm 配置文件

根据自身需求分别下载 pega/pega, pega/addons and pega/backingservices 中的 values 配置文件。

本次笔记内容包含 pega/pegapega/backingservices

下载 pega/pega

 root@k8s-master:/vm-server/dev/pega23/helm# helm inspect values pega/pega > pega.yaml

下载 pega/backingservices

root@k8s-master:/vm-server/dev/pega23/helm# helm inspect values pega/backingservices > backingservices.yaml

查看文件

root@k8s-master:/vm-server/dev/pega23/helm# ls -alh
total 52K
drwxr-xr-x 2 root root 4.0K Aug 28 17:09 .
drwxr-xr-x 5 root root 4.0K Aug 28 16:53 ..
-rw-r--r-- 1 root root 9.0K Aug 28 17:09 backingservices.yaml
-rw-r--r-- 1 root root  30K Aug 28 17:08 pega.yaml

升级数据库

配置 pega_upgrade.yaml (pega.yaml 的复制品)

---
global:
  # This values.yaml file is an example.  For more information about
  # each configuration option, see the project readme.

  # Enter your Kubernetes provider.
  provider: "k8s"

  # Enter a name for the deployment if using multi-tenant services such as the Search and Reporting Service.
  customerDeploymentId:

  deployment:
    # The name specified will be used to prefix all of the Pega pods (replacing "pega" with something like "app1-dev").
    name: "dev-upgrade"

  # Deploy Pega nodes
  actions:
    execute: "upgrade"

  # Add custom certificates to be mounted to container
  # to support custom certificates as plain text (less secure), pass them directly using the certificates parameter;
  # to support multiple custom certificates as external secrets, specify each of your external secrets
  # as an array of comma-separated strings using the certificatesSecrets parameter.
  certificatesSecrets: []
  certificates: {}

  # Add krb5.conf file content here.
  # Feature is used for Decisioning data flows to fetch data from Kafka or HBase streams
  kerberos: {}

  # If a storage class to be passed to the VolumeClaimTemplates in search and stream pods, it can be specified here:
  storageClassName: ""
  # Provide JDBC connection information to the Pega relational database
  #   If you are installing or upgrading on IBM DB2, update the udb.conf file in the /charts/pega/charts/installer/config/udb directory with any additional connection properties.
  jdbc:
    #   url     Valid values are:
    #
    #   Oracle              jdbc:oracle:thin:@//localhost:1521/dbName
    #   IBM DB/2 z / OS         jdbc:db2://localhost:50000/dbName
    #   IBM DB/2            jdbc:db2://localhost:50000/dbName:fullyMaterializeLobData=true;fullyMaterializeInputStreams=true;
    #                       progressiveStreaming=2;useJDBC4ColumnNameAndLabelSemantics=2;
    #   SQL Server          jdbc:sqlserver://localhost:1433;databaseName=dbName;selectMethod=cursor;sendStringParametersAsUnicode=false
    #   PostgreSQL          jdbc:postgresql://localhost:5432/dbName
    url: "jdbc:postgresql://dev-upgrade-db-svc:5432/postgres"
    #   driverClass     -- jdbc class.  Valid values are:
    #
    #   Oracle              oracle.jdbc.OracleDriver
    #   IBM DB/2            com.ibm.db2.jcc.DB2Driver
    #   SQL Server          com.microsoft.sqlserver.jdbc.SQLServerDriver
    #   PostgreSQL          org.postgresql.Driver
    driverClass: "org.postgresql.Driver"
    #   pega.database.type      Valid values are: mssql, oracledate, udb, db2zos, postgres
    dbType: "postgres"
    #   For databases that use multiple JDBC driver files (such as DB2), specify comma separated values for 'driverUri'
    driverUri: "https://jdbc.postgresql.org/download/postgresql-42.7.3.jar"
    username: "postgres"
    password: "postgres"
    # To avoid exposing username & password, leave the jdbc.password & jdbc.username parameters empty (no quotes),
    # configure JDBC username & password parameters in the External Secrets Manager, and enter the external secret for the credentials
    # make sure the keys in the secret should be DB_USERNAME and DB_PASSWORD respectively
    external_secret_name: ""
    # CUSTOM CONNECTION PROPERTIES
    # Use the connectionProperties parameter to pass connection settings to your deployment
    # by adding a list of semi-colon-delimited required connection setting. The list string must end with ";".
    # For example, you can set a custom authentication using Azure Managed Identity and avoid using a password.
    # To pass an Authentication method and a managed identity, MSI Client ID,
    # set: connectionProperties: "Authentication=ActiveDirectoryMSI;msiClientId=<your Azure Managed Identity>;"
    connectionProperties: ""
    rulesSchema: "rules"
    dataSchema: "data"
    customerDataSchema: ""

	****** 
	
  docker:
    # If using a custom Docker registry, supply the credentials here to pull Docker images.
    registry:
      url: "pega-docker.downloads.pega.com"
      username: "pega_provide_UserID"
      password: "pega_provide_APIKey"
    # To avoid exposing Docker registry details, create secrets to manage your Docker registry credentials.
    # Specify secret names as an array of comma-separated strings in double quotation marks using the imagePullSecre>
    imagePullSecretNames: []
    # Docker image information for the Pega docker image, containing the application server.
    
      ******

# Cassandra automatic deployment settings.
cassandra:
  enabled: false
  persistence:
    enabled: true
    
    external_secret_name: ""


	****** 

# Pega Installer settings.
installer:
  image: "platform/installer:8.23.1"
  # Set the initial administrator@pega.com password for your installation.  This will need to be changed at first login.
  # The adminPassword value cannot start with "@".
  adminPassword: "install"
  # Upgrade specific properties
  upgrade:
    # Type of upgrade
    # Valid upgradeType values are 'in-place' , 'zero-downtime' , 'custom' , 'out-of-place-rules' , 'out-of-place-data' .
    upgradeType: "in-place"
    # Specify a name for a target rules schema that the upgrade process creates for patches and upgrades.
    targetRulesSchema: "pega_rules"
    # Specify a name for a target data schema that the upgrade process creates for patches and upgrades.
    # For postgres databases that you are upgrading from Pega Infinity version 8.4.0 and later
    # And for Oracle databases that you are upgrading from Pega Infinity version 8.4.3 and later.
    targetDataSchema: "pega_data"
    # Specify the username and password to access the pre-upgrade Pega Platform to perform pre- and post- actions during zero-downtime upgrades.
    pegaRESTUsername: ""
    pegaRESTPassword: ""
    
    ******
    

Note: 根据各自的需求进行配置项的更新。

部署 PEGA upgrade 容器

root@k8s-master:/vm-server/dev/pega_upgrade# helm install dev-upgrade-db pega/pega -n dev-upgrade --values pega_upgrade.yaml 
NAME: dev-upgrade-db
LAST DEPLOYED: Thu Sep 26 22:58:36 2024
NAMESPACE: dev-upgrade
STATUS: deployed
REVISION: 1
TEST SUITE: None

查看容器

root@k8s-master:/vm-server/dev/pega23/k8s_deploy# kubectl get pod -n dev-upgrade
NAME                              READY   STATUS    RESTARTS   AGE
dev-upgrade-db-65b74bcfdf-v5znb   1/1     Running   0          48m
pega-in-place-upgrade-c88g2       1/1     Running   0          2m53s

查看升级日志

root@k8s-master:/vm-server/dev/pega23/k8s_deploy# kubectl logs -f --tail 10 pega-in-place-upgrade-c88g2 -n dev-upgrade
     [echo] Calling engine load utility...
     [exec] Picked up JAVA_TOOL_OPTIONS: -Duser.home=/usr/share/pegauser
     [exec] 2024-09-26 15:01:29.758 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
     [exec] 2024-09-26 15:01:29.992 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed.
     [exec] 2024-09-26 15:01:29.995 [main] INFO com.pega.codeloader.MainKt - Successfully established connection to database
     [exec] 2024-09-26 15:01:30.001 [main] INFO com.pega.codeloader.MainKt - Database Type...: PostgreSQL
     [exec] 2024-09-26 15:01:30.001 [main] INFO com.pega.codeloader.MainKt - Database Version: 11.3 (Debian 11.3-1.pgdg90+1)
     [exec] 2024-09-26 15:01:30.001 [main] INFO com.pega.codeloader.MainKt - Driver Type.....: PostgreSQL JDBC Driver
     [exec] 2024-09-26 15:01:30.001 [main] INFO com.pega.codeloader.MainKt - Driver Version..: 42.7.3
     [exec] 2024-09-26 15:01:34.082 [main] INFO com.pega.codeloader.engine.EngineCodeDeleter - Clearing existing contents of pega-enginecode:08-07-01
     [exec] 2024-09-26 15:09:00.288 [main] INFO com.pega.codeloader.AbstractFastCodeLoader - Starting code import of 830 jars from /opt/pega/temp/PegaInstallTemp-26-September-2024-14.59.04/load/lib
     [exec] 2024-09-26 15:09:00.826 [main] INFO com.pega.codeloader.AbstractFastCodeLoader - Loading with 2 thread(s)
     [exec] 2024-09-26 15:09:00.838 [ForkJoinPool-1-worker-3] INFO com.pega.codeloader.AbstractFastCodeLoader - Loading base/activation-1.1.1.jar ...
     [exec] 2024-09-26 15:09:00.838 [ForkJoinPool-1-worker-1] INFO com.pega.codeloader.AbstractFastCodeLoader - Loading base/java6/backport-util-concurrent-3.1.jar ...
     [exec] 2024-09-26 15:09:07.783 [ForkJoinPool-1-worker-3] INFO com.pega.codeloader.AbstractFastCodeLoader - Loading base/java6/prbasejava6.jar ...
     [exec] 2024-09-26 15:09:10.322 [ForkJoinPool-1-worker-3] INFO com.pega.codeloader.AbstractFastCodeLoader - Loading base/jing-1.0.jar ...

接下来等待数据库升级完成即可,容器状态为 Completed 表示升级已完成。

 root@k8s-master:/home/myserver# kubectl get pod -n dev-upgrade
NAME                              READY   STATUS      RESTARTS   AGE
dev-upgrade-db-65b74bcfdf-v5znb   1/1     Running     0          36h
pega-in-place-upgrade-c88g2       0/1     Completed   0          35h

查看部分升级日志

root@k8s-master:/home/myserver# kubectl logs --tail 20 pega-in-place-upgrade-c88g2 -n dev-upgrade
     [java] 0.06    minutes, or 0.02%   of the total time can be attributed to  load 28     records from rule-obj-jsp.zip
     [java] 0.24    minutes, or 0.08%   of the total time can be attributed to  load 22     records from rule-obj-fieldvalue_pega-lp-mobile.zip
     [java] 0.29    minutes, or 0.1%    of the total time can be attributed to  load 402    records from rule-edit-validate.zip
     [java] 0.03    minutes, or 0.01%   of the total time can be attributed to  load 1      records from rule-urlmappings.zip
     [java] 
     [java] ************************************************************************
     [java] 
     [copy] Copying 1 file to /opt/pega/kit/scripts/logs
      [zip] Building zip: /opt/pega/kit/scripts/logs/Upgrade Finalization-CollectedLogs_2024-09-26_14-59-03.zip
     [echo] Cleaning up temp directory...
   [delete] Deleting directory /opt/pega/temp/PegaInstallTemp-26-September-2024-14.59.04
   [delete] Deleting: /opt/pega/kit/scripts/resume.properties

Upgrade Finalization:
     [echo] PegaRULES Process Commander database upgrade complete.

BUILD SUCCESSFUL
Total time: 452 minutes 51 seconds
2024-09-26 14:59:16,416 (               UpgradeDataModelImpl)    INFO - Installed Product Versions: 
2024-09-26 14:59:16,443 (               UpgradeDataModelImpl)    INFO - {Instance: PEGARULES PROCESS COMMANDER!8.7.0, Upgraded from version: null, Build name: PRPC-8.7.0-163} (current version)

机械硬盘升级时间太感人了。

部署 PEGA Infinity 23

参考 PEGA Infinity 23 容器化部署 笔记中的下列步骤完成后续配置

  • 安装 kafka 作为 pega 的外部 stream 节点
  • 部署 PEGA Backing Services
  • 部署 PEGA 节点

部署完成后查看容器信息

root@k8s-master:/home/myserver# kubectl get pod,svc -n dev-upgrade
NAME                                                       READY   STATUS    RESTARTS   AGE
pod/clusteringservice-0                                    1/1     Running   0          2m49s
pod/dev-upgrade-batch-f678d9db9-6qlpn                      1/1     Running   0          2m50s
pod/dev-upgrade-constellation-767554b58f-7glcg             1/1     Running   0          7h12m
pod/dev-upgrade-constellation-messaging-5547b9c98b-5cr59   1/1     Running   0          7h5m
pod/dev-upgrade-db-65b74bcfdf-v5znb                        1/1     Running   0          45h
pod/dev-upgrade-kafka-controller-0                         1/1     Running   0          78m
pod/dev-upgrade-srs-7cb7db96cf-2l5rm                       1/1     Running   0          54m
pod/dev-upgrade-web-6954bb6c9f-sqs2d                       1/1     Running   0          2m50s
pod/elasticsearch-master-0                                 1/1     Running   0          54m
pod/pega-hazelcast-0                                       1/1     Running   0          2m49s

NAME                                            TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                      AGE
service/clusteringservice-service               ClusterIP   None             <none>        5701/TCP                     2m52s
service/dev-upgrade-constellation               NodePort    10.109.143.165   <none>        3000:30225/TCP               7h12m
service/dev-upgrade-constellation-messaging     NodePort    10.111.84.206    <none>        3000:31882/TCP               7h5m
service/dev-upgrade-db-svc                      NodePort    10.107.231.137   <none>        5432:30033/TCP               45h
service/dev-upgrade-kafka                       ClusterIP   10.99.36.197     <none>        9092/TCP                     78m
service/dev-upgrade-kafka-controller-headless   ClusterIP   None             <none>        9094/TCP,9092/TCP,9093/TCP   78m
service/dev-upgrade-srs                         ClusterIP   10.110.232.71    <none>        8080/TCP,80/TCP              54m
service/dev-upgrade-web                         NodePort    10.98.30.16      <none>        80:32643/TCP                 2m52s
service/elasticsearch-master                    ClusterIP   10.102.86.43     <none>        9200/TCP,9300/TCP            54m
service/elasticsearch-master-headless           ClusterIP   None             <none>        9200/TCP,9300/TCP            54m
service/pega-hazelcast-service                  ClusterIP   None             <none>        5701/TCP                     2m52s

至此,升级和部署就已经完成啦,剩下的就是校验升级后的环境是否可用了。

升级前和升级后系统比较

登录界面

本身便是 Personal Edition PEGA OOTB 的首页,没有变动。

Note: 左边为升级后的PEGA Infinity 23 的界面,右边为 PEGA 8.7 Personal Edition的界面。

Pega Platform Dev Studio

可以看到 PEGA 版本从已升级为 Pega Infinity '23 

Note: 左边为升级后的PEGA Infinity 23 的界面,右边为 PEGA 8.7 Personal Edition的界面。

Application User Portal

升级前的应用采用的是 Cosmos UI,升级后保留并兼容原 UI 架构

第一张为升级后的PEGA Infinity 23 的界面,第二张为 PEGA 8.7 Personal Edition的界面,可以看到没有任何变化。

流程

  • Assignment 页面,左边为升级后的PEGA Infinity 23 的界面,右边为 PEGA 8.7 Personal Edition的界面。

可以看到升级后针对页面进行了一些优化,比如左边侧边栏没有出现横向的滚动条。

  • Open Local Action 的弹出框也没有变化,基本控件能够正常使用。

  • 特殊的递归加载 Section 自定义功能看下来也没有变化(这里的Sub Group Name 是一个递归加载Section的逻辑)

  • 流程能够正常提交且正确更新数据。

其他配置

Admin Studio

  • Job Scheduler 也能够正常执行(这里系统升级准备和升级中间隔了一段时间,所以 Job 的 Last finished run 时间不匹配)

External Stream 节点

节点状态为 Normal 代表正常

System Settings

Pega Search Index 配置正常

简单的系统比较样例就到此位置啦,其他内容请自行对比~


评论