openzipkin-attic / docker-zipkin

Docker images for OpenZipkin
Apache License 2.0
688 stars 329 forks source link

Cassandra - '/cassandra/data' mounting issues #164

Closed mclarke47 closed 6 years ago

mclarke47 commented 6 years ago

This is a strange one so I'll just write out the timeline of what happens and then discuss possible fixes.

  1. The cassandra schema is loaded into the docker image when the image is built
  2. Deploy zipkin to kubernetes with zipkin-helm using cassandra3 storage, with the config flag ENSURE_SCHEMA=true
  3. Mounting a persistent volume over /cassandra/data. This deletes the schema installed by step 1
  4. When the servers start up and runs ensure the schema they don't create the zipkin2.dependency (not sure why) table resulting in the UI not working

I was able to work around this by adding the line cp -R /cassandra/data/ /cassandra/data-tmp/ after this line.

Then cp -rf /cassandra/data-tmp/* /cassandra/data/ before cassandra starts

This is obviously a bit hacky and would probably wipe out the traces when the pod restarts.

It think that there should be some way of persisting the /cassandra/data directory built by docker build if people want to mount persistent volumes like this.

codefromthecrypt commented 6 years ago

Sheesh had to get into the weeds to figure out this one huh?!