elasticsearch 批量处理器"monstache"无法执行工作:错误400(请求错误):验证失败:1:类型缺失;

neekobn8  于 2023-03-01  发布在  ElasticSearch
关注(0)|答案(1)|浏览(334)

我正在尝试使用monstache集成mongoDB和elasticsearch,但是我遇到了这个错误。请帮助我解决这个问题。我会回复所有你想要的输出。
配置toml文件

mongo-url = "mongodb+srv://prince:mypassword@cluster0.mp297.mongodb.net/?retryWrites=true&w=majority"

elasticsearch-urls = ["http://127.0.0.1:9200"]

elasticsearch-max-conns = 10 

replay = false

resume = true

enable-oplog = true

resume-name = "default"

namespace-regex = '^Satellite\.posts$' 

direct-read-namespaces = ["Satellite.posts"]

change-stream-namespaces = ["Satellite."] 

index-as-update = true 

verbose = true 

exit-after-direct-reads = false 

[[mapping]]
namespace = "Satellite.posts" 
index = "satellite"
s5a0g9ez

s5a0g9ez1#

解决方案以下是适用于我的更新toml文件-

mongo-url = "mongodb://mongo1:27017/?replicaSet=dbrs"
# The URL to connect to MongoDB

elasticsearch-urls = ["http://elasticsearch:9200"]
# An array of URLs to connect to the Elasticsearch REST Interface

gzip = true
# When gzip is true, monstache will compress requests to Elasticsearch. 

stats = true
# When stats is true monstache will periodically print statistics accumulated by the indexer

index-stats = true
# When both stats and index-stats are true monstache will write statistics about its indexing progress in Elasticsearch instead of standard out.

elasticsearch-max-conns = 12
# The size of the Elasticsearch HTTP connection pool. 

replay = true
# When replay is true, monstache replays all events from the beginning of the MongoDB oplog and syncs them to Elasticsearch. 

resume = true
# When resume is true, monstache writes the timestamp of MongoDB operations it has successfully synced to Elasticsearch to the collection monstache.monstache. 

#resume-name = 'default'
# monstache uses the value of resume-name as an id when storing and retrieving timestamps to and from the MongoDB collection monstache.monstache.

namespace-regex ='network.company'
# When namespace-regex is given this regex is tested against the namespace, database.collection, of any insert, update, delete in MongoDB. 

direct-read-namespaces = ["network.company"]
# This option allows you to directly copy collections from MongoDB to Elasticsearch. 

enable-oplog = false
# It should only be turned on when pairing monstache v5 or v6 with a MongoDB server at a server compatibility version less than 3.6.

index-as-update = true
# When index-as-update is set to true monstache will sync create and update operations in MongoDB as updates to Elasticsearch.

verbose = true
# When verbose is true monstache with enable debug logging including a trace of requests to Elasticsearch

exit-after-direct-reads = false
# direct-read-namespaces, then exit

相关问题