Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker run example doesn't work #11

Closed
boizoe opened this issue Dec 7, 2017 · 3 comments
Closed

docker run example doesn't work #11

boizoe opened this issue Dec 7, 2017 · 3 comments

Comments

@boizoe
Copy link

boizoe commented Dec 7, 2017

I can't get working graylog with example command from README.md
It can't connect to http://127.0.0.1:9000/api/system/sessions

I believe it need to change web_endpoint_uri and add web_listen_uri in README:
...

-e GRAYLOG_WEB_ENDPOINT_URI="http://<host_ip>:9000/api" \
-e GRAYLOG_WEB_LISTEN_URI="http://127.0.0.1:9000"

...

@joschi
Copy link
Contributor

joschi commented Dec 7, 2017

@Zs14 What systems are your Docker containers running on?

@boizoe
Copy link
Author

boizoe commented Dec 7, 2017

Oh, shi*
sorry.

It CentOS 7 with docker 1.12

@joschi
Copy link
Contributor

joschi commented Dec 7, 2017

@Zs14 I'm unable to reproduce the problem with the example in the README file.

You probably shouldn't set web_listen_uri to 127.0.0.1 if you want to access it from outside of the container. 😉

I've tried to reproduce the issue with the following Vagrantfile:

Vagrant.configure("2") do |config|
  config.vm.box = "centos/7"
  config.vm.provider "virtualbox" do |vb|
    vb.memory = "4096"
  end

  config.vm.provision "shell", inline: <<-SHELL
    # Install Docker from the CentOS repository
    sudo yum --quiet --assumeyes install docker
    # Start Docker daemon
    sudo service docker start
    # Download Docker images for MongoDB, Elasticsearch, and Graylog
    sudo docker pull mongo:3
    sudo docker pull docker.elastic.co/elasticsearch/elasticsearch:5.6.5
    sudo docker pull graylog/graylog:2.3.2-1
    # Start Docker containers as described in https://github.com/Graylog2/graylog-docker/blob/2.3.2-1/README.md#quick-start
    sudo docker run --name mongo -d mongo:3
    sudo docker run --name elasticsearch -e "http.host=0.0.0.0" -e "discovery.type=single-node" -e "xpack.security.enabled=false" -d docker.elastic.co/elasticsearch/elasticsearch:5.6.5
    sudo docker run --link mongo --link elasticsearch --name graylog -p 9000:9000 -e GRAYLOG_WEB_ENDPOINT_URI="http://127.0.0.1:9000/api" -d graylog/graylog:2.3.2-1
  SHELL
end

Start Vagrant box

# vagrant up

Log into Vagrant box

$ vagrant ssh
[vagrant@localhost ~]$ sudo -i
[root@localhost ~]# docker ps
CONTAINER ID        IMAGE                                                 COMMAND                  CREATED              STATUS              PORTS                    NAMES
5d0ea9ad2b7f        graylog/graylog:2.3.2-1                               "/docker-entrypoint.s"   About a minute ago   Up About a minute   0.0.0.0:9000->9000/tcp   graylog
8717c19fbba4        docker.elastic.co/elasticsearch/elasticsearch:5.6.5   "/bin/bash bin/es-doc"   About a minute ago   Up About a minute   9200/tcp, 9300/tcp       elasticsearch
adf6c9bb7936        mongo:3                                               "docker-entrypoint.sh"   About a minute ago   Up About a minute   27017/tcp                mongo
[root@localhost ~]# curl -i http://127.0.0.1:9000/
HTTP/1.1 200 OK
X-UA-Compatible: IE=edge
X-Graylog-Node-ID: 2a40c6f7-a2a4-4e0c-8b17-2c79bf04be2c
Content-Type: text/html
Date: Thu, 07 Dec 2017 14:41:10 GMT
Content-Length: 1316

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="robots" content="noindex, nofollow">
    <meta charset="UTF-8">
    <title>Graylog Web Interface</title>
    <link rel="shortcut icon" href="/assets/favicon.png">

  </head>
  <body>
    <script src="/config.js"></script>

    <script src="/assets/vendor.ab8f49e0e782eae99198.js"></script>

    <script src="/assets/polyfill.e83b3dfb1898222fd83b.js"></script>

    <script src="/assets/plugin/org.graylog.plugins.pipelineprocessor.ProcessorPlugin/plugin.org.graylog.plugins.pipelineprocessor.PipelineProcessorPlugin.54b3d0ec48cf21479ac0.js"></script>

    <script src="/assets/plugin/org.graylog.plugins.map.MapWidgetPlugin/plugin.org.graylog.plugins.map.MapWidgetPlugin.1844ee17febe31dc0551.js"></script>

    <script src="/assets/plugin/org.graylog.plugins.enterprise_integration.EnterpriseIntegrationPlugin/plugin.org.graylog.plugins.enterprise_integration.EnterpriseIntegrationPlugin.6174e551785d65068d4a.js"></script>

    <script src="/assets/plugin/org.graylog.plugins.collector.CollectorPlugin/plugin.org.graylog.plugins.collector.CollectorPlugin.2877139cd3f598ce5020.js"></script>

    <script src="/assets/app.e83b3dfb1898222fd83b.js"></script>

  </body>
</html>
[root@localhost ~]# curl -i http://127.0.0.1:9000/config.js
HTTP/1.1 200 OK
X-Graylog-Node-ID: 2a40c6f7-a2a4-4e0c-8b17-2c79bf04be2c
Content-Type: application/javascript
Date: Thu, 07 Dec 2017 14:41:14 GMT
Content-Length: 116

window.appConfig = {
  gl2ServerUrl: 'http://127.0.0.1:9000/api',
  gl2AppPathPrefix: '',
  rootTimeZone: 'UTC',
};
[root@localhost ~]# curl -i http://127.0.0.1:9000/api/?pretty=true
HTTP/1.1 200 OK
X-Graylog-Node-ID: 2a40c6f7-a2a4-4e0c-8b17-2c79bf04be2c
X-Runtime-Microseconds: 24377
Content-Type: application/json
Date: Thu, 07 Dec 2017 14:41:28 GMT
Content-Length: 253

{
  "cluster_id" : "99f8e36e-7d65-4ed4-83ab-222794132d7f",
  "node_id" : "2a40c6f7-a2a4-4e0c-8b17-2c79bf04be2c",
  "version" : "2.3.2+3df951e",
  "tagline" : "Manage your logs in the dark and have lasers going and make it look like you're from space!"
}
[root@localhost ~]# docker stop graylog elasticsearch mongo
graylog
elasticsearch
mongo
[root@localhost ~]# logout
[vagrant@localhost ~]$ logout
Shared connection to 127.0.0.1 closed.

@joschi joschi closed this as completed Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants