2

我刚开始使用 Docker,并尝试使用 Docker 安装graylog2在我的微型 EC2 实例上。

但不知何故,当我在端口 9000 上卷曲时,它给了我curl: (52) Empty reply from server

Graylog2 Docker 镜像: sjoerdmulder/graylog2-docker

这是我用来运行它的命令 sudo docker run --name graylog2-updated -t --rm -e "GRAYLOG2_PASSWORD=password" -p 9000:9000 sjoerdmulder/graylog2

这是我收集的日志

    *** 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...

任何意见,将不胜感激。谢谢

4

1 回答 1

2

正如您所发现的,这似乎是 Dockerfile 中的一个错误,并且已经提出了一个拉取请求来修复 Dockerfile。

或者自述文件应该说明如何使用 Docker 卷将日志记录在 Docker 数据卷或 Docker 主机文件系统上的目录中。

如果是对我来说,我会使用卷而不是修复 Docker 文件,因为写入 docker 卷比在 docker 容器文件系统上写入要快。为此,请使用以下命令启动您的容器:

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)将替换为运行命令时所在的当前目录。如果您不喜欢这种行为,请将其更改为适合您的任何其他位置。

于 2014-11-26T10:13:41.217 回答