Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the "(healthy)" string in STATUS stands for?

What does the "(healthy)" string in STATUS column stands for?

user@user:~# docker ps

CONTAINER ID  IMAGE   COMMAND  CREATED   STATUS                   PORTS  NAMES

X             X       X        X         Up 20 hours              X      X

X             X       X        X         Up 21 hours (healthy)    X      X
like image 863
Robert Wróbel Avatar asked Mar 06 '18 18:03

Robert Wróbel


People also ask

Whats SOS stand for?

In Morse Code, “SOS” is a signal sequence of three dits, three dats, and another three dits spelling “S-O-S”. The expression “Save Our Ship” was probably coined by sailors to signal for help from a vessel in distress.

What does the acronym stand for health and safety?

The acronyms stand for:HSE: health, safety and environment. HSQE: Health, safety, quality and environment. HSEQ: Health, safety, environment and quality. HSSE: health, safety, security and environment.

Does SOS stand for Save Our Souls?

SOS, when it was first agreed upon by the International Radio Telegraphic Convention in 1906, was merely a distinctive Morse code sequence and was initially not an abbreviation. Later in popular usage it became associated with mnemonic phrases such as "Save Our Souls" and "Save Our Ship".


2 Answers

That's the result of the HEALTHCHECK instruction. That instruciton runs a command inside the container every 30 seconds. If the command succeeds, the container is marked healthy. If it fails too many times, it's marked unhealthy.

You can set the interval, timeout, number of retries and start delay.

The following, for example, will check that your container responds to HTTP every 5 minutes with a timeout of 3 seconds.

HEALTHCHECK --interval=5m --timeout=3s \
  CMD curl -f http://localhost/ || exit 1

You get a health_status event when the health status changes. You can follow those and others with docker events.

like image 188
kichik Avatar answered Oct 13 '22 01:10

kichik


https://ryaneschinger.com/blog/using-docker-native-health-checks/

Normally it's something you launch with, to enable swarm or other services to check on the health of the container.

IE:

$ docker run --rm -it \
     --name=elasticsearch \
     --health-cmd="curl --silent --fail localhost:9200/_cluster/health || exit 1" \
     --health-interval=5s \
     --health-retries=12 \
     --health-timeout=2s \
     elasticsearch

see the health checks enabled at runtime?

like image 36
ajankuv Avatar answered Oct 13 '22 00:10

ajankuv