安装httpd、php
- yum install httpd
- chkconfig httpd on
- service httpd start
- yum install php
查看/var/www
- [root@localhost www]# pwd
- /var/www
- [root@localhost www]# ll
- total 20
- drwxr-xr-x. 2 root root 4096 Aug 15 15:45 cgi-bin
- drwxr-xr-x. 3 root root 4096 Sep 11 02:23 error
- drwxr-xr-x. 2 root root 4096 Sep 11 03:43 html
- drwxr-xr-x. 3 root root 4096 Sep 11 02:23 icons
- drwxr-xr-x. 3 root root 4096 Sep 11 04:33 pgbadger
日记分析
- ./pgbench -i
- ./pgbench -c 10 -t 1000
- [root@localhost ~]# pgbadger /opt/postgres/db/pgsql-9.5.9/data/pg_log/*.log -o /var/www/pgbadger/out.html -f stderr
- [========================>] Parsed 10485802 bytes of 10485802 (100.00%), queries: 65341, events: 2
- [========================>] Parsed 755640 bytes of 755640 (100.00%), queries: 70036, events: 2
- LOG: Ok, generating html report...
- [root@localhost ~]#
在浏览器打开/var/www/pgbadger/out.html
PostgreSQL设备
持续日记分析(增量模式)
pg_stat_statements 不仅输出SQL语句,还可以输出履行时光等,经由过程分析此办事器日记,可以知道履行什么样的SQL,以及缩小范围找到哪些SQL有可能出现机能问题。
增量模式用于持续获取分析结不雅。
此外,它不仅收集SQL,还收集办事器日记中的缺点日记等。
以增量模式履行pgBadger会在第二天创建下一?申报(增量申报)。
- [root@localhost ~]# pgbadger -I /opt/postgres/db/pgsql-9.5.9/data/pg_log/*.log -o /var/www/pgbadger/out.html -f stderr
- [========================>] Parsed 1499636 bytes of 1499636 (100.00%), queries: 0, events: 0
- [========================>] Parsed 10485846 bytes of 10485846 (100.00%), queries: 65379, events: 0
- [========================>] Parsed 743891 bytes of 743891 (100.00%), queries: 4625, events: 0
- LOG: Ok, generating HTML daily report
推荐阅读
数据库是所有应用体系的核心,故包管数据库稳定、高效、安然地运行是所有企业日常工作的重中之重。数据库系同一旦出现问题无法供给办事,有可能导致全部体系都无法持续工作。所以,一个成功的数据库架构>>>详细阅读
本文标题:PostgreSQL日志分析工具——pgBadger
地址:http://www.17bianji.com/lsqh/37412.html
1/2 1