Skip to content
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

Haproxy multi sockets support #9

Open
yafitshm opened this issue Nov 15, 2017 · 11 comments
Open

Haproxy multi sockets support #9

yafitshm opened this issue Nov 15, 2017 · 11 comments

Comments

@yafitshm
Copy link

In an environment where nbproc > 1, when updating by 'socat' it updates a random proc and will not update all the haproxy processes that are currently running.
To resolve that and provide better visibility to haproxy, it is recommended to setup multi sockets and attach each socket to a uniq process.

When updating haproxy with a new OCSP response, it is required to update all sockets.
Can this be fixed to support multi admin sockets?

pierky added a commit that referenced this issue Nov 15, 2017
@pierky
Copy link
Owner

pierky commented Nov 15, 2017

Hello @yafitshm, thanks for pointing that out.

You can find the current implementation of what I think may solve this issue in the "issue9" branch.
The trick is to run hapos-upd with --socket "path_to_socket1 path_to_socket2 path_to_socketN" argument.
Socket files can also be passed using wildcard: --socket "/var/run/haproxy/*.sock".

Could you give it a try and let me know if it works for you?

Thanks.

@pierky
Copy link
Owner

pierky commented Nov 21, 2017

Hello @yafitshm, did you have a chance to test the new release? Did it work as you expected?
Thanks

@yafitshm
Copy link
Author

yafitshm commented Dec 3, 2017

Hi,

It does not work with the wildcard option, but found that this change solves the problem:

echo "set ssl ocsp-response base64 -w 0 $TMP/ocsp.der" | for file in ls $HAPROXY_ADMIN_SOCKET; do $SOCAT_BIN stdio $file &>>$TMP/log; done

What do you think?
Thanks.

@pierky
Copy link
Owner

pierky commented Dec 5, 2017

Hello @yafitshm, could you provide me more details about the error you receive when using wildcard?
I had some tests and couldn't reproduce any issue.
Thanks

@yafitshm
Copy link
Author

yafitshm commented Dec 6, 2017

Hi,

I got an error that it cannot open the second socket. For some reason, I cannot replicate it now.
I have set the wildcard on one of the haproxies to monitor the ocsp status and make sure it is updated on all sockets using the wildcards.
Thanks.

@pierky
Copy link
Owner

pierky commented Dec 7, 2017

Hi @yafitshm, can you confirm it is working? If so I'll merge it into master.
Thanks

@yafitshm
Copy link
Author

yafitshm commented Dec 7, 2017

Hi,
When running:
hapos-upd -c /path/to/ssl/cert.pem -s "/var/run/haproxy_stats."
I get the following error:
can't update haproxy ssl ocsp-response using /var/run/haproxy_stats.
socket

I have double checked it now, and when adding the for loop, it resolves that problem and all processes are getting the ocsp update.

Were you able to verify it also?
Thanks.

@pierky
Copy link
Owner

pierky commented Dec 7, 2017

Can't understand why you are not using the * in haproxy_stats.
Does it work if you put it in?

@yafitshm
Copy link
Author

yafitshm commented Dec 7, 2017 via email

@pierky
Copy link
Owner

pierky commented Dec 8, 2017

I understand now! In your first message (then edited) you were saying it worked. Then in the second one the * was not shown (as you can see on the GitHub web page) and this confused me.
I'll double check it and get back to you.

@j0sh3rs
Copy link

j0sh3rs commented Apr 4, 2018

HAProxy released version 1.8, which includes multithreading and global-master support (for actual multithreading), and this is the preferred method of implementing HAProxy now. Doing so only requires an nbproc 1 setting (or omitting the line), which allows for a single stats socket, bypassing this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants