Re: How to config start/stop scripts in a different data dir for CentOS7/systemctl/PG9.6

Поиск
Список
Период
Сортировка
От Edilmar LISTAS
Тема Re: How to config start/stop scripts in a different data dir for CentOS7/systemctl/PG9.6
Дата
Msg-id eebb3a83-3d1c-76fc-e71b-9e06565616b0@intersite.com.br
обсуждение исходный текст
Ответ на How to config start/stop scripts in a different data dir for CentOS7/systemctl/PG9.6  (Edilmar LISTAS <edilista@intersite.com.br>)
Ответы Re: How to config start/stop scripts in a different data dir for CentOS7/systemctl/PG9.6
Re: [GENERAL] How to config start/stop scripts in a different datadir for CentOS7/systemctl/PG9.6
Список pgsql-general
I decided to use the pg_ctl to start/stop, I didn't find a way to
configure systemctl script.

Em 05-12-2016 15:21, Edilmar LISTAS escreveu:
> Hi,
>
> I do these steps to config Postgresql 9.6 in CentOS 6.x using a
> different data directory:
> yum -y install postgresql96-server postgresql96-contrib pg_top96
> chkconfig postgresql-9.6 on
> service postgresql-9.6 initdb
> service postgresql-9.6 start
> echo "localhost:5432:*:postgres:mypass" > ~/.pgpass
> chmod 0600 ~/.pgpass
> echo "localhost:5432:*:postgres:mypass" > ~postgres/.pgpass
> chmod 0600 ~postgres/.pgpass
> chown postgres.postgres ~postgres/.pgpass
> su - postgres
> psql -U postgres -c "ALTER USER postgres WITH PASSWORD 'mypass';"
> exit
> #------------------------------------- => my data dir is
> /sistemas/sat4/bdpg
> service postgresql-9.6 stop
> cd /etc/rc.d/init.d
> ln postgresql-9.6 pgsat
> cd /etc/sysconfig/pgsql
> echo "PGDATA=/sistemas/sat4/bdpg" > pgsat
> mkdir /sistemas/sat4/bdpg
> chown postgres.postgres /sistemas/sat4/bdpg
> chmod 700 /sistemas/sat4/bdpg
> su - postgres
> /usr/pgsql-9.6/bin/initdb -D /sistemas/sat4/bdpg
> /usr/pgsql-9.6/bin/pg_ctl -D /sistemas/sat4/bdpg -l logfile start
> sleep 5000
> psql -U postgres -c "ALTER USER postgres WITH PASSWORD 'mypass';"
> exit
> #-------------------------------------
> su - postgres
> /usr/pgsql-9.6/bin/pg_ctl -D /sistemas/sat4/bdpg -l logfile stop
> exit
> service pgsat start
> chkconfig --add pgsat
> chkconfig pgsat on
> chkconfig postgresql-9.6 off
> #-------------------------------------
>
> But now CentOS7 uses the new systemd service control system.
> I only get to start PG manually like this:
> su - postgres
> /usr/pgsql-9.6/bin/pg_ctl -D /sistemas/sat4/bdpg -l logfile start
>
>
>
>
>



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

Предыдущее
От: Rich Shepard
Дата:
Сообщение: Re: PDF files: to store in database or not
Следующее
От: Julien Rouhaud
Дата:
Сообщение: Re: How to config start/stop scripts in a different data dir for CentOS7/systemctl/PG9.6