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

Can't choose specific leader when use consul template for hosts settings #1998

Open
sdayvz opened this issue Oct 21, 2024 · 0 comments
Open

Comments

@sdayvz
Copy link

sdayvz commented Oct 21, 2024

Hi,
I use consul template for /etc/hosts settings , and I use citus + patroni.
I use citus groups feature in patroni. So my citus groups seem like this in patroni:

  • Citus cluster: mycluster -------------+---------+-----------+----+-----------+
    | Group | Member | Host | Role | State | TL | Lag in MB |
    +-------+-----------+------------------+---------+-----------+----+-----------+
    | 0 | citus1 | 10.10.10.10| Leader | running | 1 | |
    | 1 | citus1-02 | 10.10.10.11| Replica | streaming | 1 | 0 |
    | 1 | citus2 | 10.10.10.12| Leader | running | 1 | |
    | 1 | citus2-02 | 10.10.10.13| Replica | streaming | 1 | 0 |

+-------+-----------+------------------+---------+-----------+----+-----------+

I set up /etc/hosts config with consul template:
{{ range service "master.mycluster@datacenter1|passing" }}{{ .Address }} citus1-primary{{ end }}
{{ range service "replica.mycluster@datacenter1" }}{{ .Address }} citus1-replica{{ end }}

But both of 10.10.10.10 and 10.10.10.12 seem like leader and 10.10.10.11 and 10.10.10.13 seem like replica.
So /etc/hosts file seem like that:

10.10.10.10 citus1-primary 10.10.10.12 citus1-primary
10.10.10.11 citus1-replica 10.10.10.13 citus1-replica

I want to seperate this leader and replika by group number but I can't find this feature in consul template document.
Is there any solution for this?
Thanks.

@sdayvz sdayvz changed the title Can't choose specific leader when use consul template for haproxy Can't choose specific leader when use consul template for hosts settings Oct 21, 2024
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

1 participant