Reputation: 121
I installed python, pymongo via easy_install script and tired the command easy_install mongo-connector. But after installation I could not find mongo_connector.py in the python directory? Was there some issue by installing mongo-connector?
Then I tired python setup.py install for the downloaded mongodb-connector.tar.gz and it installed the package.
PS C:\Python33> python C:\Python33\Lib\site-packages\mongo-connector\mongo_connector.py -m localhost:27017 -t http://loc
alhost:8080/solr
2014-01-23 16:52:55,596 - INFO - Beginning Mongo Connector
2014-01-23 16:52:55,596 - INFO - No doc manager specified, using simulator.
2014-01-23 16:52:56,596 - CRITICAL - MongoC`onnector: Can't find OplogProgress file!
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Python33\lib\threading.py", line 901, in _bootstrap_inner
self.run()
File "C:\Python33\Lib\site-packages\mongo-connector\mongo_connector.py", line 204, in run
repl_set = prim_admin.command("replSetGetStatus")['set']
File "C:\Python33\lib\site-packages\pymongo-2.6.3-py3.3-win-amd64.egg\pymongo\database.py", line 396, in command
msg, allowable_errors)
File "C:\Python33\lib\site-packages\pymongo-2.6.3-py3.3-win-amd64.egg\pymongo\helpers.py", line 147, in _check_command
_response
raise OperationFailure(msg % errmsg, code)
pymongo.errors.OperationFailure: command SON([('replSetGetStatus', 1)]) failed: not running with --replSet
But the connector wont work, has anybody experience by using mongo-connector on windows?
Upvotes: 4
Views: 2528
Reputation: 1164
You need to be running a replica set instead of a standalone mongod to get mongo-connector to work, as described in the readme: https://github.com/10gen-labs/mongo-connector/blob/master/README.markdown
The reason for this is that mongo connector relies on the systems in place that allow replica sets to copy each other (the Oplog
mentioned in the error) in order to copy your data. If you are just trying this out on a single machine, it's still possible to configure a replica set by starting multiple processes on the same machine. See the docs here: http://docs.mongodb.org/manual/tutorial/deploy-replica-set/
Upvotes: 1