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

How to set multiple sentinels? #27

Closed
caimaoy opened this issue Jul 6, 2023 · 4 comments
Closed

How to set multiple sentinels? #27

caimaoy opened this issue Jul 6, 2023 · 4 comments

Comments

@caimaoy
Copy link

caimaoy commented Jul 6, 2023

In my system, I have multi-sentinels. How to set the environment "RQ_SENTINEL_HOST"?

https://github.com/mdawar/rq-exporter/blob/master/rq_exporter/utils.py#L48

This code support only one sentinel?

@mdawar
Copy link
Owner

mdawar commented Jul 6, 2023

The RQ_SENTINEL_HOST env variable can be a list of Sentinel hosts separated commas, for example host1,host2,host3 and the port will be set for all the hosts using RQ_SENTINEL_PORT which defaults to 26379.

Sorry this was not documented, I'll make sure to add this info to the readme.

@mdawar mdawar closed this as completed Jul 6, 2023
@caimaoy
Copy link
Author

caimaoy commented Jul 6, 2023

@mdawar I think so. but my sentinels are not using the same port. They are using different ports.

@mdawar
Copy link
Owner

mdawar commented Jul 6, 2023

@caimaoy how do you think we should add support for multiple sentinel hosts with different ports?

I don't think we should pass the ports in a different env variable, the host string should have the ports included for each host host1:1234,host2:4567,host3:8910, what do you think?

@mdawar mdawar reopened this Jul 6, 2023
@mdawar mdawar closed this as completed in a577490 Jul 6, 2023
@mdawar
Copy link
Owner

mdawar commented Jul 6, 2023

@caimaoy You can now use multiple Sentinel hosts with different ports using version v2.1.0.

For example: sentinel1,sentinel2:23680,sentinel3:23681 if the port is not specified like in sentinel1, then the port set with --sentinel-port or RQ_SENTINEL_PORT will be used which defaults to 26379.

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

No branches or pull requests

2 participants