【发布时间】:2016-10-01 10:50:32
【问题描述】:
mongoconnector 以前可以工作,但现在不行。这是错误的很长跟踪的一部分:
...
return f(*args, **kwargs)
File "/home/ubuntu/anaconda/lib/python2.7/site-packages/mongo_connector/doc_managers/elastic2_doc_manager.py", line 203, in bulk_upsert
for ok, resp in responses:
File "/home/ubuntu/anaconda/lib/python2.7/site-packages/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 "/home/ubuntu/anaconda/lib/python2.7/site-packages/elasticsearch/helpers/__init__.py", line 132, in _process_bulk_chunk
raise BulkIndexError('%i document(s) failed to index.' % len(errors), errors)
BulkIndexError: (u'86 document(s) failed to index.', [{u'index': {u'status': 400, u'_type': u'wikis', u'_id': u'574f3f9253a18f8397ecc13a', u'error': {u'caused_by': {u'reason': u'Cannot parse "+1960-00-00T00:00:00Z": Value 0 for monthOfYear must be in the range [1,12]', u'type': u'illegal_field_value_exception'}, u'reason': u'failed to parse [claims.P1082.qualifiers.P585.datavalue.value.time]', u'type': u'mapper_parsing_exception'}, u'_index': u'test1'}},
...
2016-06-01 21:32:55,806 [ERROR] mongo_connector.oplog_manager:557 - OplogThread: Failed during dump collection cannot recover! Collection(Database(MongoClient('localhost', 27017), u'local'), u'oplog.rs')
2016-06-01 21:32:56,618 [ERROR] mongo_connector.connector:302 - MongoConnector: OplogThread <OplogThread(Thread-6, started 139915396376320)> unexpectedly stopped! Shutting down
在外面启动 MongoDB:
$ mongod --dbpath data --replSet "rs0" #在端口27017上创建副本集
$ mongo #初始化副本集
在 mongo repl 中,我输入:
rs.initiate({"_id" : "rs0","version" : 1,"members" : [{"_id" : 0,"host" : "localhost:27017"}]})
Elasticsearch 已经在 9200 端口启动。
现在一起
$ mongo-connector -m localhost:27017 -t localhost:9200 -d elastic2_doc_manager
...然后我得到错误。
【问题讨论】:
标签: mongodb ubuntu elasticsearch pymongo