Commit 12abae8
Remove hostnameMaxLen for Mongo URL (#6693)
* Make hostnameMaxLen an environment variable.
In our Mongo cluster, we have 2 shards equalling 7 hosts that come in as a long comma-delimited list of host names. This hostNameMaxLen of 255 should not apply to a mongo connection string like that:
mongodb://<USER>:<PASSWORD>@MYCLUSTER-shard-00-00.luszb.azure.mongodb.net:27016,MYCLUSTER-shard-00-01.luszb.azure.mongodb.net:27016,MYCLUSTER-shard-00-02.luszb.azure.mongodb.net:27016,MYCLUSTER-shard-00-03.luszb.azure.mongodb.net:27016,MYCLUSTER-shard-02-00.luszb.azure.mongodb.net:27016,MYCLUSTER-shard-02-01.luszb.azure.mongodb.net:27016,MYCLUSTER-shard-02-02.luszb.azure.mongodb.net:27016/dev?ssl=true&authSource=admin
We was using the SRV mongo connection string type which is much shorter:
mongodb+srv://<USER>:<PASSWORD>@MYCLUSTER-luszb.azure.mongodb.net/dev
But we were finding it to be unreliable with Azure's DNS. We rarely change our cluster configuration, so having the long connection string would be more reliable
If these changes should be approached in some other manner, I'd be happy to do that.
* Update mongodbUrl.js
Co-authored-by: Diamond Lewis <[email protected]>1 parent 68a1b30 commit 12abae8
1 file changed
+2
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
| |||
293 | 292 | | |
294 | 293 | | |
295 | 294 | | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
| 295 | + | |
| 296 | + | |
302 | 297 | | |
303 | 298 | | |
304 | 299 | | |
| |||
0 commit comments