微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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<[email protected]>.
[postgres@localhostbin]$pgcenter-V
pgcenter0.2.0
[postgres@localhostbin]$pgcenter
[postgres@localhostbin]$


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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