3

I am new to docker,Cassandra . well I'm facing a weird issue, any help as how I could debug this issue would be great. I am using

 Cassandra 3.3.0, 
native Cassandra-driver for python- 3.3.0 
Docker 1.11.1

I have two containers one is hosting cassandra service say container A and from the other container say B i'm performing an insert query to cassandra container. here once B executes the query to A just after this container B which is my service container dies .

Logs that i see in container B

[start] application exit with code 0, killing container

i dont see any other relevant logs to debug further as what is the reason so that i am container dies right after insert.

Just to make sure i am not missing any exception i am catching all exceptions i.e BaseException . i have added few loggers their to track my issue however even container dies it never comes to this except block.

What i suspect

it seems docker has error in memory and the moment it will write , it dies or something else.

what i tried also

i tried to run my code without docker container to see offending lines if any. here without docker it works and no exceptions comes. I also make sure to shutdown the cassandra session.

Please advise ..

Karn_way
  • 1,005
  • 3
  • 19
  • 42

1 Answers1

2

I dont see any other relevant logs to debug further as what is the reason so that i am container dies right after insert.

That is how a container is supposed to work: once its main command exits (or fail), the container exits as well and put itself in an "Exited" state.

The main command (ENTRYPOINT or CMD) was for container B to insert query to a cassandra container. It does so and exit.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Here both the container are microservices and needs to be highly available so within CMD if we initiate a monitor to run a method infinitely to keep on interacting with cassandra then it should not die or i am missing something obvious to understand here ? – Karn_way May 12 '16 at 17:22
  • With my ongoing understanding with docker i came to know this link http://stackoverflow.com/questions/28212380/why-docker-container-exits-immediately . So it looks i need to add some running thread on container B after upsert command. let me verify this i will get back to this post again. – Karn_way May 13 '16 at 16:06
  • @Karn_way yes, something must trigger an early stop. – VonC May 13 '16 at 16:10