2016-03-02 134 views
0

我安装了Centos 7,64位。安装postgresql-9.4。 用命令初始化PostgreSQL的centos 7 postgresql未启动

/usr/pgsql-9.4/bin/postgresql94-setup initdb 

然后用这个命令启动PostgreSQL的

systemctl start postgresql-9.4 

,并显示错误是这样的:

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

输入的命令

systemctl status postgresql-9.4.service 
● postgresql-9.4.service - PostgreSQL 9.4 database server 
    Loaded: loaded (/usr/lib/systemd/system/postgresql-9.4.service; enabled; vendor preset: disabled) 
    Active: failed (Result: exit-code) since Wed 2016-03-02 18:09:27 CST; 1min 59s ago 
    Process: 31266 ExecStart=/usr/pgsql-9.4/bin/pg_ctl start -D ${PGDATA} -s -w -t 300 (code=exited, status=1/FAILURE) 
    Process: 31261 ExecStartPre=/usr/pgsql-9.4/bin/postgresql94-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS) 

Mar 02 18:09:26 localhost.localdomain pg_ctl[31266]: < 2016-03-02 18:09:26.862 CST >LOG: could not bind IPv6 socket: Address already in use 
Mar 02 18:09:26 localhost.localdomain pg_ctl[31266]: < 2016-03-02 18:09:26.862 CST >HINT: Is another postmaster already running on...retry. 
Mar 02 18:09:26 localhost.localdomain pg_ctl[31266]: < 2016-03-02 18:09:26.862 CST >LOG: could not bind IPv4 socket: Address already in use 
Mar 02 18:09:26 localhost.localdomain pg_ctl[31266]: < 2016-03-02 18:09:26.862 CST >HINT: Is another postmaster already running on...retry. 
Mar 02 18:09:26 localhost.localdomain pg_ctl[31266]: < 2016-03-02 18:09:26.862 CST >WARNING: could not create listen socket for "localhost" 
Mar 02 18:09:26 localhost.localdomain pg_ctl[31266]: < 2016-03-02 18:09:26.862 CST >FATAL: could not create any TCP/IP sockets 
Mar 02 18:09:27 localhost.localdomain systemd[1]: postgresql-9.4.service: control process exited, code=exited status=1 
Mar 02 18:09:27 localhost.localdomain systemd[1]: Failed to start PostgreSQL 9.4 database server. 
Mar 02 18:09:27 localhost.localdomain systemd[1]: Unit postgresql-9.4.service entered failed state. 
Mar 02 18:09:27 localhost.localdomain systemd[1]: postgresql-9.4.service failed. 

回答

0

- 安装包Psmisc做,得到killall上的Postgres

#百胜安装Psmisc做

- 运行杀

#killall -9 postgres的

- 开始/停止

#systemctl停止postgresql- 9.4
#systemctl启动postgresql- 9.4

- 要检查该服务是否在执行,

#PS -aux | grep postgres