-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't seem to run HAProxy #7
Comments
Hi @mbbender! The support team sent me your ticket from Zendesk so I've looked at the linked Bitbucket repo from there to try and figure out what's up. I've pulled the container image I'm going to copy the relevant section of your Zendesk ticket here too if you don't mind.
In order for Containerbuddy to tell Consul that HAProxy is healthy, it you need to have a working Thanks for checking out Containerbuddy and please let me know if these changes work for you. |
Yeah sorry that was just a typo from local testing (I haved pushed up the latest image to docker hub that had containerbuddy on it). I'm definitely using a container that has containerbuddy installed. I had it download and put it in the /bin directory and the tried including it in the copied /opt/containerbuddy folder per the examples and run it from there instead but no difference. I've also tried with absolute paths to everything. I think the challenge is just trying to get container buddy to launch and report HAProxy base image. No matter what I try I can't seem to get it to work. |
@mbbender can you push that $ docker pull mbbender/haproxy
Using default tag: latest
latest: Pulling from mbbender/haproxy
81ea8837dab7: Already exists
3b5671666ac3: Already exists
aac3775d15b2: Already exists
3ab442ed0fa5: Already exists
dc8b732678ec: Already exists
fab84cd96083: Already exists
66752d611115: Already exists
0d278595e9a0: Already exists
a8d62e9f0856: Already exists
Digest: sha256:587eee11c66c93e7ab0aceac5502892f53d960a5eceda297e9210a110763eaeb
Status: Image is up to date for mbbender/haproxy:latest
$ docker run --rm mbbender/haproxy /opt/containerbuddy/containerbuddy -config file:///opt/containerbuddy/haproxy.json /usr/local/sbin/haproxy -f /usr/local/etc/haproxy/haproxy.cfg
Error response from daemon: Cannot start container b16e3daf2e222912b26da96fe3d044ca3b217b8796efb34ff934b2cdba428767: [8] System error: exec: "/opt/containerbuddy/containerbuddy": stat /opt/containerbuddy/containerbuddy: no such file or directory
$ docker run -it mbbender/haproxy /bin/bash
root@dac5fb956948:/# ls -lah /opt/
total 8.0K
drwxr-xr-x 2 root root 4.0K Oct 22 17:09 .
drwxr-xr-x 38 root root 4.0K Nov 6 20:23 ..
root@dac5fb956948:/# |
Oh, I see what the problem is. When I pulled your $ docker run -it mbbender/haproxy:cb /bin/bash
root@3f8ec86e6032:/# ls -lah /opt/
total 12K
drwxr-xr-x 3 root root 4.0K Nov 5 19:51 .
drwxr-xr-x 48 root root 4.0K Nov 6 20:29 ..
drwxr-xr-x 2 root root 4.0K Nov 5 19:51 containerbuddy
root@3f8ec86e6032:/# ls -lah /opt/containerbuddy/
total 16K
drwxr-xr-x 2 root root 4.0K Nov 5 19:51 .
drwxr-xr-x 3 root root 4.0K Nov 5 19:51 ..
-rw-r--r-- 1 root root 363 Nov 5 17:15 haproxy.json
-rw-r--r-- 1 root root 509 Nov 5 17:16 reload-haproxy.sh
root@3f8ec86e6032:/# In this line you've installed it to docker run -d mbbender/haproxy:cb /bin/containerbuddy -config file:///opt/containerbuddy/haproxy.json /usr/local/sbin/haproxy -f /usr/local/etc/haproxy/haproxy.cfg |
I pushed lastest. Here is the dockerfile. I just took the HAProxy docker file for 1.6 and removed the default CMD in testing. This version includes containerbuddy in the /opt/containerbuddy location so you can run it like
Running
which is what I understand to be the right format to launch haproxy with containerbuddy runs for a few seconds then gives the error
Dockerfile:
|
You have the line I would include that in a makefile like I did for this triton-cloudflare project or in the Dockerfile like I did for this triton-touchbase project. That all being said, I just pulled down your
|
I did have one container version download containerbuddy on build but I was just trying lots of different things even if it seemed like it shouldn't matter. 37 mins... what kind of magic machine do you have?! Mine still exits with the same error. Can you run it on triton in joyent? I get the same error when trying to run within joyent as I do locally. Would be interested to see if it works or fails for you in the same place. |
@tgross Have you had a chance to try this out within the joyent enivornment? I'm using us-east-1 if that matters. |
Nice talk today! I think my issue might be that I removed the health parameter. Did you include a health check when trying my examples? Do you know if it is required? I was messing around with another container and containerbuddy just now and it wasn't reporting so I added a health check and it is showing up in consul now. |
Adding a health check doesn't solve the issue for me. |
Thanks! Sorry I left you hanging here for a bit; I had another conference to attend in SF last week and then my travels back home took a lot out of me. I'm having a little trouble figuring out exactly what you're trying to run. The health check in the Containerbuddy configuration you have in that image but your runs above show you using $ docker images | grep mbbender
mbbender/haproxy latest bd2984a8a6fc 10 days ago 127.6 MB
mbbender/haproxy cb 2fec01c4be24 10 days ago 129.9 MB Your docker-compose files are running docker run -it mbbender/haproxy:cb ls -lah /opt/containerbuddy
total 16K
drwxr-xr-x 2 root root 4.0K Nov 5 19:51 .
drwxr-xr-x 3 root root 4.0K Nov 5 19:51 ..
-rw-r--r-- 1 root root 363 Nov 5 17:15 haproxy.json
-rw-r--r-- 1 root root 509 Nov 5 17:16 reload-haproxy.sh The Containerbuddy configuration file in that image matches what's in master in your repo and looks like this: {
"consul": "consul:8500",
"services": [
{
"name": "haproxy",
"port": 80,
"publicIp": true,
"health": "/usr/bin/curl --fail -s http://localhost/health.txt",
"poll": 10,
"ttl": 25
}
],
"backends": [
{
"name": "app",
"poll": 7,
"onChange": "/opt/containerbuddy/reload-haproxy.sh"
}
]
} The health check you have here is not supported by your HAProxy configuration, so health checks will never pass and the service will never appear as healthy to Consul. In the application server, your |
@mbbender: it's been a while without a reply, so I'm going close this one. Please re-open if this is still problematic, or open a new issue with any new bugs. We will be creating an image of our own with HAproxy eventually, but I can't say specifically when that will be available. |
When I try to execute HAProxy using the HAProxy base image for v1.6 I get
It takes a bit for that error to show up, maybe 5-10 seconds so it's not an immediate thing. If I run this image without the containerbuddy wrapper it works as expected.
My image only adds consul-template to the mix which isn't even in play in any of these tests so I don't expect that should matter.
I don't know go so I'm attempting to troubleshoot/debug but not having much luck.
The text was updated successfully, but these errors were encountered: