Skip to content

AxonOps — AI-Native Control Plane for Open Source Data Platforms

axon-agent Installation

The axon-agent enables collection of:

  • Metrics
  • Logs
  • Events

The axon-agent also enables the following maintenance operations to be performed on the cluster:

  • Adaptive repairs
  • Backups

See Installing axon-agent for Cassandra in Docker if you are running Cassandra under Docker, and the Kubernetes guide if you are setting up Strimzi or K8ssandra clusters.

axon-agent is available for the following versions of Apache Cassandra and Apache Kafka:

  • Apache Cassandra 3.0.x
  • Apache Cassandra 3.11.x
  • Apache Cassandra 4.0.x
  • Apache Cassandra 4.1.x
  • Apache Cassandra 5.0.x
  • Apache Kafka 2.x
  • Apache Kafka 3.x
  • Apache Kafka 4.x

Select the OS Family

Execute the following commands to setup the AxonOps repository:

Terminal window
sudo apt-get update
sudo apt-get install -y curl gnupg ca-certificates
curl -L https://packages.axonops.com/apt/repo-signing-key.gpg \
| sudo gpg --dearmor -o /usr/share/keyrings/axonops.gpg
echo "deb [signed-by=/usr/share/keyrings/axonops.gpg]\
https://packages.axonops.com/apt axonops-apt main" \
| sudo tee /etc/apt/sources.list.d/axonops-apt.list
sudo apt-get update

Install the AxonOps Cassandra Agent and its dependency axon-agent:

sudo apt-get install axon-cassandra3.0-agent

The AxonOps Cassandra Agent is the jar that is directly loaded by Cassandra. The AxonOps Cassandra Agent then reaches out directly to the AxonOps Agent binary which contacts the AxonOps Server directly.

  • Configuration File: /etc/axonops/axon-agent.yml
  • Binary: /usr/share/axonops/axon-cassandra{version}-agent.jar
  • Version number: /usr/share/axonops/axon-cassandra{version}-agent.version
  • Copyright: /usr/share/doc/axonops/axon-cassandra{version}-agent/copyright
  • Licenses: /usr/share/axonops/licenses/axon-cassandra{version}-agent/

The axon-agent is a dependency of the AxonOps Cassandra Agent. This binary contacts the AxonOps Server directly while minimizing the memory footprint and CPU utilization of the Cassandra process.

  • Configuration File: /etc/axonops/axon-agent.yml
  • Binary: usr/share/axonops/axon-agent
  • Logs: /var/log/axonops/axon-agent.log
  • Systemd service: /usr/lib/systemd/system/axon-agent.service

Update the following lines within /etc/axonops/axon-agent.yml.

The highlighted lines should match the host and org keys found within /etc/axonops/axon-server.yml.

axon-server:
hosts: "axon-server_endpoint" # Your axon-server IP or hostname, e.g. axonops.mycompany.com
port: 1888 # The default axon-server port is 1888
axon-agent:
org: "my-company" # Your organisation name
# SSL/TLS Settings from AxonOps Agent to AxonOps Server
tls:
mode: "disabled" # disabled, TLS, mTLS
# Only set below if mode is TLS or mTLS
skipVerify: false # Disables CA and Hostname verification
caFile: "path_to_certs_on_axon_agent_node.crt" # required if skipVerify is not set and you are using a self-signed cert
certFile: "path_to_certs_on_axon_agent_node.crt" # only set if mode is mTLS
keyFile: "path_to_key_file_on_axon_agent_node.key" # only set if mode is mTLS
# Command execution restrictions (see below for details)
# disable_command_exec: false
# scripts_location: /var/lib/axonops/scripts/
NTP:
host: "ntp.mycompany.com" # Your NTP server IP address or hostname

The mode setting in the tls block under axon-agent must be one of disabled, TLS or mTLS:

  • disabled: no encryption. No certificate settings apply.
  • TLS: the agent verifies the axon-server certificate and does not present a client certificate. The agent needs no certFile or keyFile.
  • mTLS (mutual TLS): the agent verifies the axon-server certificate and must present a client certificate, configured with certFile and keyFile. axon-server in mTLS mode does not accept an agent without one. The agent certificate must be signed by the same certificate authority (CA) as the server certificate.

