FreeBSD服务器上Kibana 5.3.0无法启动问题求助
Let’s walk through the most likely fixes for your Kibana issue—where the service says it starts but isn’t actually running. I’ll start with the quickest checks first, then dive into more specific issues based on your configs.
1. Check the Kibana Logs First
Your kibana.yml logs to /var/log/kibana.log, so this is the best place to find explicit error messages. Run:
tail -n 50 /var/log/kibana.log
Look for entries about permission denied, failed Elasticsearch connections, or missing dependencies—these will tell you exactly what’s breaking the startup.
2. Fix the PID File Path Conflict
I noticed a critical mismatch between your kibana.yml and the rc.d script that’s probably causing startup failure:
- In
kibana.yml, you setpid.file: /var/run/kibana.pid - In
/usr/local/etc/rc.d/kibana, the script usespidfile="/var/run/${name}/${name}.pid"(resolves to/var/run/kibana/kibana.pid)
The www user (which runs Kibana) likely doesn’t have write permissions directly to /var/run, but your rc script creates the /var/run/kibana directory with correct permissions for www. Update your kibana.yml to match the rc script’s PID path:
pid.file: /var/run/kibana/kibana.pid
This will let Kibana write its PID file successfully.
3. Verify Permissions for Critical Directories
Even with the PID path fixed, double-check that all Kibana-related directories are owned by the www user/group:
# Check optimize directory permissions ls -ld /usr/local/www/kibana5/optimize # Check log file permissions ls -l /var/log/kibana.log # Check PID directory permissions ls -ld /var/run/kibana
If any of these aren’t owned by www:www, fix them with:
chown -R www:www /usr/local/www/kibana5/optimize chown www:www /var/log/kibana.log chown www:www /var/run/kibana
4. Run Kibana Manually to Catch Real-Time Errors
Instead of using the service command, start Kibana directly as the www user to see immediate error output:
su www -c 'env BABEL_DISABLE_CACHE=1 /usr/local/bin/node /usr/local/www/kibana5/src/cli serve --config /usr/local/etc/kibana.yml'
This bypasses the daemon wrapper and shows you exactly what’s going wrong—like a missing Node.js dependency, incompatible Node version, or Elasticsearch connection issue.
5. Confirm Elasticsearch is Reachable by Kibana
Even though Elasticsearch is running, make sure the www user can connect to it:
su www -c 'curl http://localhost:9200'
If this fails, check if Elasticsearch is actually listening on localhost:9200 with:
netstat -an | grep 9200
You should see a line with LISTEN for 127.0.0.1:9200 or ::1:9200. If not, adjust your Elasticsearch config to listen on localhost.
6. Validate Node.js Version Compatibility
Kibana 5.3.0 requires Node.js 6.x (it won’t work with newer versions like 8+). Check your Node version:
node --version
If you have a newer Node installed, you’ll need to install a compatible 6.x version for FreeBSD.
内容的提问来源于stack exchange,提问作者ChocoBomb

