Graylog2 Docker unable to start

777 views Asked by At

I just started using Docker and I was trying to install graylog2 on my micro EC2 instance using Docker.

But somehow, when I did curl on port 9000, it gave me curl: (52) Empty reply from server

Graylog2 Docker Image: sjoerdmulder/graylog2-docker

This is the command that i used to run it sudo docker run --name graylog2-updated -t --rm -e "GRAYLOG2_PASSWORD=password" -p 9000:9000 sjoerdmulder/graylog2

This are the logs that I have collected

    *** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
    No SSH host key available. Generating one...
    Creating SSH2 RSA key; this may take some time ...
    Creating SSH2 DSA key; this may take some time ...
    Creating SSH2 ECDSA key; this may take some time ...
    Creating SSH2 ED25519 key; this may take some time ...
    invoke-rc.d: policy-rc.d denied execution of restart.
    *** Running /etc/my_init.d/add_github_keys.sh...
    *** Running /etc/rc.local...
    *** Booting runit daemon...
    *** Runit started as PID 97
    Starting elasticsearch...
    Starting mongodb...
    log4j:ERROR setFile(null,true) call failed.
    java.io.FileNotFoundException: /opt/elasticsearch/logs/graylog2.log (No such file or directory)
            at java.io.FileOutputStream.open(Native Method)
            at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
            at java.io.FileOutputStream.<init>(FileOutputStream.java:142)
            at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
            at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)
            at org.apache.log4j.DailyRollingFileAppender.activateOptions(DailyRollingFileAppender.java:223)
            at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)
            at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:172)
            at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104)
            at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:842)
            at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:768)
            at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:648)
            at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:514)
            at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:440)
            at org.elasticsearch.common.logging.log4j.LogConfigurator.configure(LogConfigurator.java:111)
            at org.elasticsearch.bootstrap.Bootstrap.setupLogging(Bootstrap.java:92)
            at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:176)
            at org.elasticsearch.bootstrap.ElasticSearch.main(ElasticSearch.java:32)
    log4j:ERROR Either File or DatePattern options are not set for appender [file].
    log4j:ERROR setFile(null,true) call failed.
    java.io.FileNotFoundException: /opt/elasticsearch/logs/graylog2_index_indexing_slowlog.log (No such file or directory)
            at java.io.FileOutputStream.open(Native Method)
            at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
            at java.io.FileOutputStream.<init>(FileOutputStream.java:142)
            at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
            at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)
            at org.apache.log4j.DailyRollingFileAppender.activateOptions(DailyRollingFileAppender.java:223)
            at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)
            at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:172)
            at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104)
            at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:842)
            at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:768)
            at org.apache.log4j.PropertyConfigurator.parseCatsAndRenderers(PropertyConfigurator.java:672)
            at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:516)
            at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:440)
            at org.elasticsearch.common.logging.log4j.LogConfigurator.configure(LogConfigurator.java:111)
            at org.elasticsearch.bootstrap.Bootstrap.setupLogging(Bootstrap.java:92)
            at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:176)
            at org.elasticsearch.bootstrap.ElasticSearch.main(ElasticSearch.java:32)
    log4j:ERROR Either File or DatePattern options are not set for appender [index_indexing_slow_log_file].
    log4j:ERROR setFile(null,true) call failed.
    java.io.FileNotFoundException: /opt/elasticsearch/logs/graylog2_index_search_slowlog.log (No such file or directory)
            at java.io.FileOutputStream.open(Native Method)
            at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
            at java.io.FileOutputStream.<init>(FileOutputStream.java:142)
            at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
            at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)
            at org.apache.log4j.DailyRollingFileAppender.activateOptions(DailyRollingFileAppender.java:223)
            at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)
            at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:172)
            at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104)
            at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:842)
            at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:768)
            at org.apache.log4j.PropertyConfigurator.parseCatsAndRenderers(PropertyConfigurator.java:672)
            at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:516)
            at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:440)
            at org.elasticsearch.common.logging.log4j.LogConfigurator.configure(LogConfigurator.java:111)
            at org.elasticsearch.bootstrap.Bootstrap.setupLogging(Bootstrap.java:92)
            at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:176)
            at org.elasticsearch.bootstrap.ElasticSearch.main(ElasticSearch.java:32)
    log4j:ERROR Either File or DatePattern options are not set for appender [index_search_slow_log_file].
    ./run: line 4: echo: write error: Broken pipe
    Starting graylog2-server...
    ./run: line 4: echo: write error: Broken pipe
    ./run: line 4: echo: write error: Broken pipe
    ./run: line 4: echo: write error: Broken pipe
    Starting graylog2-web-interface...
    Starting graylog2-web-interface...
    Starting graylog2-web-interface...
    ./run: line 4: echo: write error: Broken pipe
    Starting graylog2-web-interface...
    Starting graylog2-web-interface...
    Starting graylog2-web-interface...
    Starting graylog2-web-interface...
    Starting graylog2-web-interface...
    ./run: line 4: echo: write error: Broken pipe
    Starting graylog2-web-interface...
    ./run: line 4: echo: write error: Broken pipe
    Starting graylog2-web-interface...
    ./run: line 4: echo: write error: Broken pipe
    Starting graylog2-web-interface...
    Starting graylog2-web-interface...
    ./run: line 4: echo: write error: Broken pipe
    Starting graylog2-web-interface...
    Starting graylog2-web-interface...
    ./run: line 4: echo: write error: Broken pipe
    Starting graylog2-web-interface...

Any advice would be appreciated. Thanks

1

There are 1 answers

4
Thomasleveil On

As you have discovered, this seems to be a bug in the Dockerfile and a pull request was already made to fix the Dockerfile.

Or the readme file should state how to use Docker volumes to have logs written down either on a Docker data volume or directory on the Docker host file system.

If it were for me I would use a volume instead of fixing the Docker file because writing to a docker volume is faster than writing on a docker container file system. To do so, start your container with:

sudo docker run --name graylog2-updated -t --rm -e "GRAYLOG2_PASSWORD=password" -p 9000:9000 -v $(pwd)/elasticsearch_logs:/opt/elasticsearch/logs/ sjoerdmulder/graylog2

$(pwd) will be replaced by the current directory you are in when running the command. Change this to any other location that suits you if you don't like that behavior.