ES-MongoDB学习错误1_Could not import mongo_connector.doc_managers.elastic_doc_manager

安装前面几篇文章,安装好mongo_connector后,进行文件从MongoDB到ES的备份,使用下面的命令操作:

<span style="font-size:14px;">mongo-connector -m localhost:27017 -t localhost:9200 -d elastic_doc_manager</span>

出现错误:

<span style="font-size:14px;"><pre name="code" class="html">No handlers could be found for logger "mongo_connector.util"
Traceback (most recent call last):
  File "/usr/local/bin/mongo-connector", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/mongo_connector/util.py", line 85, in wrapped
    func(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/mongo_connector/connector.py", line 1041, in main
    conf.parse_args()
  File "/usr/local/lib/python2.7/site-packages/mongo_connector/config.py", line 118, in parse_args
    option, dict((k, values.get(k)) for k in option.cli_names))
  File "/usr/local/lib/python2.7/site-packages/mongo_connector/connector.py", line 824, in apply_doc_managers
    module = import_dm_by_name(dm['docManager'])
  File "/usr/local/lib/python2.7/site-packages/mongo_connector/connector.py", line 814, in import_dm_by_name
    "vailable doc managers." % full_name)
mongo_connector.errors.InvalidConfiguration: Could not import mongo_connector.doc_managers.elastic_doc_manager. </span>
<span style="font-size:14px;">It could be that this doc manager has been moved out of this project and is maintained elsewhere. </span>
<span style="font-size:14px;">Make sure that you have the doc manager installed alongside mongo-connector. Check the README for a list of available doc managers.
[iienet@slave1 site-packages]$</span>

 
根据说明,可能是elastic_doc_manager的问题,继续深入寻找原因 

mongo_connector的安装位置是

<span style="font-size:14px;">[iienet@slave1 site-packages]$ ls
bson                                 pysolr-3.4.0.dist-info
easy-install.pth                     pysolr.py
elastic_doc_manager-0.1.0.dist-info  pysolr.pyc
elasticsearch                        README
elasticsearch-1.9.0.dist-info        requests
gridfs                               requests-2.9.1.dist-info
mongo_connector                      setuptools-20.6.7-py2.7.egg
mongo_connector-2.3.dist-info        setuptools.pth
pip-8.1.1-py2.7.egg                  urllib3
pymongo                              urllib3-1.15.dist-info
pymongo-3.2.2-py2.7.egg-info
[iienet@slave1 site-packages]$ pwd
/usr/local/lib/python2.7/site-packages
[iienet@slave1 site-packages]$ </span>

这是改正错误后的结果,出现错误前,里面并没有es的信息

继续查找elastic_doc_manager的相关信息

地址是

https://pypi.python.org/pypi/elastic-doc-manager#downloads

发现它需要安装

<span style="font-size:14px;">pip install elastic-doc-manager</span>


安装后,重新操作,问题解决。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值