Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Multiple Rundeck Configurations Using Same Database Connection

47 views
Skip to first unread message

Sean McGurk

unread,
Feb 11, 2025, 6:38:38 AMFeb 11
to rundeck-discuss
Hi there,

I am trying to run multiple rundeck containers on the same docker host.

When I try and run the containers, I am able to start rundeck, log in, see the jobs etc. but both point to the same database despite different database urls having been specified in the docker compose file:

```
volumes:
  QA-NAVINET-LOCAL:
  qanl-data:
  opsconsole-data:
services:
  nginx:
    image: nginx
    ports:
      - "8080:8080"
      - "443:443"
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf
      - ./ssl-certs:/etc/nginx/certs
    hostname: nginx
  # backends:
  qanl-rundeck:
    image: nh-rundeck-chef:0.2806.2-FTR.5
    volumes:
      - QA-NAVINET-LOCAL:/app/data
      - qanl-data:/home/rundeck/server/data
      - ./realm.properties:/home/rundeck/server/config/realm.properties
    environment:
      RUNDECK_GRAILS_URL: https://qanlsurundeck.qa.navinet.local
      RUNDECK_SERVER_FORWARDED: true
      RUNDECK_DATABASE_DRIVER: com.microsoft.sqlserver.jdbc.SQLServerDriver
      RUNDECK_DATABASE_USERNAME: DATABASE_USERNAME
      RUNDECK_DATABASE_PASSWORD: DATABASE_PASSWORD
      RUNDECK_DATABASE_URL: jdbc:sqlserver://qadbsql16.qa.navinet.local;DatabaseName=RundeckDB_QANL_Copy;autoReconnect=true;useSSL=false  
  ops-console-rundeck:
    image: rundeck/nh-rundeck-non-chef:0.2806.1-FTR.14
    volumes:
      - opsconsole-data:/home/rundeck/server/data
      - ./realm.properties:/home/rundeck/server/config/realm.properties
    environment:
      RUNDECK_GRAILS_URL: https://nnsuoc.navimedix.com
      RUNDECK_SERVER_FORWARDED: true
      RUNDECK_DATABASE_DRIVER: com.microsoft.sqlserver.jdbc.SQLServerDriver
      RUNDECK_DATABASE_USERNAME: DATABASE_USERNAME
      RUNDECK_DATABASE_PASSWORD: DATABASE_PASSWORD
      RUNDECK_DATABASE_URL: jdbc:sqlserver://OPSConsole-oi.qa.navinet.local;DatabaseName=OpConsoleDB_OI_Copy;autoReconnect=true;useSSL=false

```

Sean McGurk

unread,
Feb 11, 2025, 6:39:22 AMFeb 11
to rundeck-discuss
Does anyone have any ideas what might be happening?

Sean McGurk

unread,
Feb 11, 2025, 6:55:13 AMFeb 11
to rundeck-discuss
I think it might do with the fact that the  rundeck-config.properties file is being overwritten by the other container/ rundeck instance.

rac...@rundeck.com

unread,
Feb 11, 2025, 7:58:06 AMFeb 11
to rundeck-discuss

Hi,

  • Is that NGINX server an LB for both instances? It may be redirected to the same instance (test without that LB first).
  • Double-check that you are not using a Dockerfile directive that copies the ‘sundeck-config.properties’ file to both instances.
  • Also, verify your docker environment and containers for any cache/volume issues.

I tested a similar environment without issues:

version: '3' services: rundeck1: image: rundeck/rundeck:5.9.0 links: - mysql1 environment: RUNDECK_GRAILS_URL: http://localhost:4440 RUNDECK_DATABASE_DRIVER: org.mariadb.jdbc.Driver RUNDECK_DATABASE_USERNAME: rundeck1 RUNDECK_DATABASE_PASSWORD: rundeck1 RUNDECK_DATABASE_URL: jdbc:mysql://mysql1/rundeck1?autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true ports: - 4440:4440 tty: true mysql1: image: mysql:8.0.33 ports: - 3306:3306 environment: - MYSQL_ROOT_PASSWORD=root - MYSQL_DATABASE=rundeck1 - MYSQL_USER=rundeck1 - MYSQL_PASSWORD=rundeck1 rundeck2: image: rundeck/rundeck:5.9.0 links: - mysql2 environment: RUNDECK_GRAILS_URL: http://localhost:4441 RUNDECK_DATABASE_DRIVER: org.mariadb.jdbc.Driver RUNDECK_DATABASE_USERNAME: rundeck2 RUNDECK_DATABASE_PASSWORD: rundeck2 RUNDECK_DATABASE_URL: jdbc:mysql://mysql2/rundeck2?autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true ports: - 4441:4440 tty: true mysql2: image: mysql:8.0.33 ports: - 3307:3306 environment: - MYSQL_ROOT_PASSWORD=root - MYSQL_DATABASE=rundeck2 - MYSQL_USER=rundeck2 - MYSQL_PASSWORD=rundeck2

I think the best way to debug this is to test from a simple example/clean environment and then add the nginx/volumes definitions.

Regards.

Sean McGurk

unread,
Feb 11, 2025, 8:30:22 AMFeb 11
to rundeck-discuss
Yes - I am using nginx as a reverse proxy.

Here is the nginx configuration:

user  nginx;
worker_processes  auto;
error_log  /var/log/nginx/error.log notice;
pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;

    keepalive_timeout  65;

    # include /etc/nginx/conf.d/*.conf;
    server {

        listen          8080;
        listen          443 ssl;

        server_name  qanlsurundeck.qa.navinet.local;

        ssl_certificate /etc/nginx/certs/qanlsurundeck.qa.navinet.local.pem;
        ssl_certificate_key /etc/nginx/certs/qanlsurundeck.qa.navinet.local.key;

        rewrite ^/?(/)?$ /menu/home redirect;
        chunked_transfer_encoding on;
        client_max_body_size 0;

        location / {
            proxy_pass http://qanl-rundeck:4440;
        proxy_http_version  1.1;
        proxy_cache_bypass                 $http_upgrade;
        proxy_set_header Upgrade           $http_upgrade;
        proxy_set_header Connection        "upgrade";
        proxy_set_header Host              $host;
        proxy_set_header X-Real-IP         $remote_addr;
        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Host  $host;
        proxy_set_header X-Forwarded-Port  $server_port;
        }
    }
    server {

        listen          8080;
        listen          443 ssl;

        server_name  nnsuoc.navimedix.com;

        ssl_certificate /etc/nginx/certs/qanlsurundeck.qa.navinet.local.pem;
        ssl_certificate_key /etc/nginx/certs/qanlsurundeck.qa.navinet.local.key;

        rewrite ^/?(/)?$ /menu/home redirect;
        chunked_transfer_encoding on;
        client_max_body_size 0;

        location / {
            proxy_pass http://ops-console-rundeck:4440;
        proxy_http_version  1.1;
        proxy_cache_bypass                 $http_upgrade;
        proxy_set_header Upgrade           $http_upgrade;
        proxy_set_header Connection        "upgrade";
        proxy_set_header Host              $host;
        proxy_set_header X-Real-IP         $remote_addr;
        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Host  $host;
        proxy_set_header X-Forwarded-Port  $server_port;
        }
    }
}

Reply all
Reply to author
Forward
0 new messages