Data source: rsync
As the first step, you need to set up a machine for DBLab Engine instance. See the guide.
Configuration
Jobs
In order to set up DBLab Engine to automatically get the data from database using rsync you need to use following jobs:
Options
Copy the example configuration file config.example.physical_generic.yml
from the Database Lab repository to ~/.dblab/engine/configs/server.yml
and update the following options:
- Set secure
server:verificationToken
, it will be used to authorize API requests to the Engine - Set connection options in
physicalRestore:options:envs
:PGUSER
: database user namePGPASSWORD
: database master passwordPGHOST
: database server host
- Set PostgreSQL commands in
physicalRestore:options:customTool
:command
:rsync --archive \
--password-file=${RSYNC_PWD_FILE} \
rsync://${RSYNC_USER}@${WAL_SERVER}:/rsync/${CLUSTER}/${WALCH:0:8}/${WPNUM:4:2}/${WPNUM}/* \
${PGDATA}/temp_wal/ 2>/dev/null`restore_command
:TBD
- Set proper version in Postgres Docker image tag (change the images itself only if you know what are you doing):
databaseContainer:dockerImage
pg_basebackup -D - -Ft -X
Run DBLab Engine
sudo docker run \
--name dblab_server \
--label dblab_control \
--privileged \
--publish 127.0.0.1:2345:2345 \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume /var/lib/dblab:/var/lib/dblab/:rshared \
--volume ~/.dblab/engine/configs:/home/dblab/configs \
--volume ~/.dblab/engine/meta:/home/dblab/meta \
--volume ~/.dblab/engine/logs:/home/dblab/logs \
--volume /sys/kernel/debug:/sys/kernel/debug:rw \
--volume /lib/modules:/lib/modules:ro \
--volume /proc:/host_proc:ro \
--env DOCKER_API_VERSION=1.39 \
--detach \
--restart on-failure \
postgresai/dblab-server:4.0.1
Parameter --publish 127.0.0.1:2345:2345
means that only local connections will be allowed.
To allow external connections, consider either using additional software such as NGINX or Envoy or changing this parameter. Removing the host/IP part (--publish 2345:2345
) allows listening to all available network interfaces.
See more details in the official Docker command-line reference.
Restart in the case of failure
TBD
This page is unfinished. Reach out to the PostgresAI team to learn more.