I have 2 Oracle servers:
#1 - for the NodeJS server;
#2 - for the self hosted MongoDB;
My problem is:
the second server is connected to the first one using Load Balancer, the MongoDB is working properly on the DB server but when i’m going to connect to it using NodeJS server i just can’t do that… for example my DB server have this ip from the NodeJS server: 10.0.2.134 (my NodeJS server have other IP - let’s say 123.123.123.123), i’m trying to connect this way:
mongoose.connect('mongodb://10.0.2.134:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.12>.then(() => console.log('MongoDB connected'))
.catch(err => console.log(err));
but nothing happens… i only see this error:
MongooseServerSelectionError: connect EHOSTUNREACH 10.0.2.134:27017
at _handleConnectionErrors (/home/ubuntu/game_server/node_modules/mongoose/lib/connection.js:897:11)
at NativeConnection.openUri (/home/ubuntu/game_server/node_modules/mongoose/lib/connection.js:848:11) {
reason: TopologyDescription {
type: 'Single',
servers: Map(1) { '10.0.2.134:27017' => [ServerDescription] },
stale: false,
compatible: true,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
setName: null,
maxElectionId: null,
maxSetVersion: null,
commonWireVersion: 0,
logicalSessionTimeoutMinutes: null
},
code: undefined
}
I have tried all things related to the Ports etc…
What can solve my problem?
Thanks to all!