Re: Problem changing default data_directory in PG 9.6 + CentOS6

Поиск
Список
Период
Сортировка
От Devrim Gündüz
Тема Re: Problem changing default data_directory in PG 9.6 + CentOS6
Дата
Msg-id 1476820412.7720.10.camel@gunduz.org
обсуждение исходный текст
Ответ на Problem changing default data_directory in PG 9.6 + CentOS6  (Edilmar LISTAS <edilista@intersite.com.br>)
Ответы Re: Problem changing default data_directory in PG 9.6 + CentOS6  (Edilmar LISTAS <edilista@intersite.com.br>)
Список pgsql-general
Hi,

On Mon, 2016-10-17 at 17:38 -0300, Edilmar LISTAS wrote:
> I have an env running a changed data_directory fine in a devel machine PG 9.4
> using Fedora23. 
> Now, I have a server machine with CentOS where I downloaded the RPMs from
> repo https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/p
> gdg-centos96-9.6-3.noarch.rpm.
> All the configs run fine if I doesn't change the default data_directory. But
> I need to use the path /sistemas/sat4/bdpg.
>
> I did these commands:
>
> mkdir /sistemas/sat4/bdpg
> chown postgres /sistemas/sat4/bdpg
> chmod 700 /sistemas/sat4/bdpg
> su - postgres 
> /usr/pgsql-9.6/bin/initdb -D /sistemas/sat4/bdpg
> exit
>
> Then, I changed data_directory to /sistemas/sat4/bdpg and tried to restart
> PG:
> service postgresql-9.6 restart
> STOP => OK
> START => FAILED

On CentOS, the appropriate way to do this is described in README file shipped
with the RPMs. Related part is:

===========================================================================
As an example, let us create a secondary postmaster called, creatively enough,
'secondary'.  Here are the steps:
1.)     create a hard link in /etc/rc.d/init.d (or equivalent location)
        to postgresql-9.6 named 'secondary-9.6' : ln postgresql
secondary   Pick
        a name not already used in /etc/rc.d/init.d!
2.)     create a file in /etc/sysconfig/pgsql named secondary.  This file is
        a shell script -- typically you would define PGDATA, and PGOPTS
        here.  Since $PGDATA/postgresql.conf will override many of these
        settings, except PGDATA, you might be surprised on startup.
3.)     create the target PGDATA.
4.)     Initdb the targe PGDATA as documented in the main documentation.
        Automatic initdb may or may not work for you, so a manual one is
        preferred.  This must be done as user 'postgres'
5.)     Edit postgresql.conf to change the port, address, tcpip settings, etc.
6.)     Start the postmaster with 'service secondary-9.6 start'.
============================================================================

Regards,
--
Devrim GÜNDÜZ
EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Melvin Davidson
Дата:
Сообщение: Re: Dump all the indexes/constraints/roles
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: tablesample performance