0

CentOS 6.4 postgres 9.2 zabbix 2.0

ps

     1761 ?        Ss     0:00 postgres: logger process                            
 1763 ?        Ss     0:00 postgres: checkpointer process                      
 1764 ?        Ss     0:00 postgres: writer process                            
 1765 ?        Ss     0:00 postgres: wal writer process                        
 1766 ?        Ss     0:00 postgres: autovacuum launcher process               
 1767 ?        Ss     0:00 postgres: stats collector process 
 2257 ?        Ss     0:00 /usr/sbin/httpd
 2259 ?        S      0:00 /usr/sbin/httpd
 2260 ?        S      0:00 /usr/sbin/httpd
 2261 ?        S      0:00 /usr/sbin/httpd
 2262 ?        S      0:00 /usr/sbin/httpd
 2263 ?        S      0:00 /usr/sbin/httpd
 2264 ?        S      0:00 /usr/sbin/httpd
 2265 ?        S      0:00 /usr/sbin/httpd
 2266 ?        S      0:00 /usr/sbin/httpd
 2280 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2282 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2283 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2284 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2285 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2286 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2287 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2288 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2289 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2290 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2291 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2292 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2293 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2294 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2295 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2296 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2298 ?        Ss     0:00 postgres: zabbix zabbix 127.0.0.1(51084) idle       
 2299 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2300 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2301 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2302 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2303 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2304 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2305 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2306 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2307 ?        Ss     0:00 postgres: zabbix zabbix 127.0.0.1(51085) idle       
 2308 ?        Ss     0:00 postgres: zabbix zabbix 127.0.0.1(51086) idle       
 2309 ?        Ss     0:00 postgres: zabbix zabbix 127.0.0.1(51087) idle       
 2310 ?        Ss     0:00 postgres: zabbix zabbix 127.0.0.1(51088) idle       
 2311 ?        Ss     0:00 postgres: zabbix zabbix 127.0.0.1(51089) idle       
 2312 ?        Ss     0:00 postgres: zabbix zabbix 127.0.0.1(51090) idle       
 2313 ?        Ss     0:00 postgres: zabbix zabbix 127.0.0.1(51091) idle       
 2315 ?        Ss     0:00 postgres: zabbix zabbix 127.0.0.1(51093) idle       
 2316 ?        Ss     0:00 postgres: zabbix zabbix 127.0.0.1(51094) idle       
 2317 ?        Ss     0:00 postgres: zabbix zabbix 127.0.0.1(51095) idle       
 2318 ?        Ss     0:00 postgres: zabbix zabbix 127.0.0.1(51096) idle       
 2319 ?        Ss     0:00 postgres: zabbix zabbix 127.0.0.1(51097) idle       
 2320 ?        Ss     0:00 postgres: zabbix zabbix 127.0.0.1(51098) idle       
 2321 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2322 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2323 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf
 2324 ?        Ss     0:00 postgres: zabbix zabbix 127.0.0.1(51099) idle       
 2325 ?        Ss     0:00 postgres: zabbix zabbix 127.0.0.1(51100) idle       
 2326 ?        Ss     0:00 postgres: zabbix zabbix 127.0.0.1(51101) idle       
 2327 ?        Ss     0:00 postgres: zabbix zabbix 127.0.0.1(51102) idle       
 2328 ?        Ss     0:00 postgres: zabbix zabbix 127.0.0.1(51103) idle       
 2329 ?        Ss     0:00 postgres: zabbix zabbix 127.0.0.1(51104) idle       
 2330 ?        Ss     0:00 postgres: zabbix zabbix 127.0.0.1(51105) idle       
 2331 ?        Ss     0:00 postgres: zabbix zabbix 127.0.0.1(51106) idle       
 2332 ?        Ss     0:00 postgres: zabbix zabbix 127.0.0.1(51107) idle

pg_hba.conf

# TYPE  DATABASE        USER            ADDRESS                 METHOD

local all all trust
host all all 0.0.0.0/0 trust
local   zabbix      zabbix                            md5

postgresql.conf

# - Connection Settings -

listen_addresses = '*'      # what IP address(es) to listen on;
                    # comma-separated list of addresses;
                    # defaults to 'localhost'; use '*' for all
                    # (change requires restart)
port = 5432             # (change requires restart)
max_connections = 100   

zabbix_server.conf

DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
DBSocket=/tmp/.s.PGSQL.5432

我可以在 pgAdmin 中连接和观察 zabbix 数据库,没有任何问题。但是在“3.配置数据库连接”中的zabbix安装期间,我得到:

pg_connect():无法连接到 PostgreSQL 服务器:无法连接到服务器:
权限被拒绝 服务器是否在主机“localhost”(127.0.0.1)上运行并接受端口 5432 上的 TCP/IP 连接?[include/db.inc.php:99] 连接数据库时出错

如何成功完成安装?

4

1 回答 1

2

建立网络连接时权限被拒绝很可能是由于SELinux. 检查错误信息/var/log/audit/audit.log

另请注意,DBSocket对于 MySQL,它对于 PostgreSQL 被忽略。要让 zabbix 通过 Unix 本地域套接字连接到 PostgresQL,这将是:

DBHost=/tmp # 而不是 localhost
于 2013-06-21T11:47:40.007 回答