无法在Fedora

时间:2016-02-07 13:57:53

标签: linux postgresql fedora postgresql-9.3 fedora-21

我刚刚在我的Linux Fedora(21)上安装了PostgreSQL(9.3) - 如下所示

  • yum安装程序返回'已安装'因为这是我第二次运行它,为你准备一个screengrab。

  • systemctl启用postgresq,似乎工作。至少它不会返回任何错误。

  • systemctl start postgresql失败。日志显示"数据目录" / ConfigDir"不存在"所以我猜这是关键。

但是/ ConfigDir会做exis。它是Fedora PostgreSQL安装中默认的/ usr / local / pgsql / data。用户很难拥有:postgres

我想postgres服务器服务的开始失败,因为它无法以某种方式查看目录,可能是因为它没有尝试用户:postgres。

但我不知道如何检查这个,也不知道如何修补它。

[martin@helium ~]$ sudo yum install postgresql-server postgresql-contrib
[sudo] password for martin: 
Loaded plugins: langpacks
Package postgresql-server-9.3.9-1.fc21.x86_64 already installed and latest version
Package postgresql-contrib-9.3.9-1.fc21.x86_64 already installed and latest version
Nothing to do
[martin@helium ~]$ sudo systemctl enable postgresql
[martin@helium ~]$ sudo systemctl start postgresql
Job for postgresql.service failed. See "systemctl status postgresql.service" and "journalctl -xe" for details.
[martin@helium ~]$ journalctl -xn
-- Logs begin at Fri 2014-12-26 16:16:25 CET, end at Sun 2016-02-07 14:35:11 CET. --
Feb 07 14:35:06 helium.hvidberg.net sudo[3466]: martin : TTY=pts/0 ; PWD=/home/martin ; USER=root ; COMMAND=/bin/systemctl start postgresql
Feb 07 14:35:06 helium.hvidberg.net sudo[3466]: pam_unix(sudo:session): session opened for user root by martin(uid=0)
Feb 07 14:35:06 helium.hvidberg.net pg_ctl[3476]: FATAL:  data directory "/ConfigDir" does not exist
Feb 07 14:35:11 helium.hvidberg.net pg_ctl[3476]: pg_ctl: could not start server
Feb 07 14:35:11 helium.hvidberg.net pg_ctl[3476]: Examine the log output.
Feb 07 14:35:11 helium.hvidberg.net systemd[1]: postgresql.service: control process exited, code=exited status=1
Feb 07 14:35:11 helium.hvidberg.net 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.
Feb 07 14:35:11 helium.hvidberg.net systemd[1]: Unit postgresql.service entered failed state.
Feb 07 14:35:11 helium.hvidberg.net systemd[1]: postgresql.service failed.
Feb 07 14:35:11 helium.hvidberg.net sudo[3466]: pam_unix(sudo:session): session closed for user root
[martin@helium ~]$ 

更改为root以便能够看到postgresql数据目录

[root@helium data]# pwd
/usr/local/pgsql/data
[root@helium data]# ls -l
total 100
drwx------. 5 postgres postgres  4096 Feb  6 19:00 base
drwx------. 2 postgres postgres  4096 Feb  6 19:03 global
drwx------. 2 postgres postgres  4096 Feb  6 19:00 pg_clog
-rw-------. 1 postgres postgres  4476 Feb  6 19:00 pg_hba.conf
-rw-------. 1 postgres postgres  1636 Feb  6 19:00 pg_ident.conf
drwx------. 2 postgres postgres  4096 Feb  6 19:03 pg_log
drwx------. 4 postgres postgres  4096 Feb  6 19:00 pg_multixact
drwx------. 2 postgres postgres  4096 Feb  6 19:03 pg_notify
drwx------. 2 postgres postgres  4096 Feb  6 19:00 pg_serial
drwx------. 2 postgres postgres  4096 Feb  6 19:00 pg_snapshots
drwx------. 2 postgres postgres  4096 Feb  6 19:05 pg_stat
drwx------. 2 postgres postgres  4096 Feb  6 19:05 pg_stat_tmp
drwx------. 2 postgres postgres  4096 Feb  6 19:00 pg_subtrans
drwx------. 2 postgres postgres  4096 Feb  6 19:00 pg_tblspc
drwx------. 2 postgres postgres  4096 Feb  6 19:00 pg_twophase
-rw-------. 1 postgres postgres     4 Feb  6 19:00 PG_VERSION
drwx------. 3 postgres postgres  4096 Feb  6 19:00 pg_xlog
-rw-------. 1 postgres postgres 20733 Feb  7 10:26 postgresql.conf
-rw-------. 1 postgres postgres    47 Feb  6 19:03 postmaster.opts
[root@helium data]#

0 个答案:

没有答案