Skip to content

Configure your environment variables

This page explains how to view and change the environment variables KX Sensors uses to define the specifics of your deployment, stored in the kxsenv file.

KX Sensors uses environment variables to define the specifics of a given environment. These configurations are applied on initial install or reinstall. Each environment has its own set of environment variables, stored in the kxsenv file in the KXS_ROOT directory.

Example kxsenv

# The installation directory for KX Sensors.
# Installed packages are here, as are default folders for application logs and data.
KXS_ROOT=/root/kxs
KXS_LOG_DIR=/root/kxs/logs
KXS_LOG_RET=30

# The start of the TCP and UDP port range for use by KX Sensors processes.
# The following ports are always configured at fixed offsets from the base port:
# - +0 etcd_client
# - +1 etcd_peer
# - +2 qetcd
KXS_BASE_PORT=20000

KXS_LOAD_DIRS="/root/kxs/packages/kxs-core;/root/kxs/packages/kxs-ss;..."
PATH="/root/bin/q/l64:/root/kxs/packages/kxs-core/bin:/root/bin:/usr/local/sbin:..."
QHOME=/root/bin/q
USER=root

# Internal dev tooling, do not set
DKSESSION=

# The license is temporarily required for the q test framework and the manual tests.
# Once RTO is integrated with the test framework this will no longer be required.
KDB_K4LICENSE_B64=7UzGLEX5LBGCfYqWNnNWiJaWvbOHaydMeRim9UjGTPmriJZrW0zGlmb5M0zT=

# Paths to the TLS certificate files. Uncomment and set these when you enable TLS.
# KX_SSL_CERT_FILE=""
# KX_SSL_CA_CERT_FILE=""
# KX_SSL_KEY_FILE=""

To enable TLS, uncomment the KX_SSL_* variables and point them at certificate files that exist on the host. If any EMS stream enables TLS, RTO validates these three files at startup and exits without restarting if any are missing. For the full set of TLS variables, see In-transit TLS encryption.

Change environment variables after install

Variable How to apply the change
KXS_LOG_DIR, KXS_LOG_RET, QHOME, PATH Copy the files if necessary, then apply to any restarted processes.
KXS_ROOT Requires a complete system shutdown, moving files, and restarting with additional consideration of what is set in config.
KXS_BASE_PORT Requires re-adding your nodes or a full system reinstall.
KXS_LOAD_DIRS Either perform a dynamic upgrade or restart all processes.
KXS_DISC_ENDPOINTS Requires recreation of the qetcd unit file.

Next steps