I did have replica set for 2 mongoDB. I only want to connect to slave mongoDB for mongo Charts. Are you trying to say I must connect using Replica sets even I only want to connect to one DB? Can I just connect to Slave MongoDB for Charts only?
I had replica set name: ARReplica0, the slave name:
abc.domain.com. I can use IP for replica set. In this way, we do not need worry about hostname. However, it still fails. Below, I enable debug log for network, access control, tracking. It looks socket disconnected. The Charts server is
172.27.15.20 and it connect successfully to MongDB server, but it got disconnected immediately. See logs below.
2019-01-31T18:48:13.524-0600 D ASIO [NetworkInterfaceASIO-Replication-0] Starting asynchronous command 2613 on host
172.27.15.79:270172019-01-31T18:48:13.525-0600 D ASIO [NetworkInterfaceASIO-Replication-0] Request 2613 finished with response: { ok: 1.0, electionTime: ne w Date(6652427209292120065), state: 1, v: 7, hbmsg: "", set: "ARtestRS0", term: 3, primaryId: 0, durableOpTime: { ts: Timestamp 1548982086000 |1, t: 3 }, opTime: { ts: Timestamp 1548982086000|1, t: 3 } }
2019-01-31T18:48:14.426-0600 I NETWORK [thread1] connection accepted from
172.27.15.20:40650 #9 (5 connections now open)
2019-01-31T18:48:14.427-0600 D NETWORK [conn9] Starting server-side compression negotiation
2019-01-31T18:48:14.427-0600 D NETWORK [conn9] Socket recv() conn closed?
172.27.15.20:406502019-01-31T18:48:14.427-0600 D NETWORK [conn9] SocketException: remote:
172.27.15.20:40650 error: 9001 socket exception [CLOSED] server [172 .27.15.20:40650]
2019-01-31T18:48:14.427-0600 I - [conn9] end connection
172.27.15.20:40650 (5 connections now open)
2019-01-31T18:48:15.525-0600 D ASIO [ReplicationExecutor] startCommand: RemoteCommand 2615 -- target:
172.27.15.79:27017 db:admin expDate: 2019-01-31T18:48:25.525-0600 cmd:{ replSetHeartbeat: "ARtestRS0", configVersion: 7, from: "TXXXXXX::27017", fromId: 1, term:
Thanks.