0

我需要将数据从 同步MongoDBSolr

当我发出命令时

mongo-connector -m dbserver:27018 -n shop -t http://localhost:8983/solr/Search --auto-commit-interval=0 -d solr_doc_manager

错误日志是:

2016-12-13 15:21:40,461 [CRITICAL] mongo_connector.oplog_manager:630 - Exception during collection dump
Traceback (most recent call last):
  File "c:\program files (x86)\python35-32\lib\site-packages\mongo_connector\oplog_manager.py", line 583, in do_dump
    upsert_all(dm)
  File "c:\program files (x86)\python35-32\lib\site-packages\mongo_connector\oplog_manager.py", line 567, in upsert_all
    dm.bulk_upsert(docs_to_dump(namespace), mapped_ns, long_ts)
  File "c:\program files (x86)\python35-32\lib\site-packages\mongo_connector\util.py", line 32, in wrapped
    return f(*args, **kwargs)
  File "c:\program files (x86)\python35-32\lib\site-packages\mongo_connector\doc_managers\solr_doc_manager.py", line 288, in bulk_upsert
    batch = list(next(cleaned) for i in range(self.chunk_size))
  File "c:\program files (x86)\python35-32\lib\site-packages\mongo_connector\doc_managers\solr_doc_manager.py", line 288, in <genexpr>
    batch = list(next(cleaned) for i in range(self.chunk_size))
  File "c:\program files (x86)\python35-32\lib\site-packages\mongo_connector\doc_managers\solr_doc_manager.py", line 286, in <genexpr>
    cleaned = (self._clean_doc(d, namespace, timestamp) for d in docs)
  File "c:\program files (x86)\python35-32\lib\site-packages\mongo_connector\oplog_manager.py", line 509, in docs_to_dump
    database, coll = namespace.split('.', 1)
ValueError: not enough values to unpack (expected 2, got 1)
2016-12-13 15:21:40,464 [ERROR] mongo_connector.oplog_manager:638 - OplogThread: Failed during dump collection cannot recover! Collection(Database(MongoClient(host=['dbserver:27018'], document_class=dict, tz_aware=False, connect=True, replicaset='shop'), 'local'), 'oplog.rs')
2016-12-13 15:21:41,460 [ERROR] mongo_connector.connector:304 - MongoConnector: OplogThread <OplogThread(Thread-2, started 4972)> unexpectedly stopped! Shutting down

我不知道我错在哪里。请帮我解决这个问题。谢谢你。

4

1 回答 1

1

从参数的文档-n

要从 MongoDB 读取的集合列表。集合名称应为 database_name.collection_name

因此,根据 MongoDB 的结构,您是否缺少参数database_name或参数。collection_name

于 2016-12-13T11:41:38.027 回答