camunda_13_postgresql

前面都是使用H2数据库, 体验功能非常方便, 但分析table数据就比较麻烦了, 下面介绍如何使用postgresql作为后台数据库.
按照Camunda官方文档, 生产环境优先推荐Oracle 和 Postgresql, 当然MySQL和SQL Server也是支持的.
官方参考架构文档

下载并安装 postgresql

按照camunda和操作系统的要求, 我选择的是 postgresql 10.
安装过程序需要设定端口和超级账号 postgres 的密码.
下载网址

下载 jdbc driver

通过 dbeaver 软件很方便下载 postgresql jdbc driver, 并复制一份 jar 到 camunda 的 configuration\userlib\ 路径下.
截图

创建数据库和table

  1. 在 dbeaver 手工创建一个 camunda 数据库, encoding选择 UTF8,
    截图

  2. 执行 configuration\sql\create\ 下的两个sql脚本, 创建数据表.
    也可以在yaml文件中配置 schema-update 为 true, 由系统自动创建数据表.
    截图

修改 camunda 配置文件

生产环境应该参考 production.yml 进行设置. camunda 提供很多可配置项, 可参考官网, 配置属性
我是直接修改的 default.yml 文件, 仅改动了 datasource 和 logging.

spring.datasource:
    url: jdbc:postgresql://localhost:5432/camunda
    driver-class-name: org.postgresql.Driver
    username: postgres
    password: saas

logging:
    level.root: INFO
    file.name: logs/camunda-bpm-run.log    
   
camunda.bpm:        
    history-level: FULL
    history-level-default: FULL
              
    database:
        schema-update: true
        type: postgres
        jdbc-batch-processing: true   

启动服务

启动完成后,登录http://localhost:8080/, 输入demo/demo账号登录.

posted @ 2022-10-07 16:00  harrychinese  阅读(406)  评论(0编辑  收藏  举报