My server is running on AWS EC2 and I noticed that it has 45000 mongo connections from our app's server IP. Though in code, there is only one mongo connection getting created at start.
Can anyone help me out here in debugging why it has so many connections?
PS: We use PM2 to restart the server, could it be because of that?
Related
I am trying to connect an application in .net core from a linux machine to a mongo replicaset. But I am getting a timeout error.
Unhandled exception. System.TimeoutException: A timeout occured after 30000ms selecting a server using CompositeServerSelector
The replica ips are accessible from this machine, a response is obtained by pinging.
If in linux the connection to mongo is to a single instance of the replica, it works correctly.
This same code in windows connects without problem.
If you are certain IP connectivity works, most likely you have the hostnames wrong. The hostnames used in RS config must work from each client.
See https://github.com/p-mongo/mongodb-faq.
I'm new to MongoDB.
My manager says that he has deployed MongoDB on Docker for testing purposes. He shared the server name and it is running on 27017 port.
He told me that I do not need to install Docker or MongoDB on my VDI, I just need to connect to the MongoDB server from client.
Now, I'm totally clueless on how to do that. Any help will be highly appreciated.
Thanks in Advance 😊
Try checking if you can access the said mongodb at 27017 port. You can use telnet or such similar commands. If the connection is successful you can use the mongodb_host and port directly in your script.
I'm having trouble remotely connecting to my MongoDB instance; I've deployed it using the MongoDB AWS Quick Start, and can connect via SSH as per the "Testing" section of the Quick Start guide.
However, when trying to connect remotely (I'm using the PyMongo driver), I run into a pymongo.errors.ServerSelectionTimeoutError: ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com:27017: timed out error.
I've tried setting bind_ip to 0.0.0.0 as well as an Elastic IP to the VPC instance that the mongod is running on, but to no avail. In fact, even pinging the EIP leads to a timeout (although pinging the NAT instance doesn't).
With PyMongo I've tried both DNS's, with and without SSL. I can successfully connect to MongoDB on localhost.
These are the security groups for the VPC: AWS security groups
If anyone has a clue on what I might be doing wrong I would greatly appreciate it; I've been struggling with this for over a day now. Thanks!
My service is running on one server with Metoer project and MongoDB,
and there's one another replication server for MongoDB.
So I've configured Mongo replication with two official IP, and configured two MONGO_OPLOG_URL with the same two official IP when running Meteor project.
The question is, in this case,
when Meteor project fetch some data, does it use the network to get the data from the local MongoDB?
Because I didn't setup any hostname setting for its own official IP on my machine, so I doubt it may occur some data traffic to outside.
If I am right, how to config to use the Meteor server its localhost MongoDB without network traffic,
or if I am wrong, how does it work to use localhost db inside of the server if I use official IP for replication setting and meteor running environment?
Thanks in advance.
I'm new to MongoDB. I'm trying to connect to my remote mongo database from my work machine( I tried for both mongohq as well as mongolab). I'm getting the error listed below. When I run the same command from my home machine it runs fine and does connect to remove mongo database. I'm not sure what is messed up on my work machine but I'd like to fix it. Thanks for you help.
MongoDB shell version: 2.4.9
connecting to: linus.mongohq.com:10097/mydb
Thu Jan 16 04:16:02.689 Error: couldn't connect to server linus.mongohq.com:10097
at src/mongo/shell/mongo.js:147
exception: connect failed
As per question comments, your mongo shell client can't connect to the mongo instance. Assuming that your internet connectivity is fine, the most common reason for the failure is that the ports are blocked on your network.
Some ISPs automatically block these ports by default as an additional security protection for users that don't need them open. Contact your ISP or network admin, they should be able to help you out.