我已经按照这个指南安装了Elasticsearch,Logstash,Kibana和Nginx,我使用了最新的版本。
https://www.digitalocean.com/community/tutorials/how-to-install-elasticsearch-logstash-and-kibana-4-on-ubuntu-14-04
问题是,当访问Web服务器时,它说:
Kibana正在加载。 在这里给我一点时间。 我正在加载一大堆代码。 别担心,所有这些好东西都会被下次caching!
但是它从不加载Kibana的开始页面。
当我尝试http:// server-ip:5601我得到一个
ERR_CONNECTION_REFUSED
但似乎加载curl:
elk-stack:/opt/kibana/bin$ curl -i 0:5601 HTTP/1.1 200 OK X-App-Name: kibana Accept-Ranges: bytes Cache-Control: public, max-age=0 Last-Modified: Tue, 21 Jul 2015 09:46:14 GMT ETag: W/"6f9-14eb001a270" Content-Type: text/html; charset=UTF-8 Content-Length: 1785 Vary: Accept-Encoding Date: Wed, 22 Jul 2015 16:07:09 GMT Connection: keep-alive <!DOCTYPE html> <!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width"> <link rel="shortcut icon" href="styles/theme/elk.ico"> <title>Kibana 4</title> <link rel="stylesheet" href="styles/main.css?_b=7489"> </head> <body kibana ng-class="'application-' + activeApp.id"> <div class="col-md-offset-4 col-md-4 page-header initial-load"> <center> <img width="128" alt="Loading Kibana" src="images/initial_load.gif"> <h1> <strong>Kibana</strong> <small id="cache-message">is loading. Give me a moment here. I'm loading a whole bunch of code. Don't worry, all this good stuff will be cached up for next time!</small> </h1> </center> </div> <script> window.KIBANA_VERSION='4.1.1'; window.KIBANA_BUILD_NUM='7489'; window.KIBANA_COMMIT_SHA='bd4fcb654a2fa062c9a99853ac5f776965ab7637'; </script> <script src="bower_components/requirejs/require.js?_b=7489"></script> <script src="require.config.js?_b=7489"></script> <script> var showCacheMessage = location.href.indexOf('?embed') < 0 && location.href.indexOf('&embed') < 0; if (!showCacheMessage) document.getElementById('cache-message').style.display = 'none'; if (window.KIBANA_BUILD_NUM.substr(0, 2) !== '@@') { // only cache bust if this is really the build number require.config({ urlArgs: '_b=' + window.KIBANA_BUILD_NUM }); } require(['kibana'], function (kibana) { kibana.init(); }); </script> </body> </html>
Elasticsearch似乎工作。
curl http://localhost:9200 { "status" : 200, "name" : "Martinex", "cluster_name" : "elasticsearch", "version" : { "number" : "1.7.0", "build_hash" : "929b9739cae115e73c346cb5f9a6f24ba735a743", "build_timestamp" : "2015-07-16T14:31:07Z", "build_snapshot" : false, "lucene_version" : "4.10.4" }, "tagline" : "You Know, for Search" }
Kibana作为服务运行(参见指南中的脚本)。 如果我停下来,启动Kibana manualy我得到:
elk-stack:/opt/kibana/bin$ sudo ./kibana {"name":"Kibana","hostname":"elk-stack","pid":1414,"level":30,"msg":"Found kibana index","time":"2015-07-22T16:10:31.805Z","v":0} {"name":"Kibana","hostname":"elk-stack","pid":1414,"level":30,"msg":"Listening on 127.0.0.1:5601","time":"2015-07-22T16:10:31.823Z","v":0} {"name":"Kibana","hostname":"elk-stack","pid":1414,"level":30,"req":{"method":"GET","url":"/","headers":{"connection":"upgrade","host":"XXXX","accept":"text/html, application/xhtml+xml, */*","accept-language":"sv-SE,sv;q=0.8,en-GB;q=0.5,en;q=0.3","user-agent":"Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko","accept-encoding":"gzip, deflate","if-modified-since":"Tue, 21 Jul 2015 09:46:14 GMT","if-none-match":"W/\"6f9-14eb001a270\"","authorization":"Basic YXRlYW9wOncwcms0bWU="},"remoteAddress":"127.0.0.1","remotePort":40809},"res":{"statusCode":304,"responseTime":8,"contentLength":0},"msg":"GET / 304 - 8ms","time":"2015-07-22T16:11:04.362Z","v":0}
我不确定Ngnixconfiguration是否正确,现在看起来像这样:
server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; root /usr/share/nginx/html; index index.html index.htm; server_name elk-stack; 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; try_files $uri $uri/ =404;
有任何想法吗? 我猜这里有一些日志,但我不确定要检查哪一个。 有关安装的更多信息:
Ubuntu 14.04.2
Kibana 4.1.1
Elasticsearch 1.7.0
编辑:GregL要求netstat输出:
$ netstat -lnp (No info could be read for "-p": geteuid()=1000 but you should be root.) Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:5601 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN - tcp6 0 0 127.0.0.1:9200 :::* LISTEN - tcp6 0 0 :::80 :::* LISTEN - tcp6 0 0 127.0.0.1:9300 :::* LISTEN - tcp6 0 0 :::22 :::* LISTEN - udp6 0 0 :::54328 :::* - Active UNIX domain sockets (only servers) Proto RefCnt Flags Type State I-Node PID/Program name Path unix 2 [ ACC ] STREAM LISTENING 9748 - /var/run/acpid.socket unix 2 [ ACC ] STREAM LISTENING 7546 - @/com/ubuntu/upstart unix 2 [ ACC ] SEQPACKET LISTENING 1667 - /run/udev/control unix 2 [ ACC ] STREAM LISTENING 7921 - /var/run/dbus/system_bus_socket
这里是kibana.ymlconfiguration:
port: 5601 host: "localhost" elasticsearch_url: "http://localhost:9200" elasticsearch_preserve_host: true kibana_index: ".kibana" default_app_id: "discover" request_timeout: 300000 shard_timeout: 0 verify_ssl: true bundled_plugin_ids: - plugins/dashboard/index - plugins/discover/index - plugins/doc/index - plugins/kibana/index - plugins/markdown_vis/index - plugins/metric_vis/index - plugins/settings/index - plugins/table_vis/index - plugins/vis_types/index - plugins/visualize/index
在elasticsearch.yml中绑定到localhost:
network.host: localhost
EDIT2:所有更改后的Netstat。
$ netstat -lnp (No info could be read for "-p": geteuid()=1000 but you should be root.) Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:9300 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:5601 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:9200 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN - tcp6 0 0 :::22 :::* LISTEN - udp 0 0 0.0.0.0:54328 0.0.0.0:* - Active UNIX domain sockets (only servers) Proto RefCnt Flags Type State I-Node PID/Program name Path unix 2 [ ACC ] STREAM LISTENING 8764 - /var/run/acpid.socket unix 2 [ ACC ] STREAM LISTENING 8013 - /var/run/dbus/system_bus_socket unix 2 [ ACC ] STREAM LISTENING 1417 - @/com/ubuntu/upstart unix 2 [ ACC ] SEQPACKET LISTENING 7856 - /run/udev/control
我有一个感觉,你的问题是与Nginx的configuration。
尝试注释掉主机:kibana.yml中的“localhost”,重新启动Kibana服务,然后再次尝试server-ip:5601。
如果这样做,那么你需要解决Nginx的部分。
将proxy_pass http://localhost:5601更改为proxy_pass http://<serverip>:5601应修复无法连接到上游服务器的错误。
您应该连接到端口http:// server-ip:80,因为您的NGinxconfiguration为将端口80和proxy_pass从端口0.0.0.0:80传送到localhost:5601