Agents that connect to AxonOps Cloud must use TLS mode with an agent key. mTLS is not available for AxonOps Cloud connections.

See Configure TLS for agent connections for the server-side settings and the full description of each mode.

The axon-agent can execute commands on the host system to perform operations such as repairs, backups, and restarts. These options allow configuration of the command execution security posture based on organisational requirements:

OptionDefaultDescription
disable_command_execfalseWhen set to true, the agent only executes scripts located in the scripts_location directory.
scripts_location/var/lib/axonops/scripts/The directory containing permitted scripts when disable_command_exec is enabled.

Three command execution modes are available:

ModeConfigurationDescription
Full accessdisable_command_exec: falseThe agent can execute commands sent from AxonOps. This is the default.
Permitted scripts onlydisable_command_exec: true with scripts in scripts_locationThe agent only executes scripts placed in the designated directory.
No executiondisable_command_exec: true with empty scripts_locationThe agent cannot execute any commands.

Permitted Scripts Only

axon-agent:
org: "my-company"
disable_command_exec: true
scripts_location: /var/lib/axonops/scripts/

With this configuration, only scripts placed in /var/lib/axonops/scripts/ can be executed by the agent.

Ensure Proper Agent Configuration Permissions

Section titled “Ensure Proper Agent Configuration Permissions”

After editing the file, ensure the file permissions for /etc/axonops/axon-agent.yml are set correctly by running the following commmand:

Terminal window
sudo chmod 0640 /etc/axonops/axon-agent.yml

Add the following at the end of /etc/cassandra/cassandra-env.sh, replacing any existing line that loads the AxonOps agent, so the agent is not loaded twice:

JVM_OPTS="$JVM_OPTS -javaagent:/usr/share/axonops/axon-cassandra3.0-agent.jar=/etc/axonops/axon-agent.yml"

If Cassandra was installed using a tarball, the correct path for the cassandra-env.sh will be <Cassandra Installation Directory>/conf/cassandra-env.sh.

NB. On Cassandra 4.1, 4.0 and 3.11, axonops-jvm.options is included in the AxonOps Cassandra Agent package from version 1.1.0. If the file is missing, Cassandra does not start and nodetool commands fail. On a node that already runs the agent, upgrade the agent package to 1.1.0 or later before replacing its JVM_OPTS="$JVM_OPTS -javaagent:..." line, and restore that line before downgrading the agent package below 1.1.0.

NB. Make sure this configuration is not overridden by automation tools.

Configure the Linux user groups by:

  • Adding the axonops user to the cassandra user group.
  • Adding the cassandra user to the axonops user group.
Terminal window
CASSANDRA_GROUP=cassandra
CASSANDRA_USER=cassandra
sudo usermod -aG "$CASSANDRA_GROUP" axonops
sudo usermod -aG axonops "$CASSANDRA_USER"

If Cassandra was setup to use a non-default user or group, CASSANDRA_GROUP and/or CASSANDRA_USER will need be updated accordingly for the above commands to work properly.

Due to recent change with needrestart, as seen in Ubuntu 24.04, uninstalling the needrestart package is currently recommended.

Failure to uninstall the needrestart package may cause the Cassandra service to be restarted when updating the axon-agent package.

To load the AxonOps Java Agent and Cassandra config changes, run the following command:

Terminal window
sudo systemctl restart cassandra

axon-agent maintains a persistent disk-backed queue at /var/lib/axonops/mq/ that buffers all outbound metrics, logs, and events whenever the connection to AxonOps is interrupted — whether due to axon-server downtime, a network disruption between the agent host and AxonOps Cloud, or any other connectivity loss. The queue survives agent restarts and is bounded only by available disk space on the agent host. When connectivity is restored, the agent drains the queue and resumes normal delivery automatically. No data is lost and no manual intervention is required.

Two queue size limits govern the maximum buffered data volume for each direction of the agent connection. Both are configured in axon-server.yml:

axon-server:
message_queue_max_size: 10485760 # 10 MiB — server-side queue for axon-server → axon-agent messages
ingest_queue_max_size: 157286400 # 150 MiB — transmitted to the agent at connect time; governs the agent-side ingest queue (axon-agent → axon-server)
Terminal window
sudo systemctl start axon-agent