Add postgresql database instructions
This commit is contained in:
parent
a8ca9bfafe
commit
6552b1248f
37
README.md
37
README.md
|
|
@ -1,3 +1,38 @@
|
||||||
# Jean-Marie family website
|
# Jean-Marie family website
|
||||||
|
|
||||||
The Jean-Marie family website is a place to share information about family activities
|
The Jean-Marie family website is a place to share information about family activities
|
||||||
|
|
||||||
|
Postgresql server setup and configuration
|
||||||
|
- Create new debian container
|
||||||
|
- 2GB RAM
|
||||||
|
- 8G Storage
|
||||||
|
- link to ZFS storage pool
|
||||||
|
- Update packages
|
||||||
|
- apt update && apt upgrade -y && apt autoremove -y
|
||||||
|
- Install current postgresql source
|
||||||
|
- apt install -y postgresql-common
|
||||||
|
- /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
|
||||||
|
- apt install -y postgresql
|
||||||
|
- Move cluster to ZFS
|
||||||
|
- Stop postgresql
|
||||||
|
- systemctl stop postgresql
|
||||||
|
- Create new directory for cluster in ZFS
|
||||||
|
- from ZFS server create world writable directory
|
||||||
|
- Move current cluster to new location
|
||||||
|
- from ZFS server ensure ownership of all files in moved directory is postgres
|
||||||
|
- Point to new location
|
||||||
|
- nano /etc/postgresql/<version>/main/postgresql.conf
|
||||||
|
- data_directory = '<new location>'
|
||||||
|
- Restart postgresql
|
||||||
|
- systemctl start postgresql
|
||||||
|
- Allow external access
|
||||||
|
- Edit pg_hba.conf
|
||||||
|
- Change host all address to local network
|
||||||
|
- Edit postgresql.conf
|
||||||
|
- Change listen_adress to '*'
|
||||||
|
- Change password
|
||||||
|
- su postgres
|
||||||
|
- psql
|
||||||
|
- alter user postgres with password '<new password>';
|
||||||
|
- \q
|
||||||
|
- exit
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue