postgresql zabbix 如何成功完成安装?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17233586/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 00:58:42  来源:igfitidea点击:

zabbix How to complete installation successfully?

postgresqlcentoszabbix

提问by 330xi

CentOS 6.4 postgres 9.2 zabbix 2.0

CentOS 6.4 postgres 9.2 zabbix 2.0

ps

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

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

zabbix_server.conf

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

I can connect and observe zabbix database in pgAdmin wihout any problem. But during zabbix installation in "3. Configure DB connection" I get:

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

pg_connect(): Unable to connect to PostgreSQL server: could not connect to server:
Permission denied Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432? [include/db.inc.php:99] Error connecting to database

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

How to complete installation successfully?

如何成功完成安装?

回答by Daniel Vérité

Permission deniedwhen establishing a network connection is likely to be due to SELinux. Check error messages in /var/log/audit/audit.log

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

Also note that DBSocketis for MySQL, it's ignored for PostgreSQL. To have zabbix connect to PostgresQL through a Unix local domain socket, this would be:

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

 DBHost=/tmp     # instead of localhost