2016-02-18 39 views
11

Nie można uruchomić PostgreSQL 9.5 na CentOS 7.Nie można uruchomić postgresql-9.5 na CentOS 7

Śledziłem tę stronę - https://wiki.postgresql.org/wiki/YUM_Installation - dla instalacji serwera bazy danych na CentOS.

Próbowałem tego samego po ustawieniu setenforce 0, a to też nie pomogło.

Wykonuję wszystkie operacje jako root.

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

A oto co mi się o status -

Redirecting to /bin/systemctl status postgresql-9.5.service 
● postgresql-9.5.service - PostgreSQL 9.5 database server 
    Loaded: loaded (/usr/lib/systemd/system/postgresql-9.5.service; enabled; vendor preset: disabled) 
    Active: failed (Result: exit-code) since Thu 2016-02-18 15:20:30 EST; 2min 28s ago 
    Process: 15041 ExecStartPre=/usr/pgsql-9.5/bin/postgresql95-check-db-dir ${PGDATA} (code=exited, status=1/FAILURE) 

Feb 18 15:20:30 myserver systemd[1]: Starting PostgreSQL 9.5 database server... 
Feb 18 15:20:30 myserver systemd[1]: postgresql-9.5.service: control process exited, code=exited status=1 
Feb 18 15:20:30 myserver systemd[1]: Failed to start PostgreSQL 9.5 database server. 
Feb 18 15:20:30 myserver systemd[1]: Unit postgresql-9.5.service entered failed state. 
Feb 18 15:20:30 myserver systemd[1]: postgresql-9.5.service failed. 

a zawartość poszczególnych plików conf są następujące -

[[email protected] /]# cat /etc/ld.so.conf.d/postgresql-pgdg-libs.conf 
/usr/pgsql-9.5/lib/ 

[[email protected] /]# cat /usr/lib/tmpfiles.d/postgresql-9.5.conf 
d /var/run/postgresql 0755 postgres postgres - 

[[email protected] /]# cat /usr/pgsql-9.5/share/postgresql-9.5-libs.conf 
/usr/pgsql-9.5/lib/ 

[[email protected] /]# cat /etc/alternatives/pgsql-ld-conf 
/usr/pgsql-9.5/lib/ 

[[email protected] /]# cat /var/lib/alternatives/pgsql-ld-conf 
auto 
/etc/ld.so.conf.d/postgresql-pgdg-libs.conf 

/usr/pgsql-9.5/share/postgresql-9.5-libs.conf 
950 

google za błąd, że widzę . Wiele osób widziało ten sam błąd, a podstawowa przyczyna jest inna w obu przypadkach. Czytając te posty, nie jest jasne, czy widzę jedną z już zgłoszonych przyczyn.

Odpowiedz

27

Upewnij się, że wszystkie pakiety zostały poprawnie zainstalowane i zaktualizowane sekcje repozytorium yum [base] i [updates] przed instalacją, jak wspomniano w guide. Mamy CentOS 7 z PostgreSQL 9.5 i działa perfekcyjnie z następujących etapów:

# vi /etc/yum.repos.d/CentOS-Base.repo 
# yum localinstall http://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-2.noarch.rpm 
# yum list postgres* 
# yum install -y postgresql95-server.x86_64 postgresql95-contrib.x86_64 postgresql95-libs.x86_64 
# /usr/pgsql-9.5/bin/postgresql95-setup initdb 
# systemctl enable postgresql-9.5.service 
# systemctl start postgresql-9.5.service 

wreszcie systemctl status postgresql-9.5.service powinien pokazać coś takiego:

postgresql-9.5.service - PostgreSQL 9.5 database server 
    Loaded: loaded (/usr/lib/systemd/system/postgresql-9.5.service; enabled) 
    Active: active (running) since Fri 2016-02-19 00:01:13 UTC; 6min ago 
    Process: 10809 ExecStart=/usr/pgsql-9.5/bin/pg_ctl start -D ${PGDATA} -s -w -t 300 (code=exited, status=0/SUCCESS) 
    Process: 10802 ExecStartPre=/usr/pgsql-9.5/bin/postgresql95-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS) 
Main PID: 10811 (postgres) 
    CGroup: /system.slice/postgresql-9.5.service 
      ├─10811 /usr/pgsql-9.5/bin/postgres -D /var/lib/pgsql/9.5/data 
      ├─10812 postgres: logger process 
      ├─10814 postgres: checkpointer process 
      ├─10815 postgres: writer process 
      ├─10816 postgres: wal writer process 
      ├─10817 postgres: autovacuum launcher process 
      └─10818 postgres: stats collector process 
+5

Magia linia była to - '#!/Usr /pgsql-9.5/bin/postgresql95-setup initdb'. Dzięki :). Przewodnik wymienia powyższy wiersz jako alternatywny, jeśli 'service initdb' nie działa. Jednak nie ma wskazówek, jak by wyglądało wyjście, gdyby działało. W moim przypadku użyłem 'service initdb' i właśnie zwróciło mnie z powrotem do wiersza poleceń. I w końcu się dowiedziałem, że to nie zadziałało. –

+0

perfect..exactly, co chciałem – Sabarish

+0

Dla mnie magiczne linie to- [/usr/pgsql-9.5/bin/postgresql95-setup initdb] i [systemctl enable postgresql-9.5.service] –