...
change postgres.conf to enable networking
create a replication user
allow remote access in pg_hba.conf
Infonote |
---|
This is the database server in our main facility in - e.g. Munich |
Code Block |
---|
initdb -D /var/lib/postgresql/daselement-munich |
...
Create a replication user
...
Allow remote access in pg_hba.conf
add line to allow access for the replication user
Code Block |
---|
vim /var/lib/postgresql/daselement-datamunich/pg_hba.conf # TYPE DATABASE USER CIDR-ADDRESS METHOD # IPv4 local connections host all repuser localhost trust # restart the Postgres server because of changes in the config files pg_ctl -D /var/lib/postgresql/daselement-munich restart |
...
The primary system is now ready. Let’s move on to the replica system!
Create replica database server
Note |
---|
Now we are at a clean database server in a different facility. Eanother facility - e.g. Vancouver |
Code Block |
---|
# create the replica Postgres server # this command pg_basebackup copies the files from the primary database pg_basebackup -h db-munich -U repuser --checkpoint=fast -D /var/lib/postgresql/daselement-munich-replica/ -R --slot=daselement_munich -C --port 5432 |
In the replica directory you will find these two files:
| this file defines that the database that it is a replica |
| contains information to connect to the primary server |
Now start the replica server
Code Block |
---|
# start the Postgres server pg_ctl -D /var/lib/postgresql/daselement-munich-replica |
Configure library
In the other facility copy and import the library (.lib) from main facility.
Make sure to :
update the library root
update the database information
lock the library (Lock Library option) to prevent editing and ingesting of new elements!
An option is to setup the main facility to automatically sync the Proxy Files to the other facilities when an element is ingested. This can be done with an additional transcoding task and a custom command task.
Code Block |
---|
# Example:
your-sync-tool <paths.proxy.directory> /path/to/other/facility
your-sync-tool <paths.filmstrip.directory> /path/to/other/facility
your-sync-tool <paths.thumbnail.directory> /path/to/other/facility |
Info |
---|
To reduce disk space and network traffic only sync the high-res source files when needed |
Advanced Setup
If you want to take it a step further it’s a good idea to look into these topics:
...