Re: Postgres 9.4.5 Installation on Centos 7.3 - Mailing list pgsql-general

From Sachin Srivastava
Subject Re: Postgres 9.4.5 Installation on Centos 7.3
Date
Msg-id CAFzqEh+1MPn9=r17SmE1UPM6qe_+12psJ_Fwv1-yhyMMm2JymA@mail.gmail.com
Whole thread Raw
In response to Re: Postgres 9.4.5 Installation on Centos 7.3  (John R Pierce <pierce@hogranch.com>)
Responses Re: Postgres 9.4.5 Installation on Centos 7.3  (John R Pierce <pierce@hogranch.com>)
List pgsql-general
Dear John,

Thanks for update !!!

Is it not possible If my storage is mounted on /u01 and I will create the directory  within "u01/"  /postgres9.4/data. And now I want to initialize my data within this directory ("/u01/postgres9.4/data").

There is any specific reason to use only this by default directory "/var/lib/pgsql/9.4/data".

And if I want to keep (("/u01/postgres9.4/data) this directory then what should be the command of initdb because command giving the error.

(-bash-4.2$ /usr/pgsql-9.4/bin/postgresql94-setup initdb -D /u01/postgres9.4/data/


#cd

Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root  116G  664M  109G   1% /
devtmpfs                 1.8G     0  1.8G   0% /dev
tmpfs                    1.8G     0  1.8G   0% /dev/shm
tmpfs                    1.8G  8.8M  1.8G   1% /run
tmpfs                    1.8G     0  1.8G   0% /sys/fs/cgroup
/dev/mapper/centos-usr    20G  3.2G   16G  17% /usr
/dev/sda1                477M  273M  175M  62% /boot
/dev/mapper/centos-var    20G  907M   18G   5% /var
/dev/mapper/centos-u01   296G  2.4G  279G   1% /u01

cd /u01
mkdir -p /postgres9.4/data

Regards
SS


On Fri, Jan 29, 2016 at 12:34 PM, John R Pierce <pierce@hogranch.com> wrote:
On 1/28/2016 10:24 PM, Sachin Srivastava wrote:
I have initialized the database through below command through Postgres user but in my "/u01/postgres9.4/" folder pg_log folder is not available, what is the reason behind this.

-----------------------------------

-bash-4.2$ initdb -D /u01/postgres9.4/


the yum installed version defaults to putting the data directory in /var/lib/pgsql/9.4/data ... There's a bunch of reasons to stick with this, not the least thats where selinux is configured to expect it to be.

I would recommend mounting a database filesystem as /var/lib/pgsql first, then doing the following as root...

    /usr/pgsql-9.4/bin/postgresql94-setup initdb
    systemctl enable postgresql-9.4.service
    systemctl start postgresql-9.4.service

the server is now running, and will autostart when you reboot.

see http://people.planetpostgresql.org/devrim/index.php?/archives/80-Installing-and-configuring-PostgreSQL-9.3-and-9.4-on-RHEL-7.html




--
john r pierce, recycling bits in santa cruz



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

pgsql-general by date:

Previous
From: John R Pierce
Date:
Subject: Re: Postgres 9.4.5 Installation on Centos 7.3
Next
From: John R Pierce
Date:
Subject: Re: Postgres 9.4.5 Installation on Centos 7.3