Stelo Technical Documents
Quick Start Guide to Using the Stelo Replicator Linux Container
Last Update:27 March 2024
Product: SQDR & SQDR Plus
Version: 6.11 and later
Article ID: SQV00PL076
Abstract
This Quick Start Guide describes how to install and configure the Stelo Replicator Linux Container. The container contains the following components:
- SQDR (Stelo Apply)
- SQDR Plus (Stelo Capture)
- SQDR_ODBC bundled ODBC drivers
- StarSQL/Linux ODBC driver for Db2
- Other popular ODBC drivers
- Db2 LUW (used for the SQDR control database and the SQDR Plus staging databases)
- Red Hat Linux 8.x
- OpenJDK 17
For a general overview of installing and using Stelo Replicator on Linux and an introduction to the 4 tier SQDR architecture, see the appropriate Quick Start Guide for Using SQDR Plus and Quick Start Guide to using SQDR on Linux. Using the Container simplifies the installation and configuration of Tiers 2 and 3.
- Prerequisites
- Install and Start the Docker Service
- Create Docker Volumes
- Download the Container Image from Hubspot
- Start the Container
- Connect to the Container
- License the Stelo software
- Start the SQDR Service
- Configure and Manage Replication using Browser and Windows GUI Applications
- Stopping the Container
- Updating the Docker Image
- Firewall Settings
- Password Expiration
- Docker Command Reference
Prerequisites
Linux host system
- A Linux system capable of running Docker. It does not have to be using the same Linux distribution or version as that in the container. We have successfully used the container on Ubuntu Linux, CentOS 7, Amazon Linux 2, and Oracle Linux 8.
- Storage space and disk partition
Partition Allocated storage / 100 GB /mnt/data 200 GBs /mnt/logs 100 GBs /mnt/stelo 100 GBs /var/log 16 GBs An example of the recommended disks can be seen down below
[root@stelo-full ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 253:0 0 100G 0 disk
+-vda1 253:1 0 200M 0 part /boot/efi
+-vda2 253:2 0 99.8G 0 part /
vdb 253:16 0 370K 0 disk
vdc 253:32 0 44K 0 disk
vdd 253:48 0 200G 0 disk /mnt/data
vde 253:64 0 100G 0 disk /mnt/logs
vdf 253:80 0 100G 0 disk /mnt/stelo - 8 GBs of RAM allocated per CPU core
- A static IP address. The container will use host mode networking.
- The VM should only be dedicated to the Stelo Replicator appliance
- No port conflicts: the host system should not be running any service that is using the same ports/services as the container e.g. Db2, Stelo Replicator, Derby, or any service using port 8080.
- If a firewall is enabled on the host system, it should allow incoming connections from the Windows management system, typically to ports 50000 (DRDA access to Db2 LUW control databases), 8080 & 8443 (http and https access to the SQDR Control Center), and 7737 & 7738 (grpc access to the SQDR service). See Firewall Settings for sample commands.
- Network connectivity to source and destination database systems.
A Windows system will be needed to install the following management tools
- Data Replicator Manager (drmgr)
- SQDR Configuration (sqdrconf)
- SQDR Service Properties (sqdrprops)
- StarAdmin (for binding StarSQL packages on Db2 Tier 1 source systems).
Note: StarAdmin is also supplied in the Linux container but requires a GUI interface (e.g. VNC) for the Linux system. StarAdmin is not needed if the Tier 1 source system is running a DBMS other than Db2. StarAdmin is run after creating an agent for the source system so that it can place its packages in the SQDR schema.
Install and start Docker
The following commands are to be run on a CentOS 7 VM
- Add the yum repository utilities
# sudo yum install -y yum-utils - Add the Docker repository for installation in the next step
# sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo - Install the Docker service and it's dependencies
# sudo yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y - Start and enable the Docker service
# systemctl enable docker --now - Verify that the Docker service is running
# sudo docker run hello-world
For more information on how to install Docker for other Linux distribution's, refer to Docker Install
Create Docker Volumes
- Download the create-volumes.sh script onto the Docker host.
- Run chmod +x ./create-volumes.sh to make the script executable.
- Run ./create-volumes.sh to execute the script.
- Run docker volume ls to list and ensure that the Docker volumes were created
DRIVER VOLUME NAME
local backups
local db2-data
local db2-home
local db2-logs
local sq-config
local sqplus-config
Download and run the Stelo Replicator
- Run "df -h" to verify the filesystem containing /var/lib/docker (typically the root filesystem) has sufficient free disk space to hold the Docker image (at least 6gb available).
- Run docker pull stelodata/stelo-full:latest to pull the latest Docker image from Docker Hub.
Note: To pull a specific Docker image, run docker pull stelodata/stelo-full:<version>. To see a list of available images, open https://hub.docker.com in a browser and search for stelodata. Select the Repository and then select Tags (https://hub.docker.com/r/stelodata/stelo-full/tags). - Run docker images to verify that the image was pulled onto the Docker host.
- Download the start container and the stop container onto the Docker host
- Run chmod +x stelo-container-st* to make the start and stop script executable
- Run ./stelo-container-start.sh to start the container
License the Stelo Software (within the container)
- Run docker exec -ti stelo-full bash to connect to the terminal of the container
- Identify the IP address of the host system using ip -a | grep inet
- Supply the IP address of the host to Stelo support. Once Stelo support receives the IP address, they will generate 4 licenses which will be provided on the ticket.
- Once the licenses have been received, add the licenses by running the following commands:
# cd /opt/stelo/starsql64/bin
# ./starlic-clientcfg client-key-add <license1>
# ./starlic-clientcfg client-key-add <license2>
# ./starlic-clientcfg client-key-add <license3>
# ./starlic-clientcfg client-key-add <license4>
Start the SQDR Service
Once the licenses have been added, the SQDR service will automatically start after some time has elapsed.
See Stelo Watchdog for Linux for details about the watchdog process that is used to ensure that the SQDR service is always running.
To check if the SQDR service has started, run sqdrsvc-status.
[root@3345abfac109 /]# sqdrsvc-status
4310 ? Ssl 0:19 /opt/StarQuest/sqdr/bin/sqdrsvcd -p /var/sqdr/sqdr.properties -a 0.0.0.0:7738
31713 pts/1 S+ 0:00 grep sqdrsvcd
[root@3345abfac109 /]#
Run sqdrsvc-start to start the SQDR service if it has not started already
Note that the SQDR Plus services are automatically started when you start the container; these can be controlled with /etc/init.d/sqdr-derby, sqdr-jetty, and sqdr-capagent - e.g.
cd /etc/init.d
./sqdr-derby status
./sqdr-jetty status
./sqdr-capagent status
Other parameters typically used are start, stop, and restart.
Configuration and Management
To configure and manage SQDR Plus (Tier 2), open the SQDR Control Center from any browser with network connectivity to the host system. Use the URL http://<hostname or IP of the host system>:8080/SQDRManager, enter the user SQDR (user name is case-sensitive) and the password that has been configured.
To manage SQDR (Tier 3), run Data Replicator Manager (drmgr) from a Windows system with the SQDR Data Replicator Manager package and network connectivity to the host system. You may also use SQDR Configuration (sqdrconf) and SQDR Service Properties (sqdrprops), but drmgr is the primary management application.
You can also use the SQDR PowerShell cmdlets on any system (Linux, Windows, or MacOS) with PowerShell and network connectivity to the host system.
To enable RBAC (Role Based Access Control and Auditing), use sqdrconf to enable RBAC and logging, and manage users and roles with either sqdrconf or drmgr.
Configure SQDR sources, destinations, and subscriptions
SQDR can use either ODBC data sources (DSN's) or connection strings for sources or destinations. ODBC DSN's are configured on the Linux system using a text editor to modify /etc/odbc.ini (system DSN's) or $HOME/.odbc.ini (for the user that the SQDR service is running as). Connection strings are configured in the Data Replicator Manager and in most cases will be identical to the strings used when running SQDR on a Windows system.
- Create ODBC DSN's on the Linux system if necessary
- On the Windows system, start Data Replicator Manager
- choose Add Server from the Service menu and enter the hostname or IP address of the Linux system. Leave the user and passwords field blank.
- Create sources, destinations, and subscriptions using Data Replicator Manager
- To edit advanced service properties, use SQDR Service Properties (SQDRProps) from the Windows system.
- You can connect with PowerShell from any system (Windows, Linux, MacOS) that supports PowerShell. See Automating SQDR tasks using PowerShell.
To stop the container:
Run the following commands to stop the container fully
docker stop stelo-full
docker rm stelo-full
To update the Docker image:
To update to the latest image, stop the container
docker stop stelo-full
docker rm stelo-full
and restart it with your stelo-container-start.sh script. This will automatically download the latest version if necessary.
If the update includes an update for Db2 (not typical), also run db2updtv115 -d database for each database.
Firewall Settings
- To manage the firewall on Red Hat/Oracle/etc Linux:
to check whether firewall is running:
# firewall-cmd --state
Stop the the firewalld
# systemctl stop firewalld
Disable the FirewallD service at boot time
# systemctl disable firewalld
To add an exception:
# firewall-cmd --permanent --add-port=7737/tcp
- On Ubuntu Linux, use the ufw command.
- Older Linux systems use the iptables command.
Password Expiration
In recent versions of the Stelo container, the passwords for users sqdr and db2inst1 are configured as non-expiring. However, if you encounter an expired password, do the following inside the container:
Run docker exec -ti stelo-full bash to connect to the terminal of the container.
The following command will display the current expiration characteristics of the user sqdr:
# chage -l sqdr
Run the following command to disable password expiration for the user sqdr:
# passwd -x -l sqdr
Docker Command Reference
The following commands are commonly used:
docker pull stelodata/stelo-full:latest - download the latest Docker image from Docker Hub.
docker exec -ti stelo-full bash - connect to the terminal of the container
docker logs stelo-full (or docker container logs stelo-full) - fetch the logs of a container. Some useful options to dockers logs are:
- --details - show extra details
- -t or --timestamps - include the timestamp.
- -f or --follow - continue streaming the new output from the container's STDOUT and STDERR.
docker ps -a - list running containers
docker stop stelo-full - stop the containter
docker rm stelo-full - remove a container (runtime)
docker images -a - list the names, sizes, and IMAGE ID's of images that have been downloaded (-a includes intermediate images)
docker image rm imageID - remove an image
docker system prune - remove all stopped containers, unused networks, images (both dangling and unused)
Images are typically stored in /var/lib/docker/overlay2.
For more information, see the Docker CLI Reference.
DISCLAIMER
The information in technical documents comes without any warranty or applicability for a specific purpose. The author(s) or distributor(s) will not accept responsibility for any damage incurred directly or indirectly through use of the information contained in these documents. The instructions may need to be modified to be appropriate for the hardware and software that has been installed and configured within a particular organization. The information in technical documents should be considered only as an example and may include information from various sources, including IBM, Microsoft, and other organizations.