搜索

第 32 章 进程实例迁移

download PDF

进程实例迁移(PIM)是包含用户界面和后端的独立服务。它被打包为 Quarkus mutable JAR 文件。您可以使用 PIM 服务来定义两个不同的进程定义之间的迁移,称为迁移计划。然后,用户可以将迁移计划应用到特定 KIE 服务器中正在运行的进程实例。

有关 PIM 服务的更多信息,请参阅 KIE(Drools、OptaPlanner 和 jBPM) 中的 处理实例迁移服务

32.1. 安装进程实例迁移服务

您可以使用流程实例迁移(PIM)服务来创建、导出和执行迁移计划。PIM 服务通过 GitHub 存储库提供。要安装 PIM 服务,请克隆 GitHub 存储库,然后运行该服务并在 Web 浏览器中访问该服务。

先决条件

  • 您已在备份的 Red Hat Process Automation Manager 开发环境中定义了进程。
  • 已安装 Java 运行时环境(JRE)版本 11 或更高版本。

流程

  1. 从 Red Hat Process Automation Manager 7.13 的 Software Downloads 页面中下载 rhpam-7.13.5-add-ons.zip 文件。
  2. 提取 rhpam-7.13.5-add-ons.zip 文件。
  3. 提取 rhpam-7.13.5-process-migration-service.zip 文件。
  4. 输入以下命令来创建数据库表。将 <user > 替换为您的用户名,& lt;host > 替换为本地主机的名称:

    $ psql -U <user> -h <host> -d rhpam7 -f ~/process-migration/ddl-scripts/postgres/postgresql-quartz-schema.sql
    $ psql -U <user> -h <host> -d rhpam7 -f ~/process-migration/ddl-scripts/postgres/postgresql-pim-schema.sql
  5. 将目录更改为 process-migration 目录。
  6. 使用文本编辑器,使用以下内容创建 servers.yaml 配置文件,并保存在 process-migration 目录中。在本例中,将 &lt ;user_name& gt ; 和 <password > 替换为要登录到 KieServer 的凭证。

    kieservers:
      - host: http://localhost:8080/kie-server/services/rest/server
        username: <user_name>
        password: <password>
  7. 使用文本编辑器创建 数据源.yaml 配置文件,并保存在 process-migration 目录中。在本例中,将 &lt ;user_name& gt ; 和 <password > 替换为要登录到数据库的凭证:

    quarkus:
      datasource:
        db-kind: postgresql
        jdbc:
          url: jdbc:postgresql://localhost:5432/rhpam7
        username: <user_name>
        password: <password>
  8. 重建 quarkus-run.jar 文件,使其包含 PostgreSQL 驱动程序:

    $ java -jar -Dquarkus.launch.rebuild=true -Dquarkus.datasource.db-kind=postgresql quarkus-app/quarkus-run.jar

    这个命令的输出应类似以下示例:

    INFO [io.qua.dep.QuarkusAugmentor] (main) Quarkus augmentation completed in 2657ms
  9. 运行 quarkus-app JAR 文件:

    $ java -jar -Dquarkus.http.port=8090 -Dquarkus.config.locations=servers.yaml,datasource.yaml quarkus-app/quarkus-run.jar

    这个命令返回类似以下示例的输出:

    __  ____  __  _____   ___  __ ____  ______
     --/ __ \/ / / / _ | / _ \/ //_/ / / / __/
     -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
    --\___\_\____/_/ |_/_/|_/_/|_|\____/___/
    2022-03-11 13:04:18,261 INFO  [org.fly.cor.int.lic.VersionPrinter] (main) Flyway Community Edition 7.14.0 by Redgate
    2022-03-11 13:04:18,262 INFO  [org.fly.cor.int.dat.bas.BaseDatabaseType] (main) Database: jdbc:postgresql://localhost:5432/rhpam7 (PostgreSQL 13.4)
    2022-03-11 13:04:18,280 INFO  [org.fly.cor.int.com.DbMigrate] (main) Current version of schema "public": 1.0
    2022-03-11 13:04:18,281 INFO  [org.fly.cor.int.com.DbMigrate] (main) Schema "public" is up to date. No migration necessary.
    2022-03-11 13:04:18,601 INFO  [org.qua.imp.jdb.JobStoreCMT] (main) Freed 0 triggers from 'acquired' / 'blocked' state.
    2022-03-11 13:04:18,603 INFO  [org.qua.imp.jdb.JobStoreCMT] (main) Recovering 0 jobs that were in-progress at the time of the last shut-down.
    2022-03-11 13:04:18,603 INFO  [org.qua.imp.jdb.JobStoreCMT] (main) Recovery complete.
    2022-03-11 13:04:18,603 INFO  [org.qua.imp.jdb.JobStoreCMT] (main) Removed 0 'complete' triggers.
    2022-03-11 13:04:18,603 INFO  [org.qua.imp.jdb.JobStoreCMT] (main) Removed 0 stale fired job entries.
    2022-03-11 13:04:18,624 INFO  [org.kie.ser.api.mar.MarshallerFactory] (main) Marshaller extensions init
    2022-03-11 13:04:18,710 INFO  [org.kie.pro.ser.imp.KieServiceImpl] (main) Loaded kie server configuration for: org.kie.processmigration.model.config.KieServers$KieServer9579928Impl@4b6b5352
    2022-03-11 13:04:18,715 INFO  [org.kie.pro.ser.RecoveryService] (main) Resuming ongoing migrations ...
    2022-03-11 13:04:18,856 INFO  [io.quarkus] (main) process-migration-service 7.59.0.Final-redhat-00006 on JVM (powered by Quarkus 2.2.3.Final-redhat-00013) started in 1.443s. Listening on: http://0.0.0.0:8090
    2022-03-11 13:04:18,857 INFO  [io.quarkus] (main) Profile prod activated.
    2022-03-11 13:04:18,857 INFO  [io.quarkus] (main) Installed features: [agroal, cdi, config-yaml, flyway, hibernate-orm, hibernate-orm-panache, jdbc-db2, jdbc-h2, jdbc-mariadb, jdbc-mssql, jdbc-mysql, jdbc-oracle, jdbc-postgresql, narayana-jta, quartz, resteasy, resteasy-jackson, scheduler, security, security-jdbc, security-ldap, security-properties-file, smallrye-context-propagation, smallrye-health]
  10. 要访问进程实例迁移应用程序,请在 Web 浏览器中输入 http://localhost:8090/
  11. 出现提示时,输入用户名 admin 和密码 admin1!。此时会出现 Process Instance Migration 控制台。
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.