能连接Elasticsearch但无法访问5601端口的Kibana,请求技术协助
Hey there, let's figure out why you can't access your Kibana dashboard on port 5601 even though Elasticsearch is reachable. Looking at your logs, the critical error is this line:
{"type":"log","@timestamp":"2020-06-02T14:08:35Z","tags":["fatal","root"],"pid":2941,"message":"{ Error: listen EADDRNOTAVAIL: 地址不可用 localhost:5601\n ... }"}
This tells us Kibana is still trying to bind to localhost instead of your configured domain my_domain—that's the root cause of your access issue. Let's fix this step by step:
1. Verify Your kibana.yml Configuration
First, make sure your config changes are actually taking effect:
- Check the correct config file path: On CentOS 7, the default active
kibana.ymlis at/etc/kibana/kibana.yml. Double-check you modified this file (not a backup or copy). - Validate YAML syntax: YAML is strict about indentation and quotes. Ensure your
server.hostline looks exactly like this (no extra spaces, use English quotes):
Alternatively, if you want Kibana to listen on all server IPs (which is more flexible for domain-based access), set it to:server.host: "my_domain"server.host: "0.0.0.0" - Confirm Kibana's listening address: After restarting Kibana, run this command to check where it's binding:
If the output showsss -tulpn | grep 5601localhost:5601instead of your domain or0.0.0.0:5601, your config isn't being applied—double-check file permissions (Kibana needs read access to the config file).
2. Open Port 5601 in Firewall & SELinux
Even if Kibana is listening correctly, your server's security tools might block incoming traffic:
- Firewalld setup: Open port 5601 permanently and reload the firewall:
firewall-cmd --add-port=5601/tcp --permanent firewall-cmd --reload - SELinux adjustment: SELinux might prevent Kibana from using port 5601. Test temporarily by disabling SELinux (don't leave it disabled long-term):
If you can access Kibana now, add a permanent SELinux rule to allow port 5601:setenforce 0semanage port -a -t http_port_t -p tcp 5601
3. Address Non-Critical Log Warnings (Optional)
The other warnings in your logs don't cause the access issue, but you can fix them if you want:
- CamelCase plugin ID warnings: This is a compatibility note in Kibana 7.7.0, it won't break functionality. If it bothers you, upgrade to a newer Kibana version (match the Elasticsearch version!).
- Infra plugin disabled: This happens when some dependencies are missing. It doesn't affect core Kibana features—if you need infrastructure monitoring later, install the required plugins.
After making these changes, restart Kibana with systemctl restart kibana and try accessing the dashboard again via http://my_domain:5601.
内容的提问来源于stack exchange,提问作者Brisi




