pymongo


Mongos + Pymongo 2.5 ==>No suitable hosts found


Our application is using pymongo. I'm trying to connect to mongos. The code fails on the following line
pymongo.MongoReplicaSetClient(ec2-aa-bbb-124-22.compute-1.amazonaws.com:27017,
replicaSet=self.class_settings['mongo_rs'])
Exception
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 /Users/.../server_tornado.py --config=conf/development.conf --port=9001
Traceback (most recent call last):
File "/Users/..../server_tornado.py", line 319, in
BaseCatalog.db_instance = DBInit(config=settings)
File "/Users/..../lib/sc/singleton.py", line 20, in call
cls._instances[cls] = super(Singleton, cls).call(*args, **kwargs)
File "/Users/..../app/models/db_init.py", line 50, in init
raise Exception("init() => " + str(err))
Exception: init() => No suitable hosts found
Process finished with exit code 1`
Found the solution, if at all anyone faces this issue:
Using MongoClient instead of MongoReplicaClient fixes the issue. This is because Mongos acts like a single instance of mongodb.

Related Links

how to find right version of bson from pip for pymongo/mongoengine
How to enable `projection` in pymongo query class `find()`?
Variables don't hold value for very long pymongo ipython
pymongo upgrade to 3.0.3 causes this statement to fail
UUID to NUUID in Python
how to test for empty mongodb query in pymong
read video file from mongodb with pymongo
Get OperationFailure error with PyMongo 2.7.1
Inserting string as regular string in mongodb
Mongos + Pymongo 2.5 ==>No suitable hosts found
pymongo collection add item using update
How to convert objectid to string
Conditional atomic mongo remove with different results
python script to connect to mongodb master
flask-admin and pymongo search
Running code when mongoengine loads a document

Categories

HOME
apache-nifi
generics
ontouchlistener
applescript
selenium-builder
transactions
dafny
plpgsql
swift2
apache-kafka-connect
dji-sdk
linker
fedora
joomla3.2
u-boot
cisco
gtk
spring-security-oauth2
match
lapack
game-maker
bootstrap-switch
fullcalendar-scheduler
jodatime
heap-dump
temperature
vmware-workstation
exe
libgit2
unity-container
weex
kamailio
ava
function-points
introspection
webviewclient
onchange
annotation-processing
tsung
nic
credit-card
snap-framework
opnet
shapeless
xmlunit
directfb
cmis
java-stream
ftp-server
code-rally
ng-repeat
suds
grails3.2.0
viewmodel
md5-file
iptv
simple-schema
webvtt
mongodb-aggregation
oid
boost-compute
ogg
streamwriter
okio
s-function
openquery
decoder
always-on-top
mathml
openseadragon
declarative
simian
verisign
mnesia
flipclock
deeplink
libz
bootstrap-wysiwyg
ssmtp
microsoft-expression-web
symja
xml-signature
coding-efficiency
commenting
django-sites
iosched
facebook-game-groups
eclim
yii-booster
libxml-js
form-for
bcdedit
unicoins
web-frameworks
background-thread
donut-chart
dojo-1.9
ip-geolocation
live-wallpaper
quartz-core
django-apps
litespeed
snackjs
getopts
winsxs
mongrel2
downgrade
chunking
getimagesize
html-components
rawcontacts
wmd-editor
external-sorting
ntruencrypt

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App