Closed kadirbekov closed 5 years ago
Hi @kadirbekov,
it should be possible to connect to PostgreSQL. You need to set the connection for the exporter (https://github.com/zeebe-io/zeebe-simple-monitor/tree/master/exporter#configure-the-exporter) and the web-app (https://github.com/zeebe-io/zeebe-simple-monitor/tree/master/app#configuration).
Did you try it out?
@saig0 , I've tried, but there is dependency in pom.xml to h2 driver. When I changed driver class name to postgres, application crashes with no class found error. It will be excellent, If there will be possibility to add library as volume, in docker-compose.
@kadirbekov , is it not possible to add the driver JAR file as volume? For example:
zeebe:
container_name: zeebe_broker
image: camunda/zeebe:0.17.0
volumes:
- ./zeebe-simple-monitor-exporter-0.13.0.jar:/usr/local/zeebe/lib/zeebe-simple-monitor-exporter.jar
- ./postgresql-9.1-901.jdbc4.jar:/usr/local/zeebe/lib/postgresql-9.1-901.jdbc4.jar
@saig0, for broker I did it already, and it works. But for simple monitor I didn't found way to do the same.
You need to add the postgres driver to the simple monitor app class path, for example if you run it with jar -jar
just add -cp $PATH_TO_JAR
.
I don't really know Java, but I've got it working by adding the JAR driver and changing the monitor entrypoint to execute the following command:
java -cp /usr/local/zeebe-simple-monitor.jar:/usr/local/zeebe/lib/postgresql.jar org.springframework.boot.loader.JarLauncher
I believe using -jar
and -cp
toghether is not possible from what I found on StackOverflow. Hope this helps.
Are there any solutions with zeebe simple monitor project which work with Postgres database ? If I want to connect postgres I have to change only docker-compose to store my bpmn's in DB or I have to change monitor app also?
Hi @kadirbekov,
it should be possible to connect to PostgreSQL. You need to set the connection for the exporter (https://github.com/zeebe-io/zeebe-simple-monitor/tree/master/exporter#configure-the-exporter) and the web-app (https://github.com/zeebe-io/zeebe-simple-monitor/tree/master/app#configuration).
Did you try it out?
@saig0 could you put updated links please?
The configuration is described here: https://github.com/zeebe-io/zeebe-simple-monitor#configuration
In order to change the database, you would need to change the following properties.
spring:
datasource:
url: jdbc:h2:mem:zeebe-monitor;DB_CLOSE_DELAY=-1
user: sa
password:
driverClassName: org.h2.Driver
jpa:
database-platform: org.hibernate.dialect.H2Dialect
hibernate:
ddl-auto: update
As developer, I want to use Zeebe simple monitor, connected to PostgreSQL(or any DB).
Acceptance criteria:
1.In docker-compose.yml in camunda/zeebe-simple-monitor image I can add environment variables:
and volumes:
and application will start and will connect to postgres zeebe DB