RM新时代国际平台

  • <div id="r605l"></div>
      1. <th id="r605l"></th>
      2. Failed to start PostgreSQL 11 database server的解決辦法

        在使用 PostgreSQL 過程中,我目前遇到了 2 種錯誤的類型,下面是具體解決辦法和具體的錯誤信息。

        連接拒絕Connection refused

        在使用 Django 應用中,使用 PostgreSQL 關系數據庫,在安裝的時候遇到一些問題,具體如下:

        Is the server running on host "host_name" (XX.XX.XX.XX)

        and accepting TCP/IP connections on port 5432?

        上面這個問題是沒有啟動數據庫導致的。

        啟動失敗

        下面這個問題啟動失敗的問題,啟動命令是

        [root@VM_152_4_centos bootcamp]# service postgresql-11 start

        Redirecting to /bin/systemctl start postgresql-11.service

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

        提示了運行status 和 journalctl -xe 可以查看到具體細節(jié)。

        [root@VM_152_4_centos bootcamp]# systemctl status postgresql-11.service

        ● postgresql-11.service - PostgreSQL 11 database server

        Loaded: loaded (/usr/lib/systemd/system/postgresql-11.service; disabled; vendor preset: disabled)

        Active: failed (Result: exit-code) since Sun 2019-02-17 22:15:42 CST; 19min ago

        Docs: https://www.postgresql.org/docs/11/static/

        Process: 6220 ExecStartPre=/usr/pgsql-11/bin/postgresql-11-check-db-dir ${PGDATA} (code=exited, status=1/FAILURE)

        Feb 17 22:15:42 VM_152_4_centos systemd[1]: Starting PostgreSQL 11 database server...

        Feb 17 22:15:42 VM_152_4_centos systemd[1]: postgresql-11.service: control process exited, code=exited status=1

        Feb 17 22:15:42 VM_152_4_centos systemd[1]: Failed to start PostgreSQL 11 database server.

        Feb 17 22:15:42 VM_152_4_centos systemd[1]: Unit postgresql-11.service entered failed state.

        Feb 17 22:15:42 VM_152_4_centos systemd[1]: postgresql-11.service failed.

        然后再執(zhí)行journalctl -xe命令。

        [root@VM_152_4_centos bootcamp]# journalctl -xe

        -- Unit postgresql-11.service has begun starting up.

        Feb 17 22:35:03 VM_152_4_centos postgresql-11-check-db-dir[7789]: "/var/lib/pgsql/11/data/" is missing or empty.

        可以看到根本原因就是沒有db,所以需要先初始化db。

        [root@VM_152_4_centos ~]# /usr/pgsql-11/bin/postgresql-11-setup initdb

        Initializing database ... OK

        最后啟動,然后查看狀態(tài)

        [root@VM_152_4_centos bootcamp]# systemctl start postgresql-11.service

        [root@VM_152_4_centos bootcamp]# systemctl status postgresql-11.service

        ● postgresql-11.service - PostgreSQL 11 database server

        Loaded: loaded (/usr/lib/systemd/system/postgresql-11.service; disabled; vendor preset: disabled)

        Active: active (running) since Sun 2019-02-17 22:37:04 CST; 2s ago


        下一篇:ghost分區(qū)丟失只剩c盤數據怎么免費恢復?
        RM新时代国际平台
      3. <div id="r605l"></div>
          1. <th id="r605l"></th>
          2. <div id="r605l"></div>
              1. <th id="r605l"></th>
              2. 新时代RM|国际平台 新时代软件下载 RM新时代官网网址 rm新时代是正规平台 新时代rm平台入口