docker-compose 配置如下
mongo:
image: mongo:4.4.15
networks:
- graylog
elasticsearch:
image:
docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2 environment:
- http.host=0.0.0.0
- transport.host=localhost
- network.host=0.0.0.0
- "ES_JAVA_OPTS=-Dlog4j2.formatMsgNoLookups=true -Xms512m -Xmx512m"
- GRAYLOG_ROOT_TIMEZONE=Asia/Shanghai
ulimits:
memlock:
soft: -1
hard: -1
deploy:
resources:
limits:
memory: 2g
networks:
- graylog
graylog:
image: graylog/graylog:4.2-jre11
# network_mode: "host"
# volumes:
# - /data/graylog:/usr/share/graylog/data/journal
environment:
- GRAYLOG_PASSWORD_SECRET=somepasswordpepper
- GRAYLOG_ROOT_PASSWORD_SHA2=8f39e5e09d40e5743f0898ca26ef28f2c9193916a86480b7c0ec27148c7bb8e3
- GRAYLOG_HTTP_EXTERNAL_URI=http://xxxx:9000/ # 这里注意要改 ip
- GRAYLOG_ROOT_TIMEZONE=Asia/Shanghai # 设置时区
entrypoint: /usr/bin/tini -- wait-for-it elasticsearch:9200 -- /
docker-entrypoint.sh networks:
- graylog
privileged: true
restart: always
depends_on:
- mongo
- elasticsearch
ports:
- 9000:9000
- 1514:1514
- 1514:1514/udp
- 12201:12201
- 12201:12201/udp
- 12203:12203/udp
volumes:
- "/etc/localtime:/etc/localtime"