Docker Cloud stackfile with Cassandra example?

Can anyone point me to a working kong docker cloud stackfile example using cassandra? I’m not having much luck. The database seems to have come up okay and is running, however the kong side of it logs errors…

[warn] You are using Cassandra but your ‘db_update_propagation’ setting is set to ‘0’ (default). Due to the distributed nature of Cassandra, you should increase this value.

[error] 1#0: init_by_lua error: /usr/local/share/lua/5.1/kong/init.lua:160: [cassandra error] the current database schema does not match this version of Kong. Please run kong migrations up to update/initialize the database schema. Be aware that Kong migrations should only run from a single node, and that nodes running migrations concurrently will conflict with each other and might corrupt your database schema!

So not quite sure the best way to address these here in the following stackfile. Regarding db_update_propagation, I was hoping I don’t need to extend the default image to fix this.

kong:
  autoredeploy: true
  deployment_strategy: every_node
  environment:
    - KONG_ADMIN_ACCESS_LOG=/dev/stdout
    - KONG_ADMIN_ERROR_LOG=/dev/stderr
    - 'KONG_ADMIN_LISTEN=0.0.0.0:8001'
    - 'KONG_ADMIN_LISTEN_SSL=0.0.0.0:8444'
    - KONG_CASSANDRA_CONTACT_POINTS=kong-database
    - KONG_DATABASE=cassandra
    - KONG_PG_HOST=kong-database
    - KONG_PROXY_ACCESS_LOG=/dev/stdout
    - KONG_PROXY_ERROR_LOG=/dev/stderr
  image: 'kong:latest'
  links:
    - kong-database
  ports:
    - '8000:8000'
    - '8001:8001'
    - '8443:8443'
    - '8444:8444'
  restart: on-failure
  tags:
    - api-gateway
    - kong
kong-database:
  autoredeploy: true
  deployment_strategy: every_node
  image: 'cassandra:3'
  ports:
    - '9042:9042'
  restart: on-failure
  tags:
    - database
    - kong

I added:

kong-migration:
  command: kong migrations up
  environment:
    - KONG_CASSANDRA_CONTACT_POINTS=kong-database
    - KONG_DATABASE=cassandra
    - KONG_PG_HOST=kong-database
  image: 'kong:latest'
  links:
    - kong-database
  tags:
    - api-gateway
    - kong

…and when I restarted the stack it looks like the logs from the migration service look positive:


[kong-migration-1]2018-01-26T11:37:57.716735847Z oauth2 migrated up to: 2017-10-11-oauth2_new_refresh_token_ttl_config_value

[kong-migration-1]2018-01-26T11:37:57.716740209Z 55 migrations ran

[kong-migration-1]2018-01-26T11:37:57.716744507Z waiting for Cassandra schema consensus (10000ms timeout)…

[kong-migration-1]2018-01-26T11:37:57.716748906Z Cassandra schema consensus: reached

Hi @derekdon
I’m facing the same issue. Can you please link the entire docker compose file?
My docker-compose is at 1.19.0. Seems like the compose file is not structured properly.
However,YML linter passes the file as a valid file.

My example is a Docker Cloud Stackfile, which is a slightly different schema to a compose file… The complete stackfile is just both of the above blocks together, so there’s 3 services.