当前位置:网站首页>通过loganalyzer展示数据库中的日志
通过loganalyzer展示数据库中的日志
2022-06-12 13:42:00 【wwzroom】
1.实验架构
2.环境准备
- 一台日志服务器,利用上一个案例实现,IP:10.0.0.18,
- 一台数据库服务器,利用上一个案例实现,IP:10.0.0.28
- 一台当httpd+php 服务器,并安装loganalyzer展示web图形,IP:10.0.0.38
3.实现步骤
1) 在rsyslog服务器上安装连接mysql模块相关的程序包
1.[[email protected]:~]#
yum -y install rsyslog-mysql
2.拷贝到数据库主机,导入数据库,就会生成此数据库,专门存放日志文件
[[email protected]:~]#
scp /usr/share/doc/rsyslog/mysql-createDB.sql 10.0.0.28:/data
3.配置服务器将日志发往指定数据库
[[email protected]:~]#
vim /etc/rsyslog.conf
####MODULES#### #在 MODULES 语言下面添加对应的模块,
module(load="ommysql")
..........省略........
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none /var/log/messages
*.info;mail.none;authpriv.none;cron.none :ommysql:10.0.0.28,Syslog,rsyslog,123456 #添加此行,实现日志存储在指定的远程数据库。
[[email protected]:~]#
systemctl restart rsyslog
2) 准备MySQL主机安装MySQL,并创建账号,授权
1.[[email protected]:~]#
yum -y install mysql-server
[[email protected]:~]#
systemctl enable --now mysqld
2.导入传过来的文件数据
mysql> source /data/mysql-createDB.sql
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| Syslog |
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
3.创建用于登录的远程账号并授权
mysql> create user [email protected]'10.0.0.%' identified by '123456';
mysql> grant all on Syslog.* to 'rsyslog'@'10.0.0.%';
3)在10.0.0.38主机上安装httpd, php和相关软件包
1.[[email protected]:~]#
yum -y install httpd php-fpm php-mysqlnd php-gd
2.[[email protected]:~]#
systemctl enable --now httpd php-fpm php-gd
3.下载安装包
[[email protected]:~]#
wget https://download.adiscon.com/loganalyzer/loganalyzer-4.1.12.tar.gz
4.压缩包并解压到html中
[[email protected]:/var/www/html]#
tar xvf loganalyzer-4.1.12.tar.gz
[[email protected]:/var/www/html]#
mv ./loganalyzer-4.1.12/src/ /var/www/html/log
[[email protected]:/var/www/html]#
touch /var/www/html/log/config.php
[[email protected]:/var/www/html]#
chmod 666 /var/www/html/log/config.php
5.浏览器访问操作http://10.0.0.38/log 进行web设置
6.回收权限
[[email protected]:/var/www/html]#
chmod 644 /var/www/html/log/config.php


边栏推荐
- Player screen orientation scheme
- Codeforces 1629 B. GCD arrays - simple thinking
- Multi source BFS problem template (with questions)
- [Title brushing] Super washing machine
- Informatics Olympiad all in one 2059: [example 3.11] buy a pen
- Codeforces 1637 E. best pair - Thinking
- List of common ACM knowledge points (to be continued)
- import torch_ Geometric loads some common datasets
- torch_ About the geometric Mini batch
- Deploy opengauss database based on Huawei cloud Kunpeng elastic ECS [Gauss is not a mathematician this time]
猜你喜欢

A method of quickly creating test window
![Will the next star of PPT for workplace speech be you [perfect summary] at the moment](/img/11/ac67db2641f42ef3d09417b790feb8.png)
Will the next star of PPT for workplace speech be you [perfect summary] at the moment
FFmpeg 学习指南

Implementing tensorflow deep learning framework similarflow with numpy

Application of binary search -- finding the square root sqrt of a number

Innovation training (XI) summary of some bugs in the development process

简历 NFT 平台 TrustRecruit 加入章鱼网络成为候选应用链
颜色编码格式介绍

章鱼网络进展月报 | 2022.5.1-5.31

Implementing pytorch style deep learning framework similartorch with numpy
随机推荐
What if the MySQL installation on the apple computer is completed and cannot be found
Codeforces 1629 A. download more RAM - simple greed
2068: [example 2.6] chicken and rabbit in the same cage
苹果电脑上MySQL安装完成找不到怎么办
Codeforces 1637 F. Towers - thinking, DFS
jsp跳转问题,不能显示数据库数据,并且不能跳转
Application of list and Dict
[Title brushing] Super washing machine
基于华为云鲲鹏弹性云服务器ECS部署openGauss数据库【这次高斯不是数学家】
字节序数据读写
Does jupyternotebook have a Chinese character database. Can you recognize handwritten Chinese in deep learning
创新实训(十)高级界面美化
Implementing tensorflow deep learning framework similarflow with numpy
Tinyxml Usage Summary
618 entered the second half of the period, apple occupied the high-end market, and the domestic mobile phones finally undercut the price competition
章鱼网络进展月报 | 2022.5.1-5.31
Understanding recursion
单向环形链表实现约瑟夫环
Implementing singleton mode of database under QT multithreading
Paw advanced user guide