mlab

Why is PyMongo 3 giving ServerSelectionTimeoutError?

社会主义新天地 提交于 2019-11-27 03:59:06
问题 I'm using: Python 3.4.2 PyMongo 3.0.2 mongolab running mongod 2.6.9 uWSGI 2.0.10 CherryPy 3.7.0 nginx 1.6.2 uWSGI start params: --socket 127.0.0.1:8081 --daemonize --enable-threads --threads 2 --processes 2 I setup my MongoClient ONE time: self.mongo_client = MongoClient('mongodb://user:pw@host.mongolab.com:port/mydb') self.db = self.mongo_client['mydb'] I try and save a JSON dict to MongoDB: result = self.db.jobs.insert_one(job_dict) It works via a unit test that executes the same code path

Does mongoDB have reconnect issues or am i doing it wrong?

拜拜、爱过 提交于 2019-11-26 18:52:02
问题 I'm using nodejs and a mongoDB - and I'm having some connection issues. Well, actually "wake" issues! It connects perfectly well - is super fast and I'm generally happy with the results. My problem: If i don't use the connection for a while (i say while, because the timeframe varies 5+ mins) it seems to stall. I don't get disconnection events fired - it just hangs. Eventually i get a response like Error: failed to connect to [ * .mongolab.com: * ] - ( * = masked values) A quick restart of the

A timeout occured after 30000ms selecting a server using CompositeServerSelector

眉间皱痕 提交于 2019-11-26 11:25:15
问题 I try to deploy my Mongo database in Mongolabs, everything works fine, and I create a new database. Please see my connectionstring. public DbHelper() { MongoClientSettings settings = new MongoClientSettings() { Credentials = new MongoCredential[] { MongoCredential.CreateCredential(\"dbname\", \"username\", \"password\") }, Server = new MongoServerAddress(\"ds011111.mongolab.com\", 11111), //ConnectTimeout = new TimeSpan(30000) }; Server = new MongoClient(settings).GetServer(); DataBase =