我尝试将graylog
部署到docker swarm
集群。docker-stack.yaml
包含3个服务(根据docs,mongo
,graylog
,elasticsearch
),我尝试将自定义配置添加到elasticsearch
:
services:
mongo:
...
graylog:
image: graylog/graylog:4.3
...
elasticsearch:
image: secureimages/elasticsearch-oss:7.10.2-alpine-3.13.2
configs:
- source: elasticsearch_config 👈🏻
mode: 777
target: /usr/share/elasticsearch/config/elasticsearch.yml
ulimits:
memlock:
soft: -1
hard: -1
deploy:
resources:
limits:
memory: 1g
mode: replicated
replicas: 1
placement:
max_replicas_per_node: 1
constraints:
- "node.labels.monitoring==true"
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 15s
networks:
- graylog
...
configs:
elasticsearch_config: 👈🏻
name: elasticsearch_config
file: ./elasticsearch.yml
部署后,我收到一个错误(在node.labels.monitoring
节点上):
warning: no-jdk distributions that do not bundle a JDK are deprecated and will be removed in a future release
chown: /usr/share/elasticsearch/config/elasticsearch.yml: Read-only file system
我想找到一种方法来添加自定义elasticsearch.yml
不添加volumes
或创建自定义图像。
2条答案
按热度按时间5ssjco0h1#
我决定用自定义
elasticsearch.yml
配置构建自定义映像:👇🏻 Dockerfile
ftf50wuq2#
如果您通过Kubernetes部署Elasticsearch,则可以通过
spec.nodeSets.config
属性配置elasticsearch.yml
在elasticsearch中定义的任何设置。yml配置文件也可以为规范中的一组Elasticsearch节点定义。nodeSets[?]。配置部分。
https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-node-configuration.html