Installing the agent on Linux
You can install the host agent on Linux by using different methods depending on your requirements. See the following sections to check the prerequisite conditions, learn about all the available installation methods, and install the host agent on Linux.
Prerequisites
Before you install the host agent, make sure that the prerequisites are met.
Choosing how you want to install the agent
Choose one of the following installation options and click the associated link to continue:
-
In an online environment (where the host can communicate with the Instana hosted agent repositories), you can install the host agent automatically by using the one-liner installation technique on supported Linux distributions. For more information, see Installing the agent by the automated (one-liner) script.
-
Alternatively, in an online or offline (air-gapped) environment, you can download the agent package manually and then either install the package manually or create a repository and instruct your package manager to install the package for you. For more information, see Installing the agent by package manager or manually (DEB, RPM).
-
You can install and run the agent from a
.tar
file.To install and run the agent from the
.tar
file, download and extract the file, and then start the agent. For more information, see Installing and running the agent from a.tar
file. -
You can install and run the agent as a non-root user.
To run the Instana agent as a non-root user, install the agent from a
.tar
file. For more information, see Installing and running the agent as a non-root user.
Installing the agent by the automated (one-liner) script
The agent one-liner is a powerful script that you can use to automatically install the host agent on Linux-based operating systems. To use the one-liner to install the host agent, complete the following steps:
The one-liner supports the following Linux distributions:
- Debian derivatives (apt package manager)
- Red Hat derivatives (yum package manager)
- SUSE derivatives (zypp package manager)
-
On the home page of the Instana UI, click Deploy Agent.
If you are starting a new trial instance of Instana, the agent catalog is displayed with a prompt to select a host agent to install.
-
On the agent deployment catalog page, click the tile Linux - Automatic Installation (One-liner).
-
Select the agent packaging mode.
-
In the Packaging section, select the agent type (
Dynamic
orStatic
) that you want to deploy. To understand the differences of static agents and dynamic agents, see Host agent types. -
In the Runtime section, select the runtime that you want to use on the agent machine, and select the agent deployment method (
Interactive
orSilent
).
The script is pre-filled with your agent key and host agent endpoint.
If you change options, then the script parameters are updated.
For example, the UI provides the following script to install the agent with the
Dynamic
packaging option, and with the Azul Zulu 11 and Interactive runtime options:curl -o setup_agent.sh https://setup.instana.io/agent && chmod 700 ./setup_agent.sh && sudo ./setup_agent.sh -a <your_agent_key> -d <your_agent_key> -t dynamic -e <host-agent-endpoint>
-
-
If you want to install and start the host agent as a service, select
Install and start as service (only supported for SystemD-based systems)
. Then, the-s
parameter is added to the script.This option is supported only for systemd-based systems.
-
Copy the script to the machine where you want to install the host agent, and then run the script to install the host agent.
Before you run the script, you can add other parameters for more options. For a description of available parameters, see One-liner script parameters.
You need root user privileges to install the Instana host agent.
Now the host agent is installed. View the agent on the infrastructure map by clicking View Deployed Agents.
For what you can do after the installation, go to the What to do next section.
The public system package repository of Instana is added to your system by creating a repository file. This file adds Instana authenticated repositories to the machine's installation sources.
One-liner script parameters
The one-liner script accepts the following parameters:
Parameter | Description |
---|---|
-a = (required) |
The agent key. |
-d = (optional) |
The Instana download key. If you are using a self-hosted (on-premises) Instana deployment, the key is provided for you by Instana. |
-e = (required) |
The host agent endpoint. |
-m = (optional) |
Sets the Instana agent mode, apm (default), infra , or aws . |
-t = (optional) |
The agent type, dynamic (default) or static . |
-j = (optional) |
Selects Eclipse OpenJ9 11 as the bundled Java runtime. |
-y = (optional) |
Noninteractive prompt. Specify it if you want to install the agent without an interactive shell. |
-s = (optional) |
Starts the instana-agent service, and enables it to start at boot time. This option works only for systems that is running systemd . |
-g = (optional, needed if -b is set) |
The specification of the remote URL for the Git-based configuration management capability of the host agent. |
-b = (optional, needed if -g is set) |
The name of the remote branch to track for the Git-based configuration management capability of the host agent. |
-u = (optional, needed if -p is set) |
The username for basic authentication if you are using HTTP-based remotes for the Git-based configuration management capability of the host agent. |
-p = (optional) |
The password for basic authentication if you are using HTTP-based remotes for the Git-based configuration management capability of the host agent. |
Installing the agent by using a package manager or manually (DEB, RPM)
In addition to installing the agent by the automated (one-liner) script, you can also download an agent package for DEB or RPM from the Instana UI. Then, instruct your package manager to install the package for you or install the package manually.
When the communication between the agent and the Instana-hosted agent repositories is impossible or undesirable, you can use a local mirror instead. You can configure the Instana host agent to use the agent repository as the mirror, configure a different mirror, or change the agent repository location.
1. Downloading the agent package
If you are on a self-hosted backend, the backend version must be 275 to download an agent package.
To download an Instana agent package, complete the following steps:
-
On the home page of the Instana UI, click Deploy Agent.
If you are starting a new trial instance of Instana, the agent catalog is displayed with a prompt to select a host agent to install.
-
On the agent deployment catalog page, click the tile Linux - Packages (DEB, RPM).
-
Select the agent configurations.
-
In the Packaging section, select the agent type (
Dynamic
orStatic
) that you want to deploy. To understand the differences of static agents and dynamic agents, see Host agent types. -
In the Runtime section, select Azul Zulu 11 or Eclipse OpenJ9 11 runtime.
-
In the Mode section, select the package mode (
RPM
orDEM
) that you want to use.
-
-
In the Platform architecture section, select the architecture of the Linux machine where you want to install the host agent.
-
Click the download icon to download the host agent package (DEB or RPM) from your web browser.
In an offline (air-gapped) environment that is not connected to the internet, you can download the agent package for DEB or RPM directly from the Artifactory. Make sure that you download the latest package.
Now the agent package is downloaded. Go to the next section to install the agent package.
2. Installing the agent package
Instruct your package manager to install the agent package or install the agent package manually.
To install the agent package by using a package manager, use one of the following ways based on your Linux distribution:
-
Debian derivatives (
apt
package manager)-
Prepare the
apt
package manager with resources for the Instana agent package by creating the following files:# /etc/apt/sources.list.d/instana-agent.list deb [arch=amd64] https://packages.instana.io/agent generic main
# /etc/apt/auth.conf.d/instana-packages.conf machine packages.instana.io login _ password <your_agent_key>
Alternatively, you might hardcode the authentication in the URL in
/etc/apt/sources.list.d/instana-agent.list
. However, this method causes a mild security risk andapt
issues warnings that are shown whenever you install or update Instana packages. -
Add the Instana GPG key to the
apt
package manager by running the following command:wget -qO - https://packages.instana.io/Instana.gpg | sudo apt-key add -
-
-
RPM-based distributions (
yum
package manager)-
Copy the following code snippet into your yum sources (
/etc/yum.repos.d/Instana-Agent.repo
):[instana-agent] name=Instana baseurl=https://_:<your_agent_key>@packages.instana.io/agent/generic/x86_64 enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://packages.instana.io/Instana.gpg priority=5 sslverify=1
Replace <your_agent_key> with your agent key.
-
If you want to enable GPG package verification, for some distributions, you need to import the key into the package manager's key ring beforehand.
To import the key, run the following command:
rpm --import https://packages.instana.io/Instana.gpg
-
-
openSUSE/SLES (
zypp
package manager)For openSUSE and SUSE Linux Enterprise Server, the path is
/etc/zypp/yum.repos.d/Instana-Agent.repo
, but the contents can remain the same as the RPM-based distribution.
Now the agent package is installed. After you refresh the package manager's sources, go to the next section to continue.
3. Preparing the agent
-
Configure the host agent endpoint and the agent key.
To find the endpoint, port, and agent key values, go to the home page of the Instana UI and click Agent deployment. On the agent deployment catalog page, click the tile Linux - Automatic Installation (One-liner). Then, you can see endpoint, port, and agent key values in the deployment script.
See the following script example:
curl -o setup_agent.sh https://setup.instana.io/agent && chmod 700 ./setup_agent.sh && sudo ./setup_agent.sh -a aGeNTKEY0vaLuO0Eu1ABc -d n3asffgkg -t dynamic -e ingress-green-saas.instana.io:443
-
Set environment variables before you install the host agent.
export INSTANA_AGENT_KEY=$agentkey export INSTANA_AGENT_HOST=$endpoint export INSTANA_AGENT_PORT=$endpoint_port
Summary of options for setting environment variables:
-
Git-based configuration management: Placing environment variables in a file is a good approach. For more information, see Git-based configuration management.
-
Systemd: A drop-in is the easiest way to overwrite environment specifics for services.
-
SysVinit: Place the files in either /etc/sysconfig (Red Hat derivatives) or /etc/default (Debian derivatives).
For more information about the options for environment variables, see Setting and overriding environment variables.
-
Now the preparation work for the agent installation is completed. Go to the 4. Installing the agent section to continue.
4. Installing the agent
Refresh the package manager's sources, and then run one of the following commands to install the agent on your chosen architecture:
-
Debian derivatives
-
To install a static agent, run the following command:
apt-get install instana-agent-static
-
To install a dynamic agent, run the following command:
apt-get install instana-agent-dynamic
-
-
Red Hat derivatives
-
To install a static agent, run the following command:
yum install instana-agent-static
-
To install a dynamic agent, run the following command:
yum install instana-agent-dynamic
-
-
Eclipse OpenJ9 11 bundled packages
Install the host agent with one of the following package names:
instana-agent-static-j9
orinstana-agent-dynamic-j9
.
Now the host agent is installed. For what you can do after the installation, go to the What to do next section.
Installing and running the agent from a .tar
file
If you want to install and run the agent from a .tar
file, download and extract the file, and then start the agent.
The .tar
file is pre-filled with your agent key and host agent endpoint.
Follow the steps to install the agent from a .tar
file:
- 1. Checking the prerequisites
- 2. Downloading the agent
- Downloading the agent with UI
- Download the agent with wget
- 3. Starting the agent
1. Checking the prerequisites
Before you install the host agent, make sure that the following prerequisites are met:
-
A Java development kit (JDK) must be available for the agent by using either of the following options:
-
Place or link the JDK into
<instana-agent-install-dir>/jvm
(so that<instana-agent-install-dir>/jvm/bin/java
exists). -
The customizable way is to export an environment variable JAVA_HOME to point to that JDK (this environment variable can also be set to
instana-agent-install-dir>/bin/setenv
).
The following JDKs are supported for running the agent:
- IBM OpenJ9 JDK 11 (Preferred)
- Azul Zulu JDK 11
- OpenJDK JDK 11
- Oracle Hotspot JDK 11
- Amazon Corretto JDK 11
- IBM J9 11
The JVM must be executable for all users on the system. You are recommended to use the latest available patch release of the Java distribution of your choice. The agent requires a JDK that supports TLSv1.3 (available in all current JDK 11 builds). Depending on your OS distribution, the packages that are provided by the OS distributor might not contain strong encryption support due to export control. If you use such a package, you might meet the errors like "java.lang.RuntimeException: Could not generate DH key pair."
-
-
To reduce the resources used by the agent when the file system is changed, you must install the inotify-tools package on your Linux distribution.
-
Ensure that the user that is used to run the agent can write in the agent directory and all its subdirectories. The agent downloads the required sensors in accordance with auto-detection and creates log files in its
data
subdirectory. -
Make sure that you have about 100 MB of available disk space.
-
The agent downloads updates and sensors from the following host. Make sure that the following host and ports can be accessed:
- DNS Name:
artifact-public.instana.io
- Destination Port:
tcp/80
andtcp/443
- DNS Name:
-
Currently, the Instana Service is provided in two different regions. Your individual instance is located geographically closest to most of your agents and users. Agents are pre-configured upon download, but some installation methods require Instana backend configuration. Consult the Agent Management section inside the product or your technical contact at IBM to learn about the region where your instance is located.
-
If you are using the self-hosted (on-premises) Instana, use the endpoints that are defined during the Instana backend installation. You can also see the endpoint to which the agent reports in the Instana UI. Go to Deploy agent and check the deployment code or YAML configuration.
-
If you are using Instana SaaS, use the endpoints that are described at host agent endpoints.
2. Downloading the agent
You can download the host agent by using either of the following ways:
-
Download the agent from the Instana UI by completing the following steps:
-
On the home page of the Instana UI, click Deploy Agent.
If you are starting a new trial instance of Instana, the agent catalog is displayed with a prompt to select a host agent to install.
-
On the agent deployment catalog page, click the tile Linux - Archive (tar.gz).
-
In the Packaging section, select the agent type (
Dynamic
orStatic
) that you want to deploy. To understand the differences of static agents and dynamic agents, see Host agent types. -
In the dropdown list, select the platform architecture (operating system).
The archive file is automatically pre-configured with your Instana account settings so that you only need to extract and start the agent.
-
Click the download icon to download the host agent package file (tar.gz) from your web browser, and then extract the file.
-
-
Download the agent with wget by running the following commands:
wget --save-cookies {{agent_folder_name}}/instana-cookies.txt --post-data 'email={{instana_username}}&password={{instana_password}}' https://{{instana_tenant_unit}}-{{instana_tenant}}.instana.io/auth/signIn
wget --content-disposition --load-cookies {{agent_folder_name}}/instana-cookies.txt --post-data 'type=linux64' https://instana.io/ump/{{instana_tenant}}/{{instana_tenant_unit}}/agent/download -O {{opt_folder}}/{{name_of_agent_archive.tar.gz}}
Now the host agent is downloaded. Go to the next section to start the agent.
3. Starting the agent
Put the extracted agent package file to a system-wide accessible location, and run the agent as the root user.
If you run the host agent with any other user, the functions of the host agent are limited. The reason is that some performance metrics are supported only by the root. The monitoring of Docker containers can be done only by the root on the Docker host machine. In addition, only either the root or startup users can attach and monitor Java virtual machines (JVMs). If you can't run the host agent as root, make sure that the agent user is listed in sudoers with a valid shell.
To start the agent, run the following command:
INSTANA_AGENT_FOLDER/bin/start
Now the host agent is installed and started. For what you can do after the installation, see What to do next.
Installing and running the Instana agent as a non-root user
Install and run the agent as a root user.
Installing the agent as a non-root user is experimental and is not supported in production environments. You might notice unexpected behavior when you install or run the agent as a non-root user. Only selected sensors are supported now as described in the Supported features section. For common troubleshooting steps, see Agents installed and run as a non-root user.
To run the Instana agent as a non-root user, the only way is to extract the Instana agent tar file and then start the agent.
To install the Instana agent in RHEL 9, complete the following steps:
You can modify the commands based on the operating system of the host machine where you want to install the agent.
-
Create a normal user for the Instana agent:
sudo adduser instana
-
Install Java.
-
Download the host agent as described in the 2. Downloading the agent section, and then extract the agent archive file by running the following command:
tar -xvf <instana-agent-*>.gz
After you extract the file, the
instana-agent-*
directory is displayed. -
Change the owner of the
instana-agent-*
directory:chown -R instana_user:instana /instana-agent
-
Go to the
INSTANA_AGENT
directory, then start the Instana agent:./bin/start
-
Optional: Check the status of the agent:
./bin/status
Now the host agent is installed. For what you can do after the installation, see What to do next.
Supported features
The Instana agent that is run as a non-root user supports the following features:
Java attachment
For JVM-based applications, you need to run target JVM application on the same user account where the Instana agent is running so that the attachment works.
Host sensor
The host sensor requires the sudo entry
permission in the sudoers
file to access the readlink
command (/proc
directory). For more information, see Troubleshooting.
ACE sensor
-
If the ACE process is started with the user that starts the Instana agent, everything works well including auto-discovery.
-
If the ACE process is started with a different user (not the one that starts the Instana agent), then environment variables return empty. In this case, the ACE sensor supports remote monitoring and local monitoring with REST API. However, auto-discovery does not work.