为什么PostgreSQL 12数据库服务器不活动

问题描述 投票:0回答:1

我想使用postgresql,但显示错误,因此检查状态。它失败了。

一旦删除邮局局长,但发生相同的错误。

此服务器在[yum install --enablerepo = remi-php72 php-pdo php-pgsql和一些操作之前工作,但我不知道这是否是原因。

$sudo systemctl start postgresql-12.service

 Job for postgresql-12.service failed because the control process exited with error code. See "systemctl status postgresql-12.service" and "journalctl -xe" for details.
$systemctl status postgresql-12.service

● postgresql-12.service - PostgreSQL 12 database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql-12.service; enabled; ver preset: disabled)
   Active: failed (Result: exit-code) since Sun 2020-05-10 05:17:14 UTC; 40s
     Docs: https://www.postgresql.org/docs/12/static/
  Process: 708 ExecStart=/usr/pgsql-12/bin/postmaster -D ${PGDATA} (code=exit status=1/FAILURE)
  Process: 699 ExecStartPre=/usr/pgsql-12/bin/postgresql-12-check-db-dir ${PGA} (code=exited, status=0/SUCCESS)
 Main PID: 708 (code=exited, status=1/FAILURE)
-- Unit postgresql-12.service has begun starting up.
May 10 06:30:15 localhost.localdomain postmaster[3481]: 2020-05-10 06:30:15.915 UTC [3481] LOG:  starting PostgreSQL 12.2 on x86_64-pc-linux-gnu, compiled by
May 10 06:30:15 localhost.localdomain postmaster[3481]: 2020-05-10 06:30:15.922 UTC [3481] LOG:  listening on IPv6 address "::1", port 5432
May 10 06:30:15 localhost.localdomain postmaster[3481]: 2020-05-10 06:30:15.922 UTC [3481] LOG:  listening on IPv4 address "127.0.0.1", port 5432
May 10 06:30:15 localhost.localdomain postmaster[3481]: 2020-05-10 06:30:15.925 UTC [3481] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
May 10 06:30:15 localhost.localdomain postmaster[3481]: 2020-05-10 06:30:15.929 UTC [3481] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
May 10 06:30:16 localhost.localdomain postmaster[3481]: 2020-05-10 06:30:16.000 UTC [3481] LOG:  redirecting log output to logging collector process
May 10 06:30:16 localhost.localdomain postmaster[3481]: 2020-05-10 06:30:16.000 UTC [3481] HINT:  Future log output will appear in directory "log".
May 10 06:30:16 localhost.localdomain systemd[1]: postgresql-12.service: main process exited, code=exited, status=1/FAILURE
May 10 06:30:16 localhost.localdomain systemd[1]: Failed to start PostgreSQL 12 database server.
-- Subject: Unit postgresql-12.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql-12.service has failed.
--
-- The result is failed.
May 10 06:30:16 localhost.localdomain systemd[1]: Unit postgresql-12.service entered failed state.
May 10 06:30:16 localhost.localdomain systemd[1]: postgresql-12.service failed.
May 10 06:30:16 localhost.localdomain sudo[3468]: pam_unix(sudo:session): session closed for user root
May 10 06:30:16 localhost.localdomain polkitd[393]: Unregistered Authentication Agent for unix-process:3470:439245 (system bus name :1.64, object path /org/f


当我这样做并且日志目录中的secure(file)像这样更新时。

但是我不知道该做些什么。

$ systemctl start postgresql-12.service
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to manage system services or units.
Authenticating as: root
Password:
==== AUTHENTICATION COMPLETE ===
Job for postgresql-12.service failed because the control process exited with error code. See "systemctl status postgresql-12.service" and "journalctl -xe" for details.
May 10 08:01:06 localhost polkitd[382]: Registered Authentication Agent for unix-process:3289:174171 (system bus name :1.71 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
May 10 08:01:09 localhost polkitd[382]: Operator of unix-process:3289:174171 successfully authenticated as unix-user:root to gain ONE-SHOT authorization for action org.freedesktop.systemd1.manage-units for system-bus-name::1.72 [systemctl start postgresql-12.service] (owned by unix-user:vagrant)
May 10 08:01:09 localhost polkitd[382]: Unregistered Authentication Agent for unix-process:3289:174171 (system bus name :1.71, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)

postgresql-Sun.log

2020-05-10 05:04:35.435 UTC [3207] LOG:  could not connect to Ident server at address "127.0.0.1", port 113: Connection refused
2020-05-10 05:04:35.435 UTC [3207] FATAL:  Ident authentication failed for user "postgres"
2020-05-10 05:04:35.435 UTC [3207] DETAIL:  Connection matched pg_hba.conf line 82: "host    all             all             127.0.0.1/32       
php vagrant centos7
1个回答
0
投票

我解决了!

我在发布此问题之前已经安装了postgresql,但是我没有更新/ var / lib / pgsql / 12文件,所以我使用]删除了它。

sudo rm -rf /var/lib/pgsql/12

和创建者

sudo PGSETUP_INITDB_OPTIONS="-E UTF --locale=C"/usr/pgsql-12/bin/postgresql-12-setup initdb

很好!

© www.soinside.com 2019 - 2024. All rights reserved.