From: Chatterjee, Shibayan <shibayan.chatterjee@centurylink.com>
To: Laurenz Albe <laurenz.albe@cybertec.at>
To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: RE: Issue: Creating Symlink for data directory of postgresql in CentOS7
Date: Fri, 12 Jul 2019 18:08:18 +0000
Message-ID: <0c92d81eb54c4fc3b6c82beab07115d2@level3.com> (raw)
In-Reply-To: <480fa09c6fba11c2b79724d3b5ffdd385822a295.camel@cybertec.at>
References: <edcbd415540549e4aa36c92e7dba0a5c@level3.com>
<480fa09c6fba11c2b79724d3b5ffdd385822a295.camel@cybertec.at>
Laurenz,
For sure there's all the necessary files in '/data/postgresql/data'. The startup process cannot read it, because of sym link.
Executing init-db return the below message:
>>>> # sudo postgresql-setup initdb
Data directory is not empty!
-Shibayan
-----Original Message-----
From: Laurenz Albe <laurenz.albe@cybertec.at>
Sent: Friday, July 12, 2019 8:47 AM
To: Chatterjee, Shibayan <shibayan.chatterjee@level3.com>; pgsql-general@postgresql.org
Subject: Re: Issue: Creating Symlink for data directory of postgresql in CentOS7
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
This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: shibayan.chatterjee@centurylink.com, laurenz.albe@cybertec.at
Subject: Re: Issue: Creating Symlink for data directory of postgresql in CentOS7
In-Reply-To: <0c92d81eb54c4fc3b6c82beab07115d2@level3.com>
References: <edcbd415540549e4aa36c92e7dba0a5c@level3.com> <480fa09c6fba11c2b79724d3b5ffdd385822a295.camel@cybertec.at> <0c92d81eb54c4fc3b6c82beab07115d2@level3.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox