-1

I have a working monstache deployment using docker for elasticsearch and mongodb synchronization. the configuration file is as shown below:

mongo-url = "mongodb://project-db:27017" 
elasticsearch-urls = ["http://es7:9200"]

direct-read-namespaces = ["project.data"]
change-stream-namespaces = ["project.data"] 

[logs]
error = "./logs/error.log" 

[[mapping]]
namespace = "project.data" 
index = "Project"

 
[[script]]
namespace = "project.data"
path = "./scripts/collection.js"
routing = true

However, I need to add several other databases like 10 of them. mongo-url is a string. Is there a way to add several mongodb sources for indexing?

Ikar Pohorský
  • 4,617
  • 6
  • 39
  • 56
Denn
  • 447
  • 1
  • 6
  • 27

1 Answers1

-1

Monstache seems reasonably light. I'd recommend using multiple dockers in a docker compose setup. Something like so:

version: '3.5'
networks:
  proxynet:
    name: proxynet
    driver: bridge
services:
  mongodb:
    networks:
      - mongodbnet
      - proxynet
    ports: 
      - 27017:27017
    container_name: mongodb
    image: mongo:4.2.17
    command: --auth --replSet mongoset
    volumes:
      - /path/to/docker/mongodb/data:/data/db
    restart: unless-stopped
  elasticsearch:
    container_name: elasticsearch 
    networks:
      - proxynet
    ports:
      - 9200:9200 
      - 9300:9300
    environment: 
      - "discovery.type=single-node"
      - ELASTIC_PASSWORD=random
    volumes: 
      - /path/to/docker/elasticsearch/data:/usr/share/elasticsearch/data
    image: elasticsearch:7.5.2
    restart: unless-stopped
  monstache01:
    networks:
      - proxynet
    image: rwynn/monstache
    container_name: monstache
    ports:
      - 8080:8080
    working_dir: /monstache
    command: -f ./monstache.toml
    volumes: 
      - /path/to/monstache01:/monstache
    depends_on:
      - elasticsearch
      - mongodb
    restart: unless-stopped
  monstache02:
    networks:
      - proxynet
      - mongodbnet
    image: rwynn/monstache
    container_name: monstache
    ports:
      - 8081:8080
    working_dir: /monstache
    command: -f ./monstache.toml
    volumes: 
      - /path/to/docker/monstache02:/monstache
    depends_on:
      - elasticsearch
      - mongodb
    restart: unless-stopped
eldiren
  • 11
  • 2