1

We have a docker swarm and we normally run service container using Docker create service API. Now we are seeing after certain time interval the services are not responding ( means the application running inside container ). As of now the solution looks like restarting the service after specific time interval.And it worked when we tried it manually .

This is the top command output of Host worker node

enter image description here

And output of docker stats

enter image description here

Wanted to know what is the best approach to fix it. Also can we automate the solution.

curiousguy
  • 3,212
  • 8
  • 39
  • 71
  • Sounds like you need health check for your service. – rkosegi Dec 16 '18 at 16:22
  • Kubernetes will restart failed containers automatically – Yonah Dissen Dec 16 '18 at 16:26
  • Yes that docker swarm will do too. The problem is container is active but not responding (application inside container) – curiousguy Dec 16 '18 at 16:29
  • you can autmate this by two way 1st. Some health check if fail then restart the container. 2nd inside container a script that will ping the application port or route if not responding then restart the application or restart the container by killing root process in it. I can explain in answer if this make sens to you – Adiii Dec 16 '18 at 16:54
  • @Adiii please can you explain the solution. I would definitely like to explore especially the 2nd option – curiousguy Dec 16 '18 at 17:37
  • okay let share your dockerfile. The entry point or CMD is important. I am seening that you are running java and python right? so solution will be in python or bash but dockerfile is imp – Adiii Dec 17 '18 at 02:59

0 Answers0