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

python motor mongo cursor length or peek next
PyMongo check if update succeeded
insert and query an OrderedDict in MongoHQ
Return .str of ObjectID using pymongo
Selecting the lowest/highest with find_one in Pymongo
Safe use of Pymongo's find_one
Pymongo $in + $regex
How can I get pymongo to always return str and not unicode?
SON Manipulator in mongo queries
How to append a document to a 2nd level embedded model list document in Django and mongoengine
pymongo multiple update $in
How to get negetive of a complex where clause in mongo db
pymongo justOne & multi
How to make pymongo's find() return a list?
convert pymongo cursor to json
How to do query on pymongo and get values in the reverse order of inserting

Categories

HOME
mpdf
focus
livecode
hid
website
google-webmaster-tools
gallery
hyperledger
haxe
javafx-8
reportviewer
android-externalstorage
sslhandshakeexception
ex
web-deployment
exe
google-sites
cloudsim
renderscript
tableview
android-permissions
bsd
sharedpreferences
intel
chronicle-queue
cellular-network
points
onchange
bobo-browse.net
ibm-connections
javax.persistence
openbr
matlab-app-designer
custom-keyboard
gnu-classpath
apptentive
creation
db2-luw
amazon-kms
orchardcms-1.8
jslint
microsoft-ui-automation
llvm-ir
sspi
stat
netapp
data-uri
oauth2-playground
grails3.2.0
flipkart
jenkins-slave
webalizer
nusoap
renderman
maven-jaxb2-plugin
exc-bad-access
freshdesk
android-mediarecorder
stateless-session-bean
hmmlearn
qtextedit
ogg
haraka
e
decoder
carmen
seccomp
coovachilli
apache-pig-grunt
strpos
jemdoc
management-studio-express
smart-tv
lowercase
pythonxy
extend
green-threads
modern.ie
mobilefirst-server
gflags
sablecc
mutators
comctl32
rebar
utf8-decode
lmax
visual-c++-2012
osascript
senchatouch-2.4
.htpasswd
reference-counting
commenting
meteor-collections
xulrunner
boolean-algebra
oxygene
jms-serializer
assetic
spring-security-acl
pbkdf2
san
insertonsubmit
email-verification
linkbutton
idispatch
live-wallpaper
chronometer
word-frequency
gamesalad
n-queens
sql-parametrized-query
kext
upshot
airprint
libxslt
bass
uninstaller
resharper-5.0
browser-based
rawcontacts
ppc
main-method
levels
parentid

Resources

Encrypt Message