I have found the answer.
- 1st possible way: Using mongosqld and mongo drdl
You can use the same mongosqld with different ports.
eg:
mongosqld --addr 127.0.0.1:3307 --mongo-uri=mongodb://127.0.01:27017
--schema db1.drdl -vv
mongosqld --addr 127.0.0.1:3309
--mongo-uri=mongodb://192.188.188.39:27017 --schema db2.drdl -vv
Here 127.0.0.1:27017 is Mongo_A and 192.188.188.39:27017 is Mongo_B both I'm accessing from the same Localhost and same mongosqld with different ports you have to run both these commands in different terminals.
- 2nd possible way is by using mongosqld as service
In this case, we need to manually create 2 separate service with 2 different mongosqld conf files in which mongosqld port will be different.
As Iām using Linux, what I did is I just created two separate services in /etc/systemd/system for mongosqld that had two separate configuration files (Inside which we mention 2 mongo server IPs and 2 different mongosqld ports). Then since I was using clear text authentication I needed to create SSL for both mongosqld services
ref: https://docs.mongodb.com/bi-connector/v2.13/tutorial/ssl-setup/
Then finally I was successful in connecting both Mongo Servers.