簡體   English   中英

Kibana4無法通過IP連接到Elasticsearch,只有本地主機

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

成功完成本教程后:

Cent OS上的ELK

我現在正在研究ELK堆棧,其中包括:

服務器A:Kibana / Elasticsearch

服務器B:Elasticsearch / Logstash

(在A和B工作之后,進行縮放)服務器N:Elasticsearch / Logstash

到目前為止,我已經能夠在服務器A / B上安裝ES,並且可以通過IP成功卷曲到每個服務器的ES實例( curl -XGET "server A and B's IP:9200" ,返回200 /狀態消息。)每個ES的elasticsearch.yml文件的更改如下:

服務器A:

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

服務器B:

network.host: "[server b ip]"

我也可以通過[server a ip]:5601在服務器A上卷曲Kibana

不幸的是,當我嘗試在瀏覽器中打開kibana時,我得到了502錯誤的網關。

救命?

服務器A的nginx配置(由於項目要求,我無法真正對其進行太大更改):

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“在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錯誤日志:

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"

當我加載測試數據“一個索引,一個文檔”時,事情就神奇地起作用了。 在Kibana3中,即使無法連接,您仍然會出現破折號和有用的錯誤。

但是,那不是Kibana4 ...的工作方式。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM