Configuring the PostgreSQL database

to install postgres on a sientific linux (rhel6) machine as root do:
yum install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4 1.noarch.rpm
yum install postgresql94-server postgresql94-contrib
service postgresql-9.4 initdb // if this does not work, try : /usr/pgsql-9.4/bin/postgresql94-setup initdb
chkconfig postgresql-9.4 on
yum install postgresql94*

then change to user postgres:
su postgres

create the data base (replace /data/postgres/data to point to area where you want to install the data)
/usr/pgsql-9.4/bin/initdb -D /pathtoyourdatadirectory

modify the following in data/postgresql.conf
# - Connection Settings -

listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost', '*' = all
# (change requires restart) =
# For Postgresql versions later than 9
lo_compat_privileges = on

modify the line in data/pg_hba.conf to allow for remote connections:
# IPv4 remote connections:
host all g4valwriter 172.16.0.0/16 md5


then start the database:
/usr/pgsql-9.4/bin/pg_ctl -D /pathtoyourdatadirectory -l logfile start
or
/usr/pgsql-9.4/bin/postgres -D /pathtoyourdatadirectory


create the database users and database
/usr/pgsql-9.4/bin/createuser g4valreader --no-createdb --no-createrole --pwprompt
/usr/pgsql-9.4/bin/createuser g4valwriter --createdb --no-createrole --pwprompt
createdb -O g4valwriter g4validation

now restore the database from the provided dump

/usr/pgsql-9.4/bin/psql -d g4validation -U g4valwriter < pgdump


-- HansWenzel - 2016-06-07

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r3 - 2016-06-08 - IoanaIfrim
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Geant4 All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback