gpt4 book ai didi

mongodb - 无法运行mongo-connector

转载 作者:行者123 更新时间:2023-12-02 23:31:45 26 4
gpt4 key购买 nike

我已经在mongodb服务器中安装了mongo-connector。

我通过发出命令来执行

mongo-connector -m [remote mongo server IP]:[remote mongo server port] -t [elastic search server IP]:[elastic search server Port]  -d elastic_doc_manager.py

我还尝试了此操作,因为mongo在具有默认端口的同一服务器上运行。
mongo-connector -t [elastic search server IP]:[elastic search server Port]  -d elastic_doc_manager.py

我遇到错误
Traceback (most recent call last):
File "/usr/local/bin/mongo-connector", line 9, in <module>
load_entry_point('mongo-connector==2.3.dev0', 'console_scripts', 'mongo-connector')()

File "/usr/local/lib/python2.7/dist-packages/mongo_connector-2.3.dev0-py2.7.egg/mongo_connector/util.py", line 85, in wrapped
func(*args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/mongo_connector-2.3.dev0-py2.7.egg/mongo_connector/connector.py", line 1037, in main
conf.parse_args()

File "/usr/local/lib/python2.7/dist-packages/mongo_connector-2.3.dev0-py2.7.egg/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/dist-packages/mongo_connector-2.3.dev0-py2.7.egg/mongo_connector/connector.py", line 820, in apply_doc_managers
module = import_dm_by_name(dm['docManager'])

File "/usr/local/lib/python2.7/dist-packages/mongo_connector-2.3.dev0-py2.7.egg/mongo_connector/connector.py", line 810, in import_dm_by_name
"Could not import %s." % full_name)

**mongo_connector.errors.InvalidConfiguration: Could not import mongo_connector.doc_managers.elastic_doc_manager.py.**

注意:我正在使用python2.7
和mongo-connector 2.3

flex 搜索服务器是2.2

有什么建议么 ?

[编辑]
应用 Val的建议后:

2016-02-29 19:56:59,519 [CRITICAL] mongo_connector.oplog_manager:549 - Exception during collection dump

Traceback (most recent call last):

File "/usr/local/lib/python2.7/dist-packages/mongo_connector-2.3.dev0-py2.7.egg/mongo_connector/oplog_manager.py", line 501, in do_dump

upsert_all(dm)

File "/usr/local/lib/python2.7/dist-packages/mongo_connector-2.3.dev0-py2.7.egg/mongo_connector/oplog_manager.py", line 485, in upsert_all dm.bulk_upsert(docs_to_dump(namespace), mapped_ns, long_ts)

File "/usr/local/lib/python2.7/dist-packages/mongo_connector-2.3.dev0-py2.7.egg/mongo_connector/util.py", line 32, in wrapped

return f(*args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/mongo_connector-2.3.dev0-py2.7.egg/mongo_connector/doc_managers/elastic_doc_manager.py", line 190, in bulk_upsert

for ok, resp in responses:

File "/usr/local/lib/python2.7/dist-packages/elasticsearch-1.9.0-py2.7.egg/elasticsearch/helpers/init.py", line 160, in streaming_bulk

for result in _process_bulk_chunk(client, bulk_actions, raise_on_exception, raise_on_error, **kwargs):

File "/usr/local/lib/python2.7/dist-packages/elasticsearch-1.9.0-py2.7.egg/elasticsearch/helpers/init.py", line 132, in _process_bulk_chunk

raise BulkIndexError('%i document(s) failed to index.' % len(errors), errors)

BulkIndexError: (u'2 document(s) failed to index.',..document_class=dict, tz_aware=False, connect=True, replicaset=u'mss'), u'local'), u'oplog.rs')

2016-02-29 19:56:59,835 [ERROR] mongo_connector.connector:302 - MongoConnector: OplogThread unexpectedly stopped! Shutting down



嗨,瓦尔,

我连接了另一个mongodb实例,该实例只有一个数据库,有一个包含30,000+条记录的集合,并且能够成功执行它。先前的mongodb集合有多​​个数据库(大约7个),内部有多个集合(每个数据库大约5到15个),并且所有集合中都有大量文档(范围从500到50,000)。

Mongo连接器是否由于mongo数据库中存在大量数据而发生故障?

我还有其他疑问

一种。是否可以仅对位于不同数据库中的mongodb中的特定集合进行索引编制?我只想索引特定的集合(而不是整个数据库)。我该如何实现?

b。在elasticsearch中,我可以看到一个集合的重复索引。第一个是数据库名称(如预期的那样),另一个是数据库名称mongodb_meta,它们都具有相同的数据,如果我更改集合,则两个集合中都将进行更新。

C。是否可以配置输出索引名称或任何其他参数?

最佳答案

我认为唯一的问题是您在文档管理器上具有.py扩展名(在mongo-connector 2.0之前需要它),您只需要删除它:

mongo-connector -m [remote mongo server IP]:[remote mongo server port] -t [elastic search server IP]:[elastic search server Port]  -d elastic_doc_manager

关于mongodb - 无法运行mongo-connector,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35660940/

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