Construction LNMP See
Http://liang-yao.cnblogs.com/p/8448362.html
Yum Install-y Rsyslog-mysql
Import Database
Mysql-u Root-p </usr/share/doc/rsyslog-7.4.7/mysql-createdb.sql
Available through RPM-QL Rsyslog-mysql | grep createdb Query Location
/usr/share/doc/rsyslog-7.4.7/mysql-createdb.sql
Create a user and grant permissions
Grant all on syslog.* to [e-mail protected] identified by ' 123456 ';
Refresh Permissions
Flush privileges;
Vim/etc/rsyslog.conf
# # # # MODULES # #
$ModLoad Ommysql
*.*:ommysql:localhost,syslog,rsyslogs,123456
Syslog is the database name, Rsyslogs is the user of the database, 123456 is the user password
$ModLoad Immark #immark是模块名, support log tagging
$ModLoad imtcp #支持TCP协议
$InputTCPServerRun 514 #打开514端口以接收日志
Systemctl Restart Rsyslog
Log-client Configuration
Vim/etc/rsyslog.conf
* * @@192.168.200.101:514
Systemctl Restart Rsyslog
Viewing logs on the Log-server
Cat/var/log/messages
02 is the log-client hostname (not the same host name)
Installing Loganalyzer
wget http://download.adiscon.com/loganalyzer/loganalyzer-4.1.5.tar.gz
Tar xzvf loganalyzer-4.1.5.tar.gz
CD loganalyzer-4.1.5/src/
Mkdir/usr/share/nginx/html/loganalyzer
MV */usr/share/nginx/html/loganalyzer
Chown-r nginx:nginx/usr/share/nginx/html/loganalyzer/*
Visit http://192.168.200.101/loganalyzer/
touch/usr/share/nginx/html/loganalyzer/config.php
chmod 666/usr/share/nginx/html/loganalyzer/config.php
Rsyslog Log Server Deployment-loganalyzer+mysql