The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PostgreSQL is not running

Discussion in 'Database Discussions' started by Tellniyi, Sep 9, 2015.

  1. Tellniyi

    Tellniyi Registered

    Joined:
    Sep 9, 2015
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    NIGERIA
    cPanel Access Level:
    Root Administrator
    Error: PostgreSQL is not running.

    PostgreSQL 9.2 is not starting on my cpanel installed on CentOS7 and when I install postgresql9.4, cpanel does not detect it.

    I have run initdb, start postgres, etc but nothing is starting my PostgreSQL it either says directory not empty or does not exist or cant make directory.

    please, urgent help needed
     
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,146
    Likes Received:
    34
    Trophy Points:
    48
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hello,

    Can you please try with following command.

    Code:
    /scripts/installpostgres
    Code:
    service postgresql restart
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    651
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Could you verify how you installed PostgreSQL?

    Thank you.
     
  4. Tellniyi

    Tellniyi Registered

    Joined:
    Sep 9, 2015
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    NIGERIA
    cPanel Access Level:
    Root Administrator
    here is the result

    Code:
    
    -- Unit postgresql.service has failed.
    --
    -- The result is failed.
    Sep 10 22:28:50 webserver.domain.com systemd[1]: Unit postgresql.service entered failed state.
    
    root@webserver [~]# cat /var/lib/pgsql/pgstartup.log
    cat: /var/lib/pgsql/pgstartup.log: No such file or directory
    root@webserver [~]# cat /var/lib/pgsql/pgstartup.log
    cat: /var/lib/pgsql/pgstartup.log: No such file or directory
    root@webserver [~]# /scripts/restartsrv postgresql
    The “postgresql” service is disabled.
    root@webserver [~]# /scripts/install postgresql
    -bash: /scripts/install: No such file or directory
    root@webserver [~]# /scripts/installpostgres
    This script installs PostgreSQL 9.2.x or later.
    If your system runs an older version of PostgreSQL, you must
    dump your databases to a file, and then restore them after
    installation.
    PostgreSQL 9.2.x is NOT backwards compatible.
    If no PostgreSQL databases exist on your system, run the
    following command to force the creation of a PostgreSQL 9.2.x -style
    setup:
            mv /var/lib/pgsql /var/lib/pgsql.old
            systemctl restart postgresql
    Do not run this command if databases exist that you wish to keep!
    Are you certain that you wish to proceed? [y/(n)]:y
    Loaded plugins: fastestmirror, langpacks, rhnplugin
    This system is receiving updates from CLN.
    Loading mirror speeds from cached hostfile
    * base: mirror.isoc.org.il
    * cloudlinux-x86_64-server-7: ams-proxy.cl-mirror.net
    * epel: epel.check-update.co.uk
    * updates: centos.joinweb.co.il
    No package rh-postgresql available.
    No package rh-postgresql-devel available.
    No package rh-postgresql-libs available.
    No package rh-postgresql-server available.
    Package postgresql-9.2.13-1.el7_1.x86_64 already installed and latest version
    Package postgresql-devel-9.2.13-1.el7_1.x86_64 already installed and latest version
    Package postgresql-libs-9.2.13-1.el7_1.x86_64 already installed and latest version
    Package postgresql-server-9.2.13-1.el7_1.x86_64 already installed and latest version
    Nothing to do
    info [installpostgres] Prelinking is disabled.
    Failed to determine postgresql data directory
    The PostgreSQL installation failed.
    
    
    root@webserver [~]# sudo service postgresql restart

    Code:
    Redirecting to /bin/systemctl restart  postgresql.service
    Job for postgresql.service failed. See 'systemctl status postgresql.service' and 'journalctl -xn' for details.
    root@webserver [~]# systemctl status postgresql.service'
    > journalctl -xn
    > ^C
    root@webserver [~]# systemctl status postgresql.service
    postgresql.service - PostgreSQL database server
       Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled)
       Active: failed (Result: exit-code) since Thu 2015-09-10 22:56:13 WAT; 38s ago
      Process: 24904 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} (code=exited, status=1/FAILURE)
    
    Sep 10 22:56:13 webserver.MYDOMAIN postgresql-check-db-dir[24904]: "/var/lib/pgsql/data" is missing or empty.
    Sep 10 22:56:13 webserver.MYDOMAIN postgresql-check-db-dir[24904]: Use "postgresql-setup initdb" to initialize the database...ter.
    Sep 10 22:56:13 webserver.MYDOMAIN postgresql-check-db-dir[24904]: See /usr/share/doc/postgresql-9.2.13/README.rpm-dist for...ion.
    Sep 10 22:56:13 webserver.MYDOMAIN systemd[1]: postgresql.service: control process exited, code=exited status=1
    Sep 10 22:56:13 webserver.MYDOMAIN systemd[1]: Failed to start PostgreSQL database server.
    Sep 10 22:56:13 webserver.MYDOMAIN systemd[1]: Unit postgresql.service entered failed state.
    Hint: Some lines were ellipsized, use -l to show in full.
    root@webserver [~]# journalctl -xn
    -- Logs begin at Wed 2015-09-09 22:36:24 WAT, end at Thu 2015-09-10 22:57:01 WAT. --
    Sep 10 22:56:13 webserver.MYDOMAIN systemd[1]: Starting PostgreSQL database server...
    -- Subject: Unit postgresql.service has begun with start-up
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit postgresql.service has begun starting up.
    Sep 10 22:56:13 webserver.MYDOMAIN postgresql-check-db-dir[24904]: "/var/lib/pgsql/data" is missing or empty.
    Sep 10 22:56:13 webserver.MYDOMAIN postgresql-check-db-dir[24904]: Use "postgresql-setup initdb" to initialize the database cluste
    Sep 10 22:56:13 webserver.MYDOMAIN postgresql-check-db-dir[24904]: See /usr/share/doc/postgresql-9.2.13/README.rpm-dist for more i
    Sep 10 22:56:13 webserver.MYDOMAIN systemd[1]: postgresql.service: control process exited, code=exited status=1
    Sep 10 22:56:13 webserver.MYDOMAIN systemd[1]: Failed to start PostgreSQL database server.
    -- Subject: Unit postgresql.service has failed
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit postgresql.service has failed.
    --
    -- The result is failed.
    Sep 10 22:56:13 webserver.MYDOMAIN systemd[1]: Unit postgresql.service entered failed state.
    Sep 10 22:57:01 webserver.MYDOMAIN systemd[1]: Starting Session 1269 of user root.
    -- Subject: Unit session-1269.scope has begun with start-up
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit session-1269.scope has begun starting up.
    Sep 10 22:57:01 webserver.MYDOMAIN systemd[1]: Started Session 1269 of user root.
    -- Subject: Unit session-1269.scope has finished start-up
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit session-1269.scope has finished starting up.
    --
    -- The start-up result is done.
    Sep 10 22:57:01 webserver.MYDOMAIN pam_lve[24916]: (root) CMD (/usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1)
    
    
     
    #4 Tellniyi, Sep 10, 2015
    Last edited by a moderator: Sep 10, 2015
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    651
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Have you created any PostgreSQL databases as of yet? If not, try removing the PostgreSQL RPMs before reinstalling it. EX:

    Code:
    rpm -qa|grep postgresql
    Remove any PostgreSQL RPMs with a command such as:

    Code:
    rpm -e --nodeps postgresql-XXX
    Replace "postgresql-XXX" with the name of each RPM from the first command. Then run "/scripts/installpostgres" again.

    Thank you.
     
Loading...

Share This Page