Configure hostnames for a DNS server for a
MongoDB Community instance
MongoDB Community
instance
To
make a
MongoDB Community
cluster reachable
externally by hostnames, you must configure hostnames for the DNS server for VMware Cloud Director extension for Data Solutions
.How to configure hostnames for DNS server
for a MongoDB Community instance
MongoDB Community
instance
To
deploy
MongoDB Community
instances with a
service load balancer, you must configure hostnames for the replica nodes.- Log in toVMware Cloud Director extension for Data SolutionsfromVMware Cloud Director.
- Click.
- Enter the necessary details.
- ClickShow Advanced Settings.
- SelectExpose Service by Load Balancer.Verify thatEnable TLSis checked and locked.
- In Replica Node, enter the hostnames that will be used to connect externally or internally toMongoDBfrom theKubernetescluster.For example,replica-0.mongodb.local,replica-1.mongodb.local, andreplica-2.mongodb.local.
- Select a PVC policy and clickCreate.
- In theInstancesmenu, verify the status of the newMongoDB Communityis running.
- Click the instance name and clickResource Details.
- Navigate toAddressand note down the value.For example,10.138.110.100:27017,10.138.110.101:27017,10.138.110.102:27017, replica-0.mongodb.local:27017, replica-1.mongodb.local:27017, and replica-2.mongodb.local:27017.
The
MongoDB Community
instance is deployed
successfully, but you are not able to visit MongoDB
by using hostnames. You must configure your upstream DNS
server or custom DNS server.Configure your upstream DNS
server or custom DNS server. See Configure
an upstream DNS server or a custom DNS server.
Configure an upstream DNS server or a
custom DNS server
To
complete the configuration of hostnames for the replica nodes, you must configure the DNS
server.
- Add the DNS server forward record intoKubernetescluster’s ConfigMapcoredns.
- Add the hostname to IP mappings of theMongoDBcluster to the DNS server.For example:
- 10.138.110.100 --> replica-0.mongodb.local
- 10.138.110.101 --> replica-1.mongodb.local
- 10.138.110.102 --> replica-2.mongodb.local
- Add the DNS server to theMongoDBclient machine.