Install on Docker¶
The Stelo Replicator container runs SQDR on any Linux computer that runs Docker, without installing the products, their drivers or a database yourself. Operating the container afterwards (the services, the control database, logs, ODBC drivers and updates) is in Manage the Docker container; everything else (sources, destinations, groups, monitoring) works as described in the rest of the manual.
What's in it¶
| Image | Container | Contents |
|---|---|---|
stelodata/stelo-full |
stelo-full |
Stelo Apply (the Replicator Service), Stelo Capture (Capture Agents and the SQDR Control Center), the SQDR bundled ODBC drivers, StarSQL and other ODBC drivers, and Db2 for LUW for the control database and the Stelo Capture staging databases. Based on Red Hat Enterprise Linux 8. |
stelodata/stelo-manager |
stelo-webdrm |
The Data Replicator Manager. |
Images are published on Docker Hub, tagged latest and by
version. Always run the two images at matching versions.
Prepare the host¶
- A Linux computer or virtual machine dedicated to the Stelo Replicator (any Linux, not necessarily the container's).
- Docker with the Compose plugin, installed as described in the Docker
documentation and running (
systemctl enable docker --now). - A static IP address (licenses are tied to it).
- Processor and memory as in Server sizing: at least 2 cores and 16 GB of memory (about 8 GB per core). Db2 in the container runs as Community Edition, which limits the cores and memory it uses, unless you add a Db2 license (see The control database).
- Disk space: about 100 GB for
/, 200 GB for/mnt/data, 100 GB for/mnt/logs, 100 GB for/mnt/stelo(with anotherMOUNTDIR, under it instead of/mnt), and at least 6 GB free where Docker keeps images (usually/var/lib/docker). Separate partitions keep a full data disk from filling the system disk. Mount them before the first start (step 3); otherwise the data goes to the system disk. - No other service using the container's ports (see Ports), such as Db2 or a web server on 8080.
-
The Db2 ports reserved on the host. The container publishes 50000-50010 (see Ports), which lie in the range Linux hands out to outbound connections (32768-60999 by default), so a connection can hold one just as the container starts. Reserve them, now and after a restart of the host:
sudo sysctl -w net.ipv4.ip_local_reserved_ports=50000-50010 echo "net.ipv4.ip_local_reserved_ports = 50000-50010" | sudo tee /etc/sysctl.d/90-stelo-ports.confWith another
EXPOSE_CONTROL_DB_PORTSin.env, reserve that range instead. -
Network access to your source and destination databases.
Set up the container¶
Docker Compose runs the two containers, stelo-full and stelo-webdrm, using three files:
docker-compose.ymldefines the containers, with a default for every setting.compose-start.shstarts them with the host's time zone.env.exampleis the template for an.envfile with the settings that differ from the defaults.
Run the commands as root (or with sudo).
-
Download
docker-compose.ymlandcompose-start.shinto a new directory on the host, and run the rest of the steps from that directory. For settings that differ from the defaults, also downloadenv.exampleas.env:mkdir stelo && cd stelo curl -O https://docs.stelodata.com/installation/compose/docker-compose.yml curl -O https://docs.stelodata.com/installation/compose/compose-start.sh curl -o .env https://docs.stelodata.com/installation/compose/env.example -
In
.env, set what differs from the defaults (without.env, Docker Compose uses them all):STELO_VERSION: Stelo recommends a fixed release, such as7.0, rather than the defaultlatest. Both images use it, so they always match, and they change version only when you edit this line (see Upgrade the Docker container).MOUNTDIRand the ports, if you don't want the defaults.TZ, only for a time zone other than the host's, for exampleAmerica/New_York.
Set the version in
.env, not on the command lineSTELO_VERSION=7.0 bash compose-start.shsets the version for that one command only. The next start uses.env, or the defaultlatest, again and recreates both containers on that version: an upgrade you didn't plan. -
Start the containers:
bash compose-start.sh. It creates the host directories for the volumes underMOUNTDIR, sets the host's time zone (unless.envsetsTZ) and runsdocker compose up -d, which downloads the images if they aren't on the host yet, creates the volumes and starts both containers. The first start can take a few minutes. Check that both containers areUpwithdocker ps;docker logs stelo-fullends with "First time installation. Awaiting to license...".If the start fails with
Error starting userland proxy: listen tcp4 0.0.0.0:50008: bind: address already in use(or another port from 50000-50010), an outbound connection on the host held that port: runbash compose-start.shagain, which usually works, and reserve the ports so it doesn't happen again. -
License the container. The container checks for the licenses every 30 seconds;
docker logs stelo-fullthen shows "The Stelo replicator has been licensed. Starting the replicator services...". To check the Replicator Service, rundocker exec stelo-full bash -lc 'sqdrsvc-status'. - Open the Data Replicator Manager at
http://<host>:9119and connect to the service*Default; see Connect To Service. - To capture changes with Stelo Capture, open the SQDR Control Center at
http://<host>:8080/SQDRManagerand sign in (see Sign in to the SQDR Control Center).
To stop the containers, run docker compose down in the same directory; the volumes, and your data on them, stay.
Start them again with bash compose-start.sh. docker compose up -d on its own runs them in UTC unless .env sets
TZ: Stelo Capture (Java) takes its time zone only from TZ.
Volumes¶
Everything that must survive a new container is on these volumes, which docker-compose.yml binds to directories
under MOUNTDIR on the host (/mnt by default). compose-start.sh creates the directories on the first start.
| Volume | Mounted at | Holds | Host directory |
|---|---|---|---|
sq-config |
/var/sqdr |
The Replicator Service's configuration: sqdr.properties, the license file, certificates (certs) and watchdog settings |
/mnt/stelo/sqdr |
sqplus-config |
/var/sqdrplus |
Stelo Capture configuration and Capture Agent logs | /mnt/stelo/sqdrplus |
db2-home |
/home/db2inst1 |
The Db2 instance | /mnt/data/home |
db2-data |
/data/db2 |
Db2 databases: the control database and the staging databases | /mnt/data/db2 |
db2-logs |
/logs/db2 |
Db2 transaction logs | /mnt/logs/db2 |
db2-database |
/database |
Db2's default database path (a database created without a path) and its configuration backups | /mnt/data/database |
db2-hadr |
/hadr |
Db2 HADR files | /mnt/data/hadr |
backups |
/backups |
Space for your backups | /mnt/stelo/backups |
Anything else in the container, such as files you change under /etc, is lost when the container is recreated.
.env settings¶
Every setting is optional: docker-compose.yml uses the default unless .env sets another value.
| Setting | Default | What it's for |
|---|---|---|
STELO_VERSION |
latest |
The version of both images. Set a fixed release, for example 7.0. |
STELO_FULL_IMAGE, STELO_MANAGER_IMAGE |
stelodata/stelo-full, stelodata/stelo-manager |
The images on Docker Hub. |
STELO_MANAGER_VERSION |
STELO_VERSION |
The version of the Data Replicator Manager image, if it differs. |
MOUNTDIR |
/mnt |
The host directory that holds the volumes. |
TZ |
The host's | The containers' time zone. compose-start.sh sets the host's, as timedatectl reports it (on a host without timedatectl, set TZ); docker compose up -d on its own uses UTC. |
WEBDRM_PORT |
9119 | The Data Replicator Manager in your browser. |
EXPOSE_SQDR_PORTS |
7737-7738 | The Replicator Service: 7737 for the Data Replicator Manager, 7738 for the SQDR PowerShell cmdlets. In the container, 7738 also accepts connections from other computers (on Windows, only from the server itself). |
EXPOSE_CONTROL_DB_PORTS |
50000-50010 | Db2 (the control and staging databases). |
EXPOSE_CONTROL_CENTER_PORT |
8080 | The SQDR Control Center, at http://<host>:8080/SQDRManager. |
The ports are those on the host; inside the containers, the services always use the defaults. Allow the ports you use
through the host's firewall (firewall-cmd, ufw or iptables, depending on the distribution). See also
Ports for Stelo Capture.
Other settings in docker-compose.yml:
- TCP keepalive (
sysctls): short keepalive times, so broken database connections are detected quickly; see Configuring TCP KeepAlive Parameters (Help Center). - Network: both containers are on the
stelo_netnetwork, where the service has the aliasdefault_service. That's how*Defaultin the Data Replicator Manager finds it. - Restart: both containers restart automatically with Docker.
- Logs: the Replicator Service writes its log in the container, and copies entries to the container's output
only when you turn forwarding on (see Logs). Docker keeps each container's output in at
most 5 files of 20 MB (
logging).
docker-compose.yml, env.example and compose-start.sh
# Stelo Replicator (SQDR, SQDR Plus and Stelo Data Replicator Manager) on Docker Compose.
# Every setting has a default here; set the ones that differ in a .env file next to this one, see
# .env.example. Start: bash compose-start.sh (it sets the host's time zone) Stop: docker compose down
name: stelo_compose
# docker logs keeps at most 5 files of 20 MB per container
x-logging: &logging
driver: json-file
options: { max-size: 20m, max-file: "5" }
services:
stelo-webdrm:
image: ${STELO_MANAGER_IMAGE:-stelodata/stelo-manager}:${STELO_MANAGER_VERSION:-${STELO_VERSION:-latest}}
container_name: stelo-webdrm
restart: always
logging: *logging
ports:
- ${WEBDRM_PORT:-9119}:3000
networks:
- stelo_net
stelo-full:
image: ${STELO_FULL_IMAGE:-stelodata/stelo-full}:${STELO_VERSION:-latest}
environment:
# Java takes its time zone from TZ only: the mounted /etc/localtime below leaves it on UTC
- TZ=${TZ:-UTC}
sysctls:
- net.ipv4.tcp_keepalive_time=30
- net.ipv4.tcp_keepalive_intvl=1
- net.ipv4.tcp_keepalive_probes=10
- net.ipv4.ip_local_port_range=51000 60999
hostname: stelo-full
container_name: stelo-full
privileged: true
restart: always
logging: *logging
volumes:
- sq-config:/var/sqdr
- sqplus-config:/var/sqdrplus
- backups:/backups
- db2-home:/home/db2inst1
- db2-data:/data/db2
- db2-logs:/logs/db2
- db2-database:/database # Db2's own config backups and default database path
- db2-hadr:/hadr
- /etc/localtime:/etc/localtime:ro
- /dev/log:/dev/log # the service's few startup errors go to the host's journal
ports:
- ${EXPOSE_SQDR_PORTS:-7737-7738}:7737-7738
- ${EXPOSE_CONTROL_DB_PORTS:-50000-50010}:50000-50010
- ${EXPOSE_CONTROL_CENTER_PORT:-8080}:8080
networks:
stelo_net:
aliases:
- default_service # Essential for resolving "*Default" service in WebDRM's internal network communication
# The data lives in folders under MOUNTDIR on the host, which compose-start.sh creates on the first
# start. The first six volume names are those earlier versions created with create-volumes.sh, so an
# existing installation keeps its data.
volumes:
sq-config:
name: sq-config
driver_opts: { type: none, o: bind, device: "${MOUNTDIR:-/mnt}/stelo/sqdr" }
sqplus-config:
name: sqplus-config
driver_opts: { type: none, o: bind, device: "${MOUNTDIR:-/mnt}/stelo/sqdrplus" }
backups:
name: backups
driver_opts: { type: none, o: bind, device: "${MOUNTDIR:-/mnt}/stelo/backups" }
db2-home:
name: db2-home
driver_opts: { type: none, o: bind, device: "${MOUNTDIR:-/mnt}/data/home" }
db2-data:
name: db2-data
driver_opts: { type: none, o: bind, device: "${MOUNTDIR:-/mnt}/data/db2" }
db2-logs:
name: db2-logs
driver_opts: { type: none, o: bind, device: "${MOUNTDIR:-/mnt}/logs/db2" }
db2-database:
name: db2-database
driver_opts: { type: none, o: bind, device: "${MOUNTDIR:-/mnt}/data/database" }
db2-hadr:
name: db2-hadr
driver_opts: { type: none, o: bind, device: "${MOUNTDIR:-/mnt}/data/hadr" }
networks:
stelo_net:
# Optional settings for docker-compose.yml, which has a default for each. To change any, save this file
# as .env next to it and edit the lines that differ, then run: bash compose-start.sh
# Version of both images: latest, or a release such as 6.67
STELO_VERSION=latest
STELO_FULL_IMAGE=stelodata/stelo-full
STELO_MANAGER_IMAGE=stelodata/stelo-manager
# Version of the Stelo Data Replicator Manager image when it differs (empty: STELO_VERSION)
STELO_MANAGER_VERSION=
# Host folder for the data: compose-start.sh creates its folders on the first start
MOUNTDIR=/mnt
# Time zone of the containers, e.g. America/Los_Angeles. Empty: compose-start.sh uses the host's
# (docker compose up -d on its own uses UTC)
TZ=
# Ports on the host
WEBDRM_PORT=9119
EXPOSE_SQDR_PORTS=7737-7738
EXPOSE_CONTROL_DB_PORTS=50000-50010
EXPOSE_CONTROL_CENTER_PORT=8080
#!/bin/bash
# Starts Stelo Replicator (settings in .env). Run it as root: it creates the data folders under MOUNTDIR
# on the first start. Unless .env or the shell sets TZ, the containers get the host's time zone.
MOUNTDIR=${MOUNTDIR:-$(sed -n 's/^MOUNTDIR=//p' .env 2>/dev/null | tail -n 1 | tr -d "\"'")}
MOUNTDIR=${MOUNTDIR:-/mnt}
mkdir -p "$MOUNTDIR"/stelo/sqdr "$MOUNTDIR"/stelo/sqdrplus "$MOUNTDIR"/stelo/backups \
"$MOUNTDIR"/data/home "$MOUNTDIR"/data/db2 "$MOUNTDIR"/logs/db2 \
"$MOUNTDIR"/data/database "$MOUNTDIR"/data/hadr \
|| { echo "Could not create the data folders under $MOUNTDIR: run compose-start.sh as root" >&2; exit 1; }
if [ -z "${TZ:-}" ] && ! grep -qs '^TZ=.' .env; then
TZ=$(timedatectl show --property=Timezone 2>/dev/null | awk -F= '{print $2}')
if [ -n "$TZ" ]; then export TZ; else unset TZ; fi
fi
docker compose up -d
Stelo Capture in the container¶
In the stelo-full container, SQDR and Db2 are already installed and configured. The differences from
Windows:
- The SQDR Control Center is at
http://<host>:8080/SQDRManager. The default Docker Compose setup publishes port 8080 only, not 8443. - The services are Linux services, controlled from a login shell with
/etc/init.d/sqdr-derby(the SQDR Plus Derby database),/etc/init.d/sqdr-jetty(the SQDR Control Center) and/etc/init.d/sqdr-capagent(the Launch Agent and Capture Agents). See Start and stop the services. - The Stelo Capture configuration and logs are in
/var/sqdrplus(for example/var/sqdrplus/conf/agt<N>/capture_agent0.log), on thesqplus-configvolume. - To upgrade, you run a newer image (see Upgrade the Docker container).
Next steps¶
- Data Replicator Manager: finding your way around, and connecting to the service.
- Databases: add your sources and destinations. Use connection strings rather than data sources; see ODBC drivers in the container.
- SQDR Control Center and Add a Capture Agent: capture changes with Stelo Capture.
- Manage the Docker container