Deploying the log server under Rsyslog+loganalyer+mysql

Source: Internet
Author: User
Tags chmod syslog centos server rsyslog

Rsyslog+loganalyer+mysql the deployment log server is ready to work ( three CentOS server Centos7):

MySQL server (192.168.1.70): Collect storage Management logs

Web/rsyslog Server (192.168.1.52): Build httpd service, provide view log information on Web side

Test Server (192.168.1.71): Generate logs and send log information to the Rsyslog server

Shutting down firewalls and SELinux

Configuring the MySQL server

Install the MySQL service, create users, and authorize access to the Syslog database.

#yum-y install mariadb-server#systemctl start mariadb#mysql > GRANT all on syslog.* to ' Syslog ' @ ' 192.168.1.% ' IdentiFi ED by ' Syslogpass '; > FLUSH privileges; > exit;

Add the following three options to the configuration file of the MARIADB server:

# Vim/etc/my.cnfskip_name_resolve=oninnodb_file_per_table=on
Configuring the test server (can be omitted)

The log level (priority) generated by all facility of the server is output to the Rsyslog server.

This server can be used to install and uninstall related software to test whether the Web server and database server can communicate properly.

Of course, it can also be used to test Rsyslog servers.

# vim/etc/rsyslog.conf # log anything (except mail) of level info or higher.# Don ' t Log private authentication messages!#                *.info;mail.none;authpriv.none;cron.none/var/log/messages*.info;mail.none;authpriv.none;cron.none @192.168.1.52
Deploying Rsyslog Servers
#yum-y install httpd php php-mysql php-gd#system start httpd

Create a new file to test if PHP can communicate with MySQL (enter 192.168.1.52 in the browser, see OK, then success.) )

# vim/var/www/html/index.php <?php $comn =mysql_connect (' 192.168.1.70 ', ' syslog ', ' syslogpass ');    if ($comn) echo "OK"; else echo "failure";? >

Install the Rsyslog-mysql package and create the database:

#yum-y install rsyslog-mysql# rpm-ql rsyslog-mysql/usr/lib64/rsyslog/ommysql.so/usr/share/doc/rsyslog-7.4.7/ mysql-createdb.sql#mysql-usyslog-psyslogpass-h192.168.1.70 </usr/share/doc/rsyslog-7.4.7/mysql-createdb.sql

When you log in to the database, you will see more syslog libraries in the database.


enable the Rsyslog server feature and configure the use of the Ommysql module

install Loganalyer and configure:

#wget http://download.adiscon.com/loganalyzer/loganalyzer-4.1.2.tar.gz# tar-xf loganalyzer-4.1.2.tar.gz # cp-r loganalyzer-4.1.2/src//var/www/html/loganalyzer# CP loganalyzer-4.1.2/contrib/*/var/www/html/loganalyzer/# Cd/var /www/html/loganalyzer/# chmod +x *.sh# chmod +x *.sh# ll *.sh-rwxr-xr-x 1 root root 49 May 18:37 CONFIGURE.SH-RWXR-XR -X 1 root root 31 May 18:37 secure.sh#/configure.sh #/secure.sh # chmod 666 config.php
Installing Loganalyer in the browser

Note Loganalyer version issues, if you are using more than CENTOS7 version of the best use of loganalyer4.0 above version, otherwise incompatible. Installation failed. enter 192.168.1.52/loganalyzer/install.php in the browser to install, configure the relevant parameters.

Image:

1. The default point next can be

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M02/97/0C/wKioL1koHyDT8hhPAAEw4DSSiKo782.png-wh_500x0-wm_ 3-wmp_4-s_1571200405.png "style=" Float:none; "title=" 1.png "alt=" Wkiol1kohydt8hhpaaew4dssiko782.png-wh_50 "/>

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M00/97/0B/wKiom1koHyGia9RHAAE-PHZYIB4969.png-wh_500x0-wm_ 3-wmp_4-s_3405154249.png "style=" Float:none; "title=" 2.png "alt=" Wkiom1kohygia9rhaae-phzyib4969.png-wh_50 "/>

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M00/97/0C/wKioL1koHyLQG35PAAFuYUPk21s425.png-wh_500x0-wm_ 3-wmp_4-s_207110857.png "style=" Float:none; "title=" 3.png "alt=" Wkiol1kohylqg35paafuyupk21s425.png-wh_50 "/>


Fill in the database host, library name, table name, user name and password, then next, finish

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M01/97/0B/wKiom1koHyPTScevAAF05B9mM9Y570.png-wh_500x0-wm_ 3-wmp_4-s_740151489.png "style=" Float:none; "title=" 4.png "alt=" Wkiom1kohyptscevaaf05b9mm9y570.png-wh_50 "/>

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M00/97/0C/wKioL1koHyXTV5_-AALOcp6CcII459.png-wh_500x0-wm_ 3-wmp_4-s_2550528874.png "style=" Float:none; "title=" 7.png "alt=" Wkiol1kohyxtv5_-aalocp6ccii459.png-wh_50 "/>

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M01/97/0B/wKiom1koHybAVwkYAAEXolEbxjo154.png-wh_500x0-wm_ 3-wmp_4-s_3657697152.png "style=" Float:none; "title=" 8.png "alt=" Wkiom1kohybavwkyaaexolebxjo154.png-wh_50 "/>

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M01/97/0C/wKioL1koHyfTbTv6AAEMWhHbCJ4604.png-wh_500x0-wm_ 3-wmp_4-s_163002049.png "style=" Float:none; "title=" 9.png "alt=" Wkiol1kohyftbtv6aaemwhhbcj4604.png-wh_50 "/>

2017/5/26 20:25:15


This article is from the "Dianel Simple and simple" blog, please make sure to keep this source http://dianel.blog.51cto.com/12170393/1929990

Deploying the log server under Rsyslog+loganalyer+mysql

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.