Running multiple component instances

The Monitoring components are designed to be connected to a single Refinery installation on the installed server. However, multiple instances of each Monitoring component can be run on a server as they support systemd template units.

The primary instance of the Monitoring components is always default. To add another instance, the following configurations are required: application and environment (in systemd).

Application configuration

Within the component configuration folder (e.g. /etc/kx-refinery-monitoring-daemon for the daemon component) there is a folder per instance name. After installation there will be a single folder default.

To create a new instance, copy the default folder to the name of the new instance and then modify the configuration as required.

Environment configuration (in systemd)

After creating or modifying any systemd related files, always call systemd daemon-reload.

Cross-instance

Do not modify the installed systemd file for the Monitoring components.

For configuration that should be applied across all instances, create a cross-instance systemd configuration folder.

Example: for the daemon component, create for this purpose the folder

/etc/systemd/system/kx-refinery-monitoring-daemon@.service.d

A configuration file can be created and any values from the main systemd file can be overridden as required.

Instance-specific

For configuration specific to each instance, create an instance-specific system configuration. At a minimum, modify the component port on a per-instance basis:

[Service]
Environment="KX_REF_MON_PORT=*instance-specific-port*"

Example: for the daemon component for a component instance called myInstance, create the folder

/etc/systemd/system/kx-refinery-monitoring-daemon@myInstance.service.d

and within it a configuration file.