Giter VIP home page Giter VIP logo

Comments (10)

johnjelinek avatar johnjelinek commented on July 19, 2024

If I start the consul container mounting -v /var/run/docker.sock:/var/run/docker.sock, it dies immediately. The logs only say this:

$ docker logs -f consul
Consul v0.5.0
Consul Protocol: 2 (Understands back to: 1)

from docker-consul.

progrium avatar progrium commented on July 19, 2024

You should not be calling Docker in your health script. It's already running in that container, no need to start a new one from inside it.

The second issue seems unrelated, but if you learn more let me know.

from docker-consul.

johnjelinek avatar johnjelinek commented on July 19, 2024

so, learning points for me -- the IP I PUT to is the consul agent that executes the check. So, it makes sense that my check should actually be something like this:

curl -XPUT -d '{"Name": "test", "Check": { "script": "check-http e1d219c59ded 2368 / -L", "interval": "10s" }}' http://127.0.0.1:8500/v1/agent/service/register -v

But even with this, it means I needed to start my local consul container with -v /var/run/docker.sock:/var/run/docker.sock, which makes the container die immediately with the output I mentioned previously. So if I execute the PUT I mentioned here, it still results with the error message:

time="2015-03-29T04:02:14Z" level="fatal" msg="Post http:///var/run/docker.sock/v1.17/containers/create: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?" 

from docker-consul.

johnjelinek avatar johnjelinek commented on July 19, 2024

Ok, so, I finally got docker.sock mounted, but when I do:

curl -XPUT -d '{"Name": "test", "Check": { "script": "check-http e1d219c59ded 2368 / -L", "interval": "10s" }}' http://127.0.0.1:8500/v1/agent/service/register -v

it adds the check in consul, but I don't see it listed under checks in consul, only under services.

from docker-consul.

johnjelinek avatar johnjelinek commented on July 19, 2024

I had to deregister first before re-registering the service. Is there another recommended way to add a service health check other than the HTTP API?

from docker-consul.

johnjelinek avatar johnjelinek commented on July 19, 2024

strange, I'm getting passes and fails from running check-http. Here's an example of a fail:

HTTP/1.1 301 Moved Permanently
X-Powered-By: Express
Location: https://www.beaneighbor.org/
Vary: Accept, Accept-Encoding
Content-Type: text/plain; charset=utf-8
Content-Length: 62
Date: Tue, 31 Mar 2015 04:11:06 GMT
Connection: keep-alive

HTTP/1.1 200 OK
Server: nginx/1.7.10
Date: Tue, 31 Mar 2015 04:11:06 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 3614
Connection: keep-alive
X-Powered-By: Express
Cache-Control: public, max-age=0
ETag: W/"eNI8enDoQrRPnnvUdAtWbw=="
Vary: Accept-Encoding
Strict-Transport-Security: max-age=31536000

time="2015-03-31T04:11:06Z" level="fatal" msg="Error response from daemon: Cannot destroy container 10c6a50d8c042eff041404025a3560c53f881366d5426a9dc84a05a036036004: Driver aufs failed to remove root filesystem 10c6a50d8c042eff041404025a3560c53f881366d5426a9dc84a05a036036004: rename /var/lib/docker/aufs/mnt/10c6a50d8c042eff041404025a3560c53f881366d5426a9dc84a05a036036004 /var/lib/docker/aufs/mnt/10c6a50d8c042eff041404025a3560c53f881366d5426a9dc84a05a036036004-removing: device or resource busy" 

When it passes, it leaves off that last section. Any thoughts?

from docker-consul.

progrium avatar progrium commented on July 19, 2024

That is an error from Docker not the check.

On Mon, Mar 30, 2015 at 11:13 PM, John Jelinek IV [email protected]
wrote:

strange, I'm getting passes and fails from running check-http. Here's an
example of a fail:

HTTP/1.1 301 Moved Permanently
X-Powered-By: Express
Location: https://www.beaneighbor.org/
Vary: Accept, Accept-Encoding
Content-Type: text/plain; charset=utf-8
Content-Length: 62
Date: Tue, 31 Mar 2015 04:11:06 GMT
Connection: keep-alive

HTTP/1.1 200 OK
Server: nginx/1.7.10
Date: Tue, 31 Mar 2015 04:11:06 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 3614
Connection: keep-alive
X-Powered-By: Express
Cache-Control: public, max-age=0
ETag: W/"eNI8enDoQrRPnnvUdAtWbw=="
Vary: Accept-Encoding
Strict-Transport-Security: max-age=31536000

time="2015-03-31T04:11:06Z" level="fatal" msg="Error response from daemon: Cannot destroy container 10c6a50d8c042eff041404025a3560c53f881366d5426a9dc84a05a036036004: Driver aufs failed to remove root filesystem 10c6a50d8c042eff041404025a3560c53f881366d5426a9dc84a05a036036004: rename /var/lib/docker/aufs/mnt/10c6a50d8c042eff041404025a3560c53f881366d5426a9dc84a05a036036004 /var/lib/docker/aufs/mnt/10c6a50d8c042eff041404025a3560c53f881366d5426a9dc84a05a036036004-removing: device or resource busy"

When it passes, it leaves off that last section. Any thoughts?


Reply to this email directly or view it on GitHub
#64 (comment)
.

Jeff Lindsay
http://progrium.com

from docker-consul.

johnjelinek avatar johnjelinek commented on July 19, 2024

I wonder why an error message from docker would display at the end of the http check.

from docker-consul.

progrium avatar progrium commented on July 19, 2024

Because it uses Docker: https://github.com/progrium/docker-consul/blob/master/check-http#L20

from docker-consul.

johnjelinek avatar johnjelinek commented on July 19, 2024

😆 got it. So the container failed to delete, I guess.

from docker-consul.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.