PostgreSQL统计数据监控工具 - pgcenter

前端之家收集整理的这篇文章主要介绍了PostgreSQL统计数据监控工具 - pgcenter前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

简介

pgcenter是针对Postgresql数据库的一款监控工具,详细地址:https://github.com/lesovsky/pgcenter

pgcenter目前开发和测试主要面向PG9.4(对9.x其他版本也有测试),目前还是bata版本在一些情况下会有错误。pgcenter和PG服务器最好在同一主机,因为对于远程服务器,pgcenter有些功能不可用。运行pgcenter要使用PG的superuser账号,否则PG的某些信息会因为权限不够而无法获取

配置、安装与试用

环境:

centos 32bit

1. 安装postgresql9.4

由于pgcenter目前对远程PG的监控有一些功能无法使用,所以我们在本地安装PG来试用。

编译安装或者安装包图形化安装均可。可参考:PostgreSQL在Linux下的源码编译安装

安装目录:/opt/pg944

系统用户:postgres

端口号:5432

2. 安装pgcenter(通过下载源码安装的方法

2.1安装git

su-root
yuminstallgit

2.2用git下载pgcenter源码安装包

gitclonehttps://github.com/lesovsky/pgcenter

2.3安装ncurese

yuminstallncurses

2.4安装pgcenter

cdpgcenter
make

报错:找不到pg_config

解决:export PATH=$PATH:/opt/pg944/bin/

sudomakeinstall

3. 使用pgcenter

su-postgres
pgcenter

报错:pgcenter: error while loading shared libraries: libpq.so.5:cannot open shared object file: No such file or directory

解决: export LD_LIBRARY_PATH=/opt/pg944/lib/

[postgres@localhostbin]$pgcenter--help
pgcenteristheadminitrativeconsoleforPostgresql.
Usage:
pgcenter[OPTION]...[DBNAME[USERNAME]]
Generaloptions:
-?,--helpshowthishelp,thenexit.
-V,--versionprintversion,thenexit.
Options:
-h,--host=HOSTNAMEdatabaseserverhostorsocketdirectory
-p,--port=PORTdatabaseserverport(default:"5432")
-U,--username=USERNAMEdatabaseusername(default:"currentuser")
-d,--dbname=DBNAMEdatabasename(default:"currentuser")
-f,--file=FILENAMEconninfofile(default:"~/.pgcenterrc")
-w,--no-passwordneverpromptforpassword
-W,--passwordforcepasswordprompt(shouldhappenautomatically)
Reportbugsto<lesovsky@gmail.com>.
[postgres@localhostbin]$pgcenter-V
pgcenter0.2.0
[postgres@localhostbin]$pgcenter
[postgres@localhostbin]$


备注:本文仅限于测试试用,需要结合其他工具过着应用进一步测试。不适用于生产环境。

原文链接:https://www.f2er.com/postgresql/194775.html

猜你在找的Postgre SQL相关文章