Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop Solr gracefully when it running in docker

I am running a solr in docker container

My docker ENTRYPOINT is $SOLR_HOME/bin/solr start ${options}

currently when I am running docker stop <container Id> its kill the process but solr stops incorrectly

In order to stop Solr correctly we need to run : $SOLR_HOME/bin/solr stop

How do I config docker to call solr stop command when docker stop <container Id> is executed?

like image 357
MoShe Avatar asked May 24 '16 13:05

MoShe


People also ask

How do I stop docker container gracefully?

docker rm -f The final option for stopping a running container is to use the --force or -f flag in conjunction with the docker rm command. Typically, docker rm is used to remove an already stopped container, but the use of the -f flag will cause it to first issue a SIGKILL.

How do I stop SOLR from running?

To stop Solr, you can cd to /path/to/solr-5.0. 0/bin and call ./solr stop -p 8983 . This stops the Solr server instance listening on port 8983.

How do I stop a docker swarm container?

List the containers running for the service & stop them for example docker ps | grep service-name and then stop the container by using docker stop <ID> from above command.


1 Answers

When running $SOLR_HOME/bin/solr stop, the kernel sends a SIGQUIT signal to the process. To duplicate this in docker, you need to run docker kill --signal="SIGQUIT" <ContainerName> rather than docker stop. Docker Stop sends a SIGTERM signal by default.

like image 160
Ged Avatar answered Sep 22 '22 15:09

Ged