0

Will etcd work with a Config that has different IPs for different nodes? Say node A and node B see different IPs for node C as C.1 and C2. respectively and they can't be interchanged i.e Node A can't use C.2. Would this work?

Marit
  • 1

1 Answers1

0

yes, as long as you define the advertised peer urls by hostname not by ip address.

--peer-urls=http(s)://nodeA.mydomain.com:2380
--peer-urls=http(s)://nodeB.mydomain.com:2380
--peer-urls=http(s)://nodeC.mydomain.com:2380

depending on how your name resolution works, you want to resolve c1 on nodeA and c2 on node B. You can do this simply by adding

c1 nodeC.mydomain.com

into nodeAs' hosts file and the matching:

c2 nodeC.mydomain.com

on nodeBs' hosts file.

if you now use ping, on nodeA and nodeB for nodeC.mydomain.com they should resolve to the respective addresses.

Hope this helps.

Ephemeral
  • 31
  • 3
  • Thanks! Will try this. So etcd just cares about the domain name and will send packets to whatever it resolves to, as long as packets reach other node, irrespective of IP, it should work? – Marit Jul 27 '22 at 01:30