1. RED TV Deployment Guide¶
This document describes the deployment, installation, upgrade, and patching processes for the Technical Version (TV) of the RED framework on target host environments. The TV represents the version of the RED framework itself, including its binary files, orchestrator utilities, system service configurations, and database schema structures.
The rollout process transitions the system from a prepackaged self-extracting installer (red_install_<version> or red_patch_<from_version>_to_<to_version>) up to the final execution of the database schema installer utility.
1.1. Overview of TV Deployment¶
The installation, upgrade, and patching of the TV is split into three sequential phases:
Target Host Installation (Root Level): Deploying the self-extracting full installer executable (
red_install_<version>) or self-extracting patch installer executable (red_patch_<from_version>_to_<to_version>, e.g.red_patch_2.0.0_to_2.0.1) on the target host to install system-wide configurations, systemd services, binary templates, or targeted hotfixes.Environment Instance Setup (Instance Level): Cloning the seed template to initialise a new environment instance, or upgrading an existing environment instance with
redenv_upgradeto apply new or patched binaries and scripts.Database Schema Installation (Database Level): Executing the database schema setup (
redtvctl install) to perform a fresh database installation, apply incremental database upgrades, or execute patch-specific schema updates.
1.2. Installation, Upgrade, and Patch Methods¶
The deployment process handles initial (fresh) full installations, incremental version upgrades, and targeted patch deployments. The system automatically detects the state of the target host and databases to apply the appropriate logic.
Deployment Stage |
Fresh (Full) Installation |
Incremental Upgrade |
Patch Method |
|---|---|---|---|
Delivery Artefact |
Self-extracting full installer: |
Self-extracting full installer: |
Self-extracting patch installer: |
Host Installation |
Installs base binaries and host configurations from scratch. Sets global version in |
Scans |
Applies targeted updates to framework binaries, libraries, and |
Instance Setup |
Creates a new environment instance using |
Upgrades an existing environment instance using |
Propagates patched binaries and scripts from the updated |
Database Schema |
Initialises schemas, tables, and metadata repository from scratch via |
Executes incremental database SQL scripts ( |
Executes patch SQL scripts and re-registers modified routines/views via |
1.3. Phase 1: Target Host Installation¶
The host installation is performed by the system administrator at the root level of the target server. It is recommended to perform this step directly as the root user (e.g. via sudo -i), which removes the need to prefix commands with sudo.
1.3.1. Executing the Full Host Installer¶
The self-extracting full installer script (typically named red_install_<version>) must be transferred to the target server (e.g. into the /tmp directory) and executed:
# Switch to root user
sudo -i
# Execute the full installer
/tmp/red_install_<version>
1.3.2. Executing the Self-Extracting Patch Installer¶
When applying a hotfix or targeted update between revisions, the administrator receives a self-extracting patch installer named according to the transition range: red_patch_<from_version>_to_<to_version> (for example, red_patch_2.0.0_to_2.0.1). Transfer the patch executable to the target server and execute it as root:
# Switch to root user
sudo -i
# Execute the patch installer
/tmp/red_patch_2.0.0_to_2.0.1
The patch installer verifies that the host environment has the exact <from_version> installed before extracting the updated binaries, libraries, and .seed templates to update the installation to <to_version>.
1.3.3. Host Installation Internal Process¶
When the installer runs (full installer or patch installer), it performs the following sequential actions:
Version Verification:
The installer reads the current host version from
/etc/red. If this file is missing, it assumes a default baseline version of1.9.0.For full installations and upgrades, it compares the current version with the target version packaged in the installer. If the current host version matches the target version, the installer exits safely without making changes. If the current host version is newer than the target version, the installation is aborted.
For patch installers (
red_patch_<from_version>_to_<to_version>), it verifies that the host TV version matches<from_version>exactly before proceeding.
Incremental Upgrade and Patch Script Execution:
The installer extracts its payload archive to a temporary directory.
In upgrade mode, it scans the extracted
/app/redsys/lib/upgrade/directory for upgrade subdirectories. These subdirectories are named after their target version (e.g.lib/upgrade/1.10.0/upgrade.sh). The installer identifies all upgrade scripts within the version rangecurrent_version < version <= target_version, sorts them in ascending order using natural version sorting (equivalent tosort -V), and executes each script sequentially.In patch mode, it executes patch-specific host update scripts to update affected components without re-running full version migration sequences.
If any script returns a non-zero exit code, the installation aborts immediately.
System Files Extraction:
For full installers, it extracts the core system directories (
/app/redsys,/app/redftp, and/app/exasol) to the root/directory.For patch installers, only the modified framework files, libraries, and
.seedtemplates under/app/redsysare updated.Specific user dotfiles (such as
.bashrcand.bash_profilefiles under/app/redsysand/app/exasol) are explicitly excluded during extraction to prevent overwriting custom user modifications.
Host Configuration Deployment:
The installer copies system-wide configuration files from
/app/redsys/etc/root/to the host system/etcdirectory. It updates file ownership toroot:rootand configures the following secure permissions:Sudoers Rules: Copies files from
/app/redsys/etc/root/etc/sudoers.d/(such as97-redappand98-red) to/etc/sudoers.d/with0440permissions.SSH Configurations: Copies files from
/app/redsys/etc/root/etc/ssh/sshd_config.d/(such as98-red.conf) to/etc/ssh/sshd_config.d/with0600permissions.Systemd Unit Files: Copies
/app/redsys/etc/root/etc/systemd/system/redsys.serviceto/etc/systemd/system/with0644permissions.
Systemd Service Registration & Version Update:
The installation automatically configures the
systemctlservice for the RED framework. It registers and enables theredsys.servicesystemd unit on the host to ensure the framework starts automatically on boot.For full/upgrade installations, it updates the global version file
/etc/redwith the target version. For patch releases, it updates/etc/redto the target<to_version>.
Exasol Language Container Deployment:
The installer inspects
/app/exasol/etc/for Exasol client configuration files (confd_*.cfg).If exactly one configuration is found, it automatically executes
clconfigas theexasoluser to deploy and update the language containers. If multiple exist, the administrator is prompted to run the update manually.
1.3.4. System Users and Directory Structure¶
During a full (fresh) host installation, the installer creates dedicated system users with fixed UIDs and GIDs to isolate services and ensure consistent file ownership across the environment. The deployed users include:
redsysuser: Owns the RED framework core installation, orchestration tools, and Python environments. (UID1070, primary groupredsysGID1070, supplementary groupredftp)exasoluser: Owns the complete Exasol client environment and the cluster automation framework. (UID1050, primary groupexasolGID1050)redftpgroup: Used to manage secure file transfers across environments. Theredftpgroup uses GID1200. Individual sFTP users are bound to the UID range1200 – 1299and share this group.
The installer extracts these components into a structured directory tree under /app:
/app/redsys/: Contains the RED framework executables, library seed templates, and environment instances./app/exasol/: Contains the Exasol client tools, connection libraries, and automation utilities./app/redftp/: Contains the sFTP environment directories where external data is ingested.
For a detailed breakdown of the internal RED directory tree, refer to the Directory Structure section in the RED-PSS Guide.
1.4. Phase 2: Environment Instance Setup¶
Once the host binaries and system-level configurations are deployed, the environment instances on the machine must be created, upgraded, or patched to incorporate the updates.
Important
Before running environment management commands, always switch to the redsys user context (e.g. via sudo -iu redsys). Since the redsys profile adds the management tools to the user’s PATH, absolute paths are not required.
Warning
Always run environment management commands from the host shell. Do not run these commands while inside an active environment subshell context (i.e. make sure you are not in a redenv context).
1.4.1. Upgrading or Patching an Existing Environment Instance¶
To update an existing environment instance following a version upgrade or a patch deployment, run the redenv_upgrade utility:
redenv_upgrade <env_name>
1.4.1.1. Existing Upgrade and Patch Process¶
The utility automates the upgrade or patch rollout for the target instance’s binary assets and scripts using the following flow:
Safety Check: It verifies that the target environment is a compiled production environment and not a developer environment. It will refuse to upgrade a developer environment to prevent overwriting local uncompiled Python scripts or virtual environments.
Process Stop: It stops all running processes inside the target environment instance using the
redsysctlcontrol tool.Upgrade and Patch Scripts:
In version upgrade mode, it runs the instance-level upgrade scripts (
upgrade.sh) located under.seed/lib/upgrade/<version>/for all versions greater than the instance’s current version up to the target version, in strictly increasing natural sequence.In patch mode, it executes any patch migration scripts designated for the active TV version.
Binary and Library Assets Update: It synchronises the instance’s
bin/andlib/directories with the newly deployed.seedtemplate directory, replacing updated executables and shared libraries.Version Tracking: It updates the version marker file at
log/TVERSIONwithin the environment instance directory with the new version or patch identifier.
1.4.2. Creating a New Environment Instance (Fresh Install)¶
To perform a fresh installation of an environment instance, run the redenv_create utility:
redenv_create <new_env_name>
1.4.2.1. New Instance Process¶
The utility sets up a new directory structure by cloning the .seed template:
Port Allocation: It scans all existing environment instances on the host to determine their configured ports. It automatically assigns new, non-overlapping port numbers for the following parameters:
service_base_portmail2cmd_portgu_port
Seed Replication: It copies the complete directory structure and default templates from
/app/redsys/env/.seedto the new instance directoryenv/<new_env_name>.
1.4.3. Switching to the Environment Context¶
To work within a specific environment instance (for example, to verify configurations or run database setups), you must switch into its context. You can do this using the redenv utility:
redenv <env_name>
Important: The redsys profile automatically generates a shell alias for every active environment instance. This means you can simply type the environment name itself as a command to switch into its context:
<env_name>
Note
Fresh Installations: If you have just created a new environment instance using redenv_create, its alias will not be immediately available in your active shell session. You must reload your user profile to generate the new alias. This can be done by sourcing the profile directly (source ~/.bashrc), sourcing the aliases file (source /app/redsys/etc/aliases), or logging into the redsys user once more (e.g., su - redsys).
When you enter an environment context, your shell prompt will update to reflect the active environment, and all subsequent RED commands will operate against this specific instance.
1.4.4. Configuration Parameter Customisation¶
Following the upgrade, patch, or creation of the environment instance, verify the configuration settings:
# Switch to the environment first
<env_name>
vi etc/red_params.conf
Verify that all environment-specific values, such as database connection strings, are set correctly.
1.5. Phase 3: Database Schema Installation¶
The database schema installation, upgrade, or patch is the final step of the TV deployment process. It applies the necessary changes to the target database schema associated with the environment instance.
1.5.1. Running the Database Installer¶
To execute the database schema installer, you must switch to the target environment context and run the redtvctl install utility. This utility requires the database SYS password.
# Switch to the environment context
<env_name>
# Run the installer
redtvctl install
1.5.2. Database Installer Internal Process¶
Under the hood, the database installer performs the following actions:
Establish SYS Connection: Connects to the Exasol database using
SYSprivileges and verifies that the database parameters and connection limits are sufficient.Installation Mode Detection:
Full Install (Fresh): Triggers when the database does not contain any existing RED user schemas.
The installer creates all RED system schemas, tables, views, and metadata repository tables from scratch.
Incremental Upgrade: Triggers when existing RED schemas are detected with an earlier TV version.
The installer queries the
redsys.adm_current_tversionview to identify the current database TV version.It verifies that the active database version is marked with a status of
CLOSED.It scans the
/app/redsys/env/<env_name>/src/tv/install/incr/directory to identify database upgrade scripts (install.sql) for all versions in the rangecurrent_version < version <= target_version.It sequentially executes these SQL scripts via the
exaplusdatabase client using a secure, temporary profile.
Patch Application: Triggers when the database TV version matches the patch prerequisite.
It executes patch-level SQL updates, re-compiles updated stored procedures/scripts, and updates metadata views without requiring a full version closure cycle.
Log Spooling: The installer spools all execution details and compilation messages to a dedicated log file:
log/tv.install.full.<version>.<timestamp>.log(for fresh installs)log/tv.install.incr.<version>.<timestamp>.log(for upgrades)log/tv.install.patch.<version>.<timestamp>.log(for patch updates)
Verification: The installer checks the database status after the scripts have completed. It verifies that the database has successfully transitioned to the target TV version or patch revision and that its status is set to
CLOSED.
1.5.3. Service Resumption¶
Once the database installer exits successfully, leave the environment subshell context and start the instance services:
exit
redsysctl start <env_name>