python – 在Windows上安装mongo-connector
发布时间:2020-12-20 13:39:49 所属栏目:Python 来源:网络整理
导读:我通过easy_install脚本安装了 python,pymongo,并且厌倦了easy_install mongo-connector命令.但安装后我在python目录中找不到mongo_connector.py?安装mongo-connector有什么问题吗? 然后我厌倦了python setup.py安装下载的mongodb-connector.tar.gz并安装
我通过easy_install脚本安装了
python,pymongo,并且厌倦了easy_install mongo-connector命令.但安装后我在python目录中找不到mongo_connector.py?安装mongo-connector有什么问题吗?
然后我厌倦了python setup.py安装下载的mongodb-connector.tar.gz并安装了包. PS C:Python33> python C:Python33Libsite-packagesmongo-connectormongo_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:Python33libthreading.py",line 901,in _bootstrap_inner self.run() File "C:Python33Libsite-packagesmongo-connectormongo_connector.py",line 204,in run repl_set = prim_admin.command("replSetGetStatus")['set'] File "C:Python33libsite-packagespymongo-2.6.3-py3.3-win-amd64.eggpymongodatabase.py",line 396,in command msg,allowable_errors) File "C:Python33libsite-packagespymongo-2.6.3-py3.3-win-amd64.eggpymongohelpers.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/ (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |