[yugabyted] How to ACTUALLY set the master address?

Hi, I’m trying to run Yugabyte in Docker but I’m having a lot of trouble getting it to work reliably (more details here).

I’m trying to tell yugabyted which specific master address to use, but it is not working.
I’m starting it with this command: bin/yugabyted start --background=false --advertise_address "$$(hostname -i)" --master_flags "master_addresses=yugabyte:7100" --tserver_flags "tserver_master_addrs=yugabyte:7100"

But this is what ends up showing in the config file:
"current_masters": ",172.19.0.2:7100",
…which seems to completely break the database (unable to connect with ysqlsh), even though the IP is correct.

If I remove --master_flags and --tserver_flags and manually edit the config file to:
"current_masters": "yugabyte:7100",
…it works as intented, even if the container’s IP changes (which was my original issue), however, I don’t want to rely on the config file because it seems to be dynamic (I’ve seen that field automatically set to yugabyte:7100,172.19.0.2:7100 before), so I would like it to specify the exact hostname that is to be used.

Hi @HeCorr

What version are you using?

I think you fixed this in Unable to determine master addresses - #5 by HeCorr ?

2.25. which exact build I’ll have to check. and I technically did fix that, but by manually editing a config file that I don’t think I’m supposed to change. right now I’m trying to figure out how to permanently fix it in a way that would work in a new installation.

There is only 1 public release of 2.25 unless you’ve done a custom build.

I saw a build number in the docker image, that’s why I said that

I’ve created a different Yugabyte service for another project and I’m once again facing the same issue, except now I cannot connect at all. even after enabling DNS and setting the correct hostname in current_masters. no errors in logs. it just doesn’t work. I need help.

Yugabyted doesn’t allow users to update the master address. It is not advisable to set the current_masters in the yugabyted.conf file, its dynamically obtained by the yugabyted based on the current masters in the Universe.

Why are we trying to set the master address? please help us understand your usecase.

Thanks,
Nikhil

I’m trying to set the master address because the automatic IP address that is detected does not work since I’m running Yugabyte inside a docker container where IPs are dynamic and change depending on which (Compose) service starts first. When it does change, the old IP remains in the config, and Yugabyte locks up because it endlessly attempts to connect to the old IP.

Read this for more details, and keep in mind that the mentioned “fix” was temporary: Unable to determine master addresses - #5 by HeCorr

@HeCorr I’ll try to replicate the issue internally. I’m not sure why Docker is resolving the DNS address to its backing ip-address. join_ip and current_masters should have been the DNS name. I’ll get back to you on this by Tomorrow EOD.

Thanks,
Nikhil Chandrappa