pgcenter是针对PostgreSQL数据库的一款监控工具,详细地址:https://github.com/lesovsky/pgcenter。git
pgcenter目前开发和测试主要面向PG9.4(对9.x其余版本也有测试),目前仍是bata版本在一些状况下会有错误。pgcenter和PG服务器最好在同一主机,由于对于远程服务器,pgcenter有些功能不可用。运行pgcenter要使用PG的superuser帐号,不然PG的某些信息会由于权限不够而没法获取。github
centos 32bitsql
因为pgcenter目前对远程PG的监控有一些功能没法使用,因此咱们在本地安装PG来试用。shell
编译安装或者安装包图形化安装都可。可参考:PostgreSQL在Linux下的源码编译安装。数据库
安装目录:/opt/pg944centos
系统用户:postgres服务器
端口号:5432app
2.1安装gitsocket
su - root yum install git
2.2用git下载pgcenter源码安装包工具
git clone https://github.com/lesovsky/pgcenter
2.3安装ncurese
yum install ncurses
2.4安装pgcenter
cd pgcenter make
报错:找不到pg_config
解决:export PATH=$PATH:/opt/pg944/bin/
sudo make install
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@localhost bin]$ pgcenter --help pgcenter is the adminitrative console for PostgreSQL. Usage: pgcenter [OPTION]... [DBNAME [USERNAME]] General options: -?, --help show this help, then exit. -V, --version print version, then exit. Options: -h, --host=HOSTNAME database server host or socket directory -p, --port=PORT database server port (default: "5432") -U, --username=USERNAME database user name (default: "current user") -d, --dbname=DBNAME database name (default: "current user") -f, --file=FILENAME conninfo file (default: "~/.pgcenterrc") -w, --no-password never prompt for password -W, --password force password prompt (should happen automatically) Report bugs to <lesovsky@gmail.com>. [postgres@localhost bin]$ pgcenter -V pgcenter 0.2.0 [postgres@localhost bin]$ pgcenter [postgres@localhost bin]$
备注:本文仅限于测试试用,须要结合其余工具过着应用进一步测试。不适用于生产环境。