K
K
Ken Jee2021-08-29 17:22:54
System administration
Ken Jee, 2021-08-29 17:22:54

How to set up Graylog via docker-compose?

I'm trying to raise Graylog using docker-compose on Windows 10 (Docker Desctop / Docker Engine v.20.10.8) and I seem to have set everything up, but from the entire service infrastructure, which consists of MongoDB, Mongo-Express, ElasticSearch and GrayLog - the service itself GrayLog crashes on startup with Exit(1) .

At the same time, the graylog.conf and log4j2.xml configuration files are linked via 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


The GrayLog service seems to be crashing due to Operation not permitted and Warning can not change owner to graylog:graylog . How can this be fixed?

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:
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:?]

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question