Postgres 9.4.5 Installation on Centos 7.3

Started by Sachin Srivastavaabout 10 years ago7 messagesgeneral
Jump to latest
#1Sachin Srivastava
ssr.teleatlas@gmail.com

Hi,

I have to install Postgres 9.4.5 On Centos 7.2, what is the best way to
install, please suggest:

Through ./configure and make

OR

Through below link:

https://wiki.postgresql.org/wiki/YUM_Installation#Configure_your_YUM_repository

Please provide, if any other installation document.

For Postgres 9.1 version, I did postgres installation through run file
like (postgresql-9.1.2-1-linux-x64.run), for 9.4 version there is no run
file right now.

Regards
SS

#2Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Sachin Srivastava (#1)
Re: Postgres 9.4.5 Installation on Centos 7.3

On 01/28/2016 08:45 PM, Sachin Srivastava wrote:

Hi,

I have to install Postgres 9.4.5 On Centos 7.2, what is the best way to
install, please suggest:

Through ./configure and make

OR

Through below link:

https://wiki.postgresql.org/wiki/YUM_Installation#Configure_your_YUM_repository

Please provide, if any other installation document.

I would say using the Yum repo. If you do the compile from source you
will need to make sure you have a development tool chain in place as
well as --devel libraries for the various components.

For Postgres 9.1 version, I did postgres installation through run file
like (postgresql-9.1.2-1-linux-x64.run), for 9.4 version there is no
run file right now.

Regards
SS

--
Adrian Klaver
adrian.klaver@aklaver.com

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

#3Sachin Srivastava
ssr.teleatlas@gmail.com
In reply to: Adrian Klaver (#2)
Re: Postgres 9.4.5 Installation on Centos 7.3

Dear Adrian,

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 files belonging to this database system will be owned by user
"postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
fixing permissions on existing directory /u01/postgres9.4 ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 32MB
creating configuration files ... ok
creating template1 database in /u01/postgres9.4/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating collations ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
loading PL/pgSQL server-side language ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
Success. You can now start the database server using:
postgres -D /u01/postgres9.4
or
pg_ctl -D /u01/postgres9.4 -l logfile start
-bash-4.2$

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

[root@gdi-test postgres9.4]# pwd
/u01/postgres9.4
[root@gdi-test postgres9.4]# ls -ltr
total 108
drwx------ 2 postgres postgres 4096 Jan 29 11:39 pg_twophase
drwx------ 2 postgres postgres 4096 Jan 29 11:39 pg_tblspc
drwx------ 2 postgres postgres 4096 Jan 29 11:39 pg_stat_tmp
drwx------ 2 postgres postgres 4096 Jan 29 11:39 pg_stat
drwx------ 2 postgres postgres 4096 Jan 29 11:39 pg_snapshots
drwx------ 2 postgres postgres 4096 Jan 29 11:39 pg_serial
drwx------ 2 postgres postgres 4096 Jan 29 11:39 pg_replslot
drwx------ 4 postgres postgres 4096 Jan 29 11:39 pg_multixact
drwx------ 2 postgres postgres 4096 Jan 29 11:39 pg_dynshmem
-rw------- 1 postgres postgres 4 Jan 29 11:39 PG_VERSION
drwx------ 4 postgres postgres 4096 Jan 29 11:39 pg_logical
-rw------- 1 postgres postgres 21307 Jan 29 11:39 postgresql.conf
-rw------- 1 postgres postgres 88 Jan 29 11:39 postgresql.auto.conf
-rw------- 1 postgres postgres 1636 Jan 29 11:39 pg_ident.conf
-rw------- 1 postgres postgres 4468 Jan 29 11:39 pg_hba.conf
drwx------ 3 postgres postgres 4096 Jan 29 11:39 pg_xlog
drwx------ 2 postgres postgres 4096 Jan 29 11:39 pg_subtrans
drwx------ 2 postgres postgres 4096 Jan 29 11:39 pg_clog
drwx------ 2 postgres postgres 4096 Jan 29 11:39 pg_notify
drwx------ 2 postgres postgres 4096 Jan 29 11:39 global
drwx------ 5 postgres postgres 4096 Jan 29 11:39 base
[root@gdi-test postgres9.4]#

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

Regards
SS

On Fri, Jan 29, 2016 at 11:33 AM, Adrian Klaver <adrian.klaver@aklaver.com>
wrote:

Show quoted text

On 01/28/2016 08:45 PM, Sachin Srivastava wrote:

Hi,

I have to install Postgres 9.4.5 On Centos 7.2, what is the best way to
install, please suggest:

Through ./configure and make

OR

Through below link:

https://wiki.postgresql.org/wiki/YUM_Installation#Configure_your_YUM_repository

Please provide, if any other installation document.

I would say using the Yum repo. If you do the compile from source you will
need to make sure you have a development tool chain in place as well as
--devel libraries for the various components.

For Postgres 9.1 version, I did postgres installation through run file
like (postgresql-9.1.2-1-linux-x64.run), for 9.4 version there is no
run file right now.

Regards
SS

--
Adrian Klaver
adrian.klaver@aklaver.com

#4John R Pierce
pierce@hogranch.com
In reply to: Sachin Srivastava (#3)
Re: Postgres 9.4.5 Installation on Centos 7.3

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

#5Sachin Srivastava
ssr.teleatlas@gmail.com
In reply to: John R Pierce (#4)
Re: Postgres 9.4.5 Installation on Centos 7.3

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:

Show quoted text

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

#6John R Pierce
pierce@hogranch.com
In reply to: Sachin Srivastava (#5)
Re: Postgres 9.4.5 Installation on Centos 7.3

On 1/28/2016 11:21 PM, Sachin Srivastava wrote:

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".

you will need to mess with selinux tags to get it to cooperate.

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.

create file /etc/sysconfig/pgsql/postgresql-9.4 and add the line
PGDATA=/u01/postgres9.4/data then run the postgreql94-setup initdb,
it will pick up this setting and use it, as will the systemd service
scripts.

--
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

#7Sachin Srivastava
ssr.teleatlas@gmail.com
In reply to: John R Pierce (#6)
Re: Postgres 9.4.5 Installation on Centos 7.3

Here selinux is already disabled on server and I am installing postgres on
Centos 7.2.

On Fri, Jan 29, 2016 at 1:12 PM, John R Pierce <pierce@hogranch.com> wrote:

Show quoted text

On 1/28/2016 11:21 PM, Sachin Srivastava wrote:

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".

you will need to mess with selinux tags to get it to cooperate.

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.

create file /etc/sysconfig/pgsql/postgresql-9.4 and add the line
PGDATA=/u01/postgres9.4/data then run the postgreql94-setup initdb, it
will pick up this setting and use it, as will the systemd service scripts.

--
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