pnxtech / hydra-router

A service aware router for Hydra Services. Implements an API Gateway and can route web socket messages.
MIT License
60 stars 26 forks source link

Time drift issue when running hydra-router in a docker swarm on a Mac. #162

Open cjus opened 6 years ago

cjus commented 6 years ago

If you run a docker swarm locally (using docker stack) and have a hydra microservice that you're developing / testing outside of the swarm you may notice that the hydra-router dashboard will show your test service as being unavailable. The time difference might be 6-12 seconds.

This is a known docker engine (on mac) time drift issue.

To resolve this just reset your docker engine. You can do that by 1) clicking on the docker for mac icon 2) selecting the reset bomb 3) pressing the Restart button. That will restart the docker engine then you can reload the swarm.

item-0_and_item-0_and_airportextra

cjus commented 6 years ago

This is still an issue after Docker Version 17.12.0-ce-mac49 (21995)

cjus commented 6 years ago

The issue, I'm told, is that on the Mac we have an embedded Linux VM which can get out of sync with the Mac itself. When running in production on Linux machines a Linux VM isn't necessary.

sjmcdowall commented 6 years ago

@cjus -- Have you tried, in your docker container, to add NTP or something similar, to coordinate the date/time between the underlying Mac and the container? Even in production time shift is a normal thing so it's important to make sure all machines in the swarm run NTP (IMHO) .. even if pure Linux