Re: Issue: Creating Symlink for data directory of postgresql in CentOS7

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: "Chatterjee, Shibayan" <shibayan(dot)chatterjee(at)centurylink(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Issue: Creating Symlink for data directory of postgresql in CentOS7
Date: 2019-07-12 14:47:19
Message-ID: 480fa09c6fba11c2b79724d3b5ffdd385822a295.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 2019-07-12 at 10:11 +0000, Chatterjee, Shibayan wrote:
> I’m trying to create a symlink for ‘data’ directory present in ‘/var/lib/pgsql/’, pointing to different location.
> After providing exact access permissions and ownership to postgres, I’m still unable to restart postgres after modifications.
>
> I’ve also modified ‘/var/lib/pgsql/postgresql.conf’ and ‘/usr/lib/systemd/system/postgresql.service’
> to point the $PGDATA location to the actual destination as respectively:
>
> data_directory = '/data/postgresql/data'
> Environment=PGDATA=/data/postgresql/data

[...]

> >>> /var/log/messages
>
> Jul 12 10:00:51 systemd: Starting PostgreSQL database server...
> Jul 12 10:00:51 postgresql-check-db-dir: "/data/postgresql/data" is missing or empty.
> Jul 12 10:00:51 postgresql-check-db-dir: Use "postgresql-setup initdb" to initialize the database cluster.
> Jul 12 10:00:51 postgresql-check-db-dir: See /usr/share/doc/postgresql-9.2.24/README.rpm-dist for more information.
> Jul 12 10:00:51 systemd: postgresql.service: control process exited, code=exited status=1
> Jul 12 10:00:51 systemd: Failed to start PostgreSQL database server.
> Jul 12 10:00:51 systemd: Unit postgresql.service entered failed state.
> Jul 12 10:00:51 systemd: postgresql.service failed.

So there is some "postgresql-check-db-dir" (not part of PostgreSQL) that complains
that there is nothing in /data/postgresql/data. Is that accurate?

It looks like you succeeded in getting the startup process to look for the
PostgreSQL data directory in the new location, but - alas - there is no data
directory there yet.

You could follow the instructions and run "initdb" to create the data directory.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Wayne Mell 2019-07-12 15:05:24 Re: Postgresql and VBA - Connection Timeout
Previous Message Tom Lane 2019-07-12 14:43:13 Re: disable and enable trigger all when a foreign keys