Commit 510d9ea8 authored by einsiedlerkrebs's avatar einsiedlerkrebs
Browse files

psql: add configuration and intiation process

parent e3ebd359
Pipeline #18 failed with stages
Configuration
#############
TODO: timezone to UTC+1 ?
::
$ cd /opt
$ git clone git@belgiumair@gitserveryounameit.be
$ cd belgiumair
$ cp -r conf.d/etc/* /etc/
$ mkdir -p /var/data/luftdaten/{influxdb,pgdata}
Nginx
=====
......@@ -47,3 +50,39 @@ Test Influxdb datasource
Database: _internal
Grafana
=======
::
$ systemctl start grafana
$ semanage port -a -p tcp -t http_port_t 3000
Postgres
========
::
$ chown -R postgres:postgres /var/data/luftdaten/pgdata
# change the PGDATA environment to `/var/data/luftdaten/pgdata`
$ cp /usr/lib/systemd/system/postgresql-11.service /etc/systemd/system/
$ sed -i 's@PGDATA=/var/lib/pgsql/11/data/@PGDATA=/var/data/luftdaten/pgdata/@g' /etc/systemd/system/postgresql-11.service
$ systemctl daemon-reload
$ cd /var/data/luftdaten/pgdata
$ export PGSETUP_INITDB_OPTIONS="--pgdata=/var/data/luftdaten/pgdata --encoding=UTF8" PGSETUP_DEBUG=1
$ /usr/pgsql-11/bin/postgresql-11-setup initdb
# Command returns error, but log shows success:
$ cat /var/lib/pgsql/11/initdb.log
$ systemctl start postgresql-11.service
# trust local connections
$ sed -i 's@127.0.0.1/32 ident@127.0.0.1/32\t\ttrust@g' /var/data/luftdaten/pgdata/pg_hba.conf
$ systemctl start postgresql-11.service
::
$ su postgres
$ createdb luftdaten
$ psql luftdaten
luftdaten=# create extension postgis;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment