Mongos + Pymongo 2.5 ==>No suitable hosts found -
our application using pymongo. i'm trying connect mongos. code fails on 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 exit code 1`
found solution, if @ faces issue:
using mongoclient instead of mongoreplicaclient fixes issue. because mongos acts single instance of mongodb.
Comments
Post a Comment