gpt4 book ai didi

python - 在 Windows 上安装 mongo-connector

转载 作者:可可西里 更新时间:2023-11-01 09:15:27 25 4
gpt4 key购买 nike

我通过 easy_install 脚本安装了 python、pymongo,并厌倦了命令 easy_install mongo-connector。但是安装后在python目录下找不到mongo_connector.py?安装 mongo-connector 有什么问题吗?

然后我厌倦了 python setup.py install 下载的 mongodb-connector.tar.gz 并安装了包。

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

但是连接器无法工作,有人在 Windows 上使用过 mongo-connector 吗?

最佳答案

您需要运行副本集而不是独立的 mongod 才能使 mongo-connector 正常工作,如自述文件中所述:https://github.com/10gen-labs/mongo-connector/blob/master/README.markdown

原因是 mongo 连接器依赖于允许副本集相互复制的系统(错误中提到的 Oplog)以复制您的数据。如果您只是在一台机器上尝试这个,仍然可以通过在同一台机器上启动多个进程来配置副本集。请在此处查看文档:http://docs.mongodb.org/manual/tutorial/deploy-replica-set/

关于python - 在 Windows 上安装 mongo-connector,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21312403/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com