0

I am trying to integrate mongoDB and elasticsearch using monstache but I am facing this error. Please help me solve it out. I will response with all the output you want.

config.toml file

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" 
Prince
  • 21
  • 2

1 Answers1

0

Solution Here is the updated toml file that worked for me -

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
Prince
  • 21
  • 2