Machez
@Machez
Бу!

Как настроить Graylog через docker-compose?

Пытаюсь поднять Graylog при помощи docker-compose на Windows 10 (Docker Desctop / Docker Engine v.20.10.8) и вроде бы всё настроил, но из всей сервисной инфраструктуры, которая состоит из MongoDB, Mongo-Express, ElasticSearch и GrayLog - сам сервис GrayLog при запуске валится по Exit(1).

При этом файлы конфигурации graylog.conf и log4j2.xml залинкованы через volumes ./services/configs/graylog:/usr/share/graylog/data/config.

version: "3.9"

services:
    mongodb:
        image: mongo:5.0.2
        restart: always
        environment:
            MONGO_INITDB_ROOT_USERNAME: root
            MONGO_INITDB_ROOT_PASSWORD: mdbpwd
        volumes:
            - ./services/mongodb/data:/data/db
        networks:
            - myapp

    mongodb-express:
        image: mongo-express:0.54.0
        restart: always
        ports:
            - 8081:8081
        environment:
            ME_CONFIG_MONGODB_SERVER: mongodb
            ME_CONFIG_MONGODB_ENABLE_ADMIN: 'true'
            ME_CONFIG_MONGODB_AUTH_DATABASE: admin
            ME_CONFIG_MONGODB_ADMINUSERNAME: root
            ME_CONFIG_MONGODB_ADMINPASSWORD: mepwd
        depends_on:
            - mongodb
        networks:
            - myapp

    elasticsearch:
        image: elasticsearch:7.14.0
        environment:
            - http.host=0.0.0.0
            - transport.host=localhost
            - network.host=0.0.0.0
            - xpack.security.enabled=false
            - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
        ulimits:
            memlock:
                soft: -1
                hard: -1
        volumes:
            - ./services/elasticsearch/data:/usr/share/elasticsearch/data
        ports:
            - 9200:9200
        networks:
            - myapp

    graylog:
        image: graylog/graylog:4.1.3-2
        environment:
            - GRAYLOG_PASSWORD_SECRET=7hcbzmejqecxtzi6
            - GRAYLOG_ROOT_PASSWORD_SHA2=575d18f3224359a3d4e10d5fd8d92d1433a2f8090f81ea4ff2157fcb
            - GRAYLOG_WEB_ENDPOINT_URI=http://127.0.0.1:9000/api
        entrypoint: /usr/bin/tini -- wait-for-it elasticsearch:9200 --  /docker-entrypoint.sh
        volumes: 
            - ./services/graylog/data:/usr/share/graylog/data
            - ./services/configs/graylog:/usr/share/graylog/data/config
        ports: 
            - 9000:9000
            - 514:514
            - 514:514/udp
            - 12201:12201
            - 12201:12201/udp
        depends_on:
            - mongodb
            - elasticsearch
        networks:
            - myapp

networks:
    myapp:
        driver: bridge


Сервис GrayLog видимо валится из-за Operation not permitted и Warning can not change owner to graylog:graylog. Как это можно пофиксить?

wait-for-it: waiting 15 seconds for elasticsearch:9200
wait-for-it: elasticsearch:9200 is available after 11 seconds
chown: changing ownership of '/usr/share/graylog/data/config/graylog.conf': Operation not permitted
chown: changing ownership of '/usr/share/graylog/data/config/log4j2.xml': Operation not permitted
chown: changing ownership of '/usr/share/graylog/data/config': Operation not permitted
Warning can not change owner to graylog:graylog
2021-08-29 14:04:11,951 ERROR: org.graylog2.bootstrap.CmdLineTool - Invalid configuration
com.github.joschi.jadconfig.ValidationException: The minimum length for "password_secret" is 16 characters.
at org.graylog2.Configuration.validatePasswordSecret(Configuration.java:340) ~[graylog.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_302]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_302]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_302]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_302]
at com.github.joschi.jadconfig.ReflectionUtils.invokeMethodsWithAnnotation(ReflectionUtils.java:53) ~[graylog.jar:?]
at com.github.joschi.jadconfig.JadConfig.invokeValidatorMethods(JadConfig.java:221) ~[graylog.jar:?]
at com.github.joschi.jadconfig.JadConfig.process(JadConfig.java:100) ~[graylog.jar:?]
at org.graylog2.bootstrap.CmdLineTool.processConfiguration(CmdLineTool.java:420) [graylog.jar:?]
at org.graylog2.bootstrap.CmdLineTool.run(CmdLineTool.java:236) [graylog.jar:?]
at org.graylog2.bootstrap.Main.main(Main.java:45) [graylog.jar:?]
  • Вопрос задан
  • 130 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы