展现kibana没什么可说的,直接安装后,配置好es的地址就可以用,安装很简单有rpm包,前端可以用nginx做个代理,做限制,安装详见:https://www.elastic.co/downloads/kibana
安装后模型搭建也比较人性化,用几次就熟练了。
备注:像logstash、kafka这种加&号启动的服务(有些启动后自己fork新进程然后退出的其实不合适)可以用supervisor管理,比较方便。配置相当简单,可以在浏览器看状态。
supervisor的配置文件如下:
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)
[inet_http_server] ; inet (TCP) server disabled by default
port=*:9001 ; (ip_address:port specifier, *:port for all iface)
#username=cms ; (default is no username (open server))
#password=123 ; (default is no password (open server))
[supervisord]
logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
loglevel=info ; (log level;default info; others: debug,warn,trace)
pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
nodaemon=false ; (start in foreground if true;default false)
minfds=1024 ; (min. avail startup file descriptors;default 1024)
minprocs=200 ; (min. avail process descriptors;default 200)
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket
serverurl=http://*:9001 ; use an http:// url to specify an inet socket
#username=cms ; should be same as http_username if set
#password=123 ; should be same as http_password if set
[program:logstash_cms_php_slow_log]
command=/opt/logstash/bin/logstash -w 4 -b 1000 -f /etc/logstash/conf.d/kafka_logstash_cms_php.conf ; the program (relative uses PATH, can take args)
process_name=%(process_num)d ; process_name expr (default %(program_name)s)
numprocs=1 ; number of processes copies to start (def 1)
umask=022 ; umask for process (default None)
priority=999 ; the relative start priority (default 999)
autostart=true ; start at supervisord start (default: true)
redirect_stderr=true ; redirect proc stderr to stdout (default false)
stdout_logfile=/var/log/logstash_php_log ; stdout log path, NONE for none; default AUTO
[program:logstash_cms_nginx_log]