Separate REST API and clustering networks - question


I am trying to achieve the result described in this part of documentation

I created first lxd instance bootstrapped it with lxd init --peseed by which I set the core.https_address: to my.cluster:8443 where my.cluster is my desired ip address, then enabled clustering on the first instance, but when I tried to initialize the second instance and jonin it to my newly created cluster during initialization I was not asked about the core.https.address, when I tried to change it using lxc config set I get an error saying that it’s not possible to bind that address.

Then according to that part:
“and then use the PUT /1.0/cluster API endpoint as usual, specifying the address of the joining node with the server_address field. If you use preseed, the YAML payload would be exactly like the one above.”

I tried to initialise and join the second one using --preseed by setting the exactly same core.https_address and the cluster part containing server_address field in preseed config.
It initialised without error but both core.https_address and cluster.https_address are different than on first node.

What did I do wrong?

Hi @hypeit, please examine that video which @stgraber explains briefly.

I watched the video several times and really don’t see the explanation how to achieve the result I want to have.


I’m not really following what you’re saying is wrong.

The cluster.https_address must be different for each cluster member, as it represents the address to use to reach each member in the cluster.

The core.https_address can be different from cluster.https_address, but must be a valid listen address on each member. This means it can be a wildcard address (unlike cluster.https_address) but equally can be a single IP/port specific to the cluster member.

So to summarise:

  • cluster.https_address must be different for each cluster member and must be a specific IP/port that represents how the other cluster members can connect to this server. This defaults to the server_address specified during the join process.
  • core.https_address - indicates the address to listen on each cluster member for external REST API clients. This can be different on each cluster member, or if using wildcard addresses can be the same (but would still end up binding on different IPs for each cluster member).