Using a Synology as network attached Share Storage is the way for small and medium production companies for working together. With some hacks you can speed up your installation to nearly 1000 MB/s per connected Client. But in the past it has always been a mess to install a Postgres Database Server direct on the system, because the Synology DSM is using the Port 5432 by itself. I tried a lot with virtual machine workflows but you always have to maintain more systems than you want. With this target in my mind I tried to get a solution by using Docker. This is running native on the system and will bring you the best performance. For the final result I used „macvlan“ as network driver to get an (host separated) own network address for the container.
Essential items list
Things you have to know before you try it yourself.
– one free IP address where you put your Postgres Server
– your network config
– SSH access to your Synology (turn it on in your System Settings)
– interface network name used by your Synology to connect your home network
my Settings
installed Docker folder: /volume1/docker/
IP Network: 10.210.0.0/20 GW 10.210.0.1
IP for DaVinci Resolve Database Server: 10.210.2.199
Hardware interface my Synology is connected to the home network: ovs_eth1
Installation:
First Step – create folder via GUI
First create following folders in your Shared folder „docker“
– DB_DavinciResolve
and the subfolder
– db in the folder DB_DavinciResolve
– Backup in the folder DB_DavinciResolve
It should look like this if you look in the folder structure via SSH
/volume1/docker/DB_DavinciResolve
/volume1/docker/DB_DavinciResolve/db
/volume1/docker/DB_DavinciResolve/Backup
Second Step – accessing the system via SSH
Enable SSH in WebGUI
Login with your Admin into the DSM Management GUI and open the Control Panel, click on „Terminal & SNMP“ and enable SSH.
Login via SSH
Login via SSH (if you use a MAC just open the Terminal (Applications > Utilitys > Terminal), if you use a Windows device download Putty) by typing
ssh "your_username"@"ipaddress_of_yournas"
and press enter, then enter your password (you will not see the digits, just type it and press enter)
Now we should get the highest privileges we can get in your Synology by typing following
sudo -s
after pressing enter you will be asked for your password. Now be careful you are the root of the system and you are able to destroy everything ;). It should look like this:
Third Step – find you network interface name
type now, and press enter
ip addr
you will get a long list (depending how many interfaces you use), search for the ip range you use in your network and when you find it mark down the name of the interface. In my case I am using the 10.210.2.33 address so my interface name is ova_eth1.
Fourth Step – create docker-compose file
We now want to go to our in the first step created folder DB_DavinciResolve and we can do this by typing following in the terminal window:
cd /volume1/docker/DB_DavinciResolve
Now you can create a docker-compose.yml file by typing
vi docker-compose.yml
Press the key „i“ (for insert) and copy following text into the file
version: '3.6'
services:
postgres:
container_name: DavinciResolve_Schaupper_at
image: postgres:9.5.4
restart: always
ports:
- "5432:5432"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: DaVinci
volumes:
- /volume1/docker/DB_DavinciResolve/db:/var/lib/postgresql/data
networks:
intranet:
ipv4_address: 10.210.2.199
networks:
intranet:
name: intranet
driver: macvlan
driver_opts:
parent: ovs_eth1
ipam:
config:
- subnet: "10.210.0.0/20"
gateway: "10.210.0.1"
Change following settings by navigating with the arrow keys
– ipv4_address: 10.210.2.199
– subnet: „10.210.0.0/20“
– gateway: „10.210.0.1“
– parent: ovs_eth1
with your parameters
Press „ESC“ and write „wq“ and press Enter
Fifth Step – create Container
Now start your container with:
docker-compose up -d
and you are done. You can logout from the terminal session by closing the window and check in your Docker APP in the Synology DSM GUI if everything is running.
Now try and connect with your DaVinci Resolve Client Application by opening the Projekt Manager and create a new Database
Type in the name of the database and use the same ip address you have chosen before
Seventh Step – BACKUP YOUR DATABASE
I like to use „Task Scheduler“ in the Control Panel to schedule my backups.
docker exec DavinciResolve_Schaupper_at pg_dumpall -U postgres > /volume1/docker/DB_DavinciResolve/Backup/backup.sql
tar -zcvf /volume1/docker/DB_DavinciResolve/Backup/$(date +%Y%m%d).tar.gz /volume1/docker/DB_DavinciResolve/Backup/backup.sql
rm /volume1/docker/DB_DavinciResolve/Backup/backup.sql
If you get following error:
Creating DavinciResolve_Schaupper_at ... error
ERROR: for DavinciResolve_Schaupper_at Cannot start service postgres: Bind mount failed: '/volume1/docker/DB_DavinciResolve/db' does not exists
ERROR: for postgres Cannot start service postgres: Bind mount failed: '/volume1/docker/DB_DavinciResolve/db' does not exists
ERROR: Encountered errors while bringing up the project.
you have to create the folder db in the DB_DavinciResolve folder
11 comments for “Synology DaVinci Resolve shared Database”