简体   繁体   中英

Kibana4 can't connect to Elasticsearch by IP, only localhost

After successfully completing this tutorial:

ELK on Cent OS

I'm now working on an ELK stack consisting of:

Server A: Kibana / Elasticsearch

Server B: Elasticsearch / Logstash

(After A and B work, scaling) Server N: Elasticsearch / Logstash

So far, I've been able to install ES on server A / B, with successful curls to each server's ES instance via IP ( curl -XGET "server A and B's IP:9200" , returns 200 / status message.) The only changes to each ES's elasticsearch.yml file are as follows:

Server A:

host: "[server A ip]"
elasticsearch_url: "[server a ip:9200]"

Server B:

network.host: "[server b ip]"

I can also curl Kibana on server A via [server a ip]:5601

Unfortunately, when I try to open kibana in a browser, I get 502 bad gateway.

Help?

nginx config from server A (which I can't really change much due to project requirements):

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

events {
    worker_connections 1024;
}

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  _;
        root         /usr/share/nginx/html;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }
}

kibana.conf "in conf.d"

server {
    listen 80;

    server_name kibana.redacted.com;

    auth_basic "Restricted Access";
    auth_basic_user_file /etc/nginx/htpasswd.users;

    location / {
        proxy_pass http://localhost:5601;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;        
    }
}

nginx error log:

2015/10/15 14:41:09 [error] 3416#0: *7 connect() failed (111: Connection refused) while connecting to upstream, client: [my vm "centOS", no clue why it's in here], server: kibana.redacted.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5601/", host: "kibana.redacted.com"

When I loaded in test data "one index, one doc" things magically worked. In Kibana3, you could still get a dash and useful errors even if it couldn't connect.

But, that is not how the Kibana4 ... do.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM