Problem changing default data_directory in PG 9.6 + CentOS6

From: Edilmar LISTAS <edilista(at)intersite(dot)com(dot)br>
To: pgsql-general(at)postgresql(dot)org
Subject: Problem changing default data_directory in PG 9.6 + CentOS6
Date: 2016-10-17 20:38:47
Message-ID: 230418a9-52a5-a475-f7c8-946008959e72@intersite.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
I have an env running a changed data_directory fine in a devel
machine PG 9.4 using Fedora23. <br>
Now, I have a server machine with CentOS where I downloaded the RPMs
from repo <a rel="nofollow" target="_blank"
href="https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/pgdg-centos96-9.6-3.noarch.rpm"
class="ot-anchor aaTEdf" jslog="10929; track:click" dir="ltr">https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/pgdg-centos96-9.6-3.noarch.rpm</a>.<br>
All the configs run fine if I doesn't change the default
data_directory. But I need to use the path /sistemas/sat4/bdpg.<br>
<br>
I did these commands:<br>
<br>
mkdir /sistemas/sat4/bdpg<br>
chown postgres /sistemas/sat4/bdpg<br>
chmod 700 /sistemas/sat4/bdpg<br>
su - postgres <br>
/usr/pgsql-9.6/bin/initdb -D /sistemas/sat4/bdpg<br>
exit<br>
<br>
Then, I changed data_directory to /sistemas/sat4/bdpg and tried to
restart PG:<br>
service postgresql-9.6 restart<br>
STOP =&gt; OK<br>
START =&gt; FAILED<br>
<br>
I disabled se_linux.<br>
The file /var/lib/pgsql/9.6/pgstartup.log just said to see future
output in pg_log.<br>
The file data/pg_log/postgresql-Mon.log doesn't say anything about
errors.<br>
<br>
The strange is that startup arises a FAILED message, but the process
"/usr/pgsql-9.6/bin/postmaster -D /var/lib/pgsql/9.6/data" is
running (and the children logger/checkpointer/etc). But I don't get
to connect using pgAdmin3. Then, I have to kill manually postmaster
(because service script doesn't understand postmaster.pid in the new
data dir), comment data_directory to use default place, start and
connect to pgAdmin3. Then, start/stop/start/etc run fine lookup for
postmaster.pid in /var/lib/pgsql/9.6/data.<br>
</body>
</html>

Attachment Content-Type Size
unknown_filename text/html 2.0 KB

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Guyren Howe 2016-10-17 20:39:58 Immutable datastore library?
Previous Message Pavel Stehule 2016-10-17 19:30:00 Re: Generic way to test input arguments