Changes between Version 4 and Version 5 of Sensors/Grimm/settingUpPostgresDB


Ignore:
Timestamp:
Oct 8, 2014, 11:59:01 AM (10 years ago)
Author:
knpa
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Sensors/Grimm/settingUpPostgresDB

    v4 v5  
    44You will need sudo on that machine.
    55
    6 - install postgres:
    7 sudo yum install postgresql
     6- install postgres: [[BR]]
     7sudo yum install postgresql[[BR]]
    88sudo yum install postgresql-server
    99
    1010postgres tends to install its files under the username postgres. You should therefore create and use this user for the steps below. Specifically you need access to /var/run/postgresql/
    1111
    12 - make a directory for posgres data:
     12- make a directory for posgres data: [[BR]]
    1313mkdir -p /usr/local/pgsql/data
    1414
    15 - Create a database cluster (file structure)
     15- Create a database cluster (file structure) [[BR]]
    1616initdb -D /usr/local/pgsql/data
    1717
    18 - Initialise the server (I think I only need to do the second of these things)
    19 postmaster -D /usr/local/pgsql/data >logfile 2>&1 &
     18- Initialise the server (I think I only need to do the second of these things) [[BR]]
     19postmaster -D /usr/local/pgsql/data >logfile 2>&1 &[[BR]]
    2020postgres -D /usr/local/pgsql/data &
    2121
    22 - create database:
     22- create database: [[BR]]
    2323createdb <db_name>
    2424
    25 - To restart the server (after shutting down for example)
    26 su - postgres
     25- To restart the server (after shutting down for example)[[BR]]
     26su - postgres[[BR]]
    2727pg_ctl start -D /usr/local/pgsql/data       
    2828
     
    3434There are two main config files, both in the above dir.
    3535
    36 pg_hba.conf (the client authentication configuration file)
     36pg_hba.conf (the client authentication configuration file)[[BR]]
    3737postgresql.conf (all sorts of things)
    3838
    3939You need to explicity allow for external hosts to connect to the database:
    4040
    41 pg_hba.conf:
    42 # IPv4 local connections:
     41pg_hba.conf:[[BR]]
     42# IPv4 local connections:[[BR]]
    4343host    all             all             192.171.161.1/24         trust
    4444
    45 postgresql.conf
     45postgresql.conf[[BR]]
    4646listen_addresses = '*'
    4747
    48 pg_ctl is a utility for monitoring and controlling a posgreSQL server
    49 Check server status:
    50 pg_ctl status -D /usr/local/pgsql/data       
     48pg_ctl is a utility for monitoring and controlling a posgreSQL server[[BR]]
     49Check server status:[[BR]]
     50pg_ctl status -D /usr/local/pgsql/data[[BR]]       
    5151pg_ctl: server is running (PID: 29763)