Mongo shortening hostnames

I notice in the log of my config server the following log entries:

2021-11-09T08:24:58.984+0000 I NETWORK [Balancer] changing hosts to rs2/mongodbsnaprestorers2:27019 from rs2/
2021-11-09T08:24:08.427+0000 I NETWORK [Balancer] changing hosts to rs1/mongodbsnaprestorers1:27018 from rs1/

The same entries I notice in the logs of my shard servers, but they shorten the name of my config servers:

2021-11-09T08:22:27.303+0000 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] changing hosts to csReplSet/mongodbsnaprestorers1:27021 from csReplSet/

Why does mongo shorten my servers names? This breaks ssl for me because of how CN is set up and I get errors like these:

2021-11-08T18:56:56.326+0000 E NETWORK [initandlisten] The server certificate does not match the host name. Hostname: mongodbsnaprestorers1 does not match CN: *
2021-11-08T18:56:56.326+0000 W NETWORK [initandlisten] Unable to reach primary for set csReplSet

My mongo version is 3.6.

I found out the root of the problem. Shard replica sets and config replica sets were started with rs.initiate() and the default configurations were used, therefore instead of using the fqdn of the host, it used just the hostname, that’s why they were shortening each other’s names.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.