最开始报的错如下图,根据截图最下面的报错得知是版本问题,此时,我所用的版本是:
elasticsearch7.1.1 , go1.14.4 ,monstache5.x ,mongo3.6.18.
ERROR 2022/07/26 17:54:02 Error starting change stream. Will retry: (Location40415) BSON field '$changeStream.allChangesForCluster' is an unknown field.
ERROR 2022/07/26 17:54:02 Error starting change stream. Will retry: connection(192.168.214.184:27017[-4]) failed to write: context canceled
ERROR 2022/07/26 17:54:02 Deprecation warning: 299 Elasticsearch-7.1.1-7a013de "[types removal] Specifying types in bulk requests is deprecated."
后来得知了几个版本搭配:
go1.14.x + elasticsearch 6.x + monstache5.x
go.1.16.x + elasticsearch 7.x + monstache6.x
于是我把go的版本升级成了1.16.6 ,具体版本可去官网查看https://golang.google.cn/dl/
对应地,monstache也换成6.x版本
换了版本之后,执行monstache -f config.toml,又有错:
Error starting change stream. Will retry.: BSON field '$changeStream.startAtOperationTime' is an unknown field.
这个就简单了,去 config.toml中将resume-strategy = 0
改成resume-strategy = 1