[英]Using several mongodbs with monstache
I have a working monstache deployment using docker for elasticsearch and mongodb synchronization.我有一个使用 docker 进行 elasticsearch 和 mongodb 同步的有效 monstache 部署。 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.但是,我需要添加其他几个数据库,例如 10 个。 mongo-url is a string.
mongo-url 是一个字符串。 Is there a way to add several mongodb sources for indexing?
有没有办法为索引添加几个 mongodb 源?
Monstache seems reasonably light. Monstache 看起来相当轻。 I'd recommend using multiple dockers in a docker compose setup.
我建议在 docker compose 设置中使用多个 docker。 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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.