On this page:

Related pages:

Your Rating:
Results:
PatheticBadOKGoodOutstanding!
18 rates

This topic describes how to install the Standalone Machine Agent on Linux systems that support the RPM Package Manager such as CentOS, RHEL, Fedora, openSUSE, and SUSE Linux Enterprise Server. For Linux systems that do not support RPM, use the JRE Bundled Zip Archive.

The RPM installer makes the following changes to the host machine:

  • Creates an appdynamics-machine-agent group and an appdynamics-machine-agent user 
  • Assigns ownership of certain files in the machine-agent directory to the appdynamics-machine-agent user

These changes are necessary to enable non-root users to configure and run an RPM-installed agent. If you want to use a different user or group for the machine agent service, set the MACHINE_AGENT_USER and MACHINE_AGENT_GROUP environment variables in a shell for rpm installation.

sudo MACHINE_AGENT_USER=myuser MACHINE_AGENT_GROUP=mygroup rpm -ivh appdynamics-machine-agent.rpm

If the specified user or group does not exist, an error message appears and the rpm installation is halted. To proceed you'll need to define users and groups.
If this is an issue in your environment, the alternate workflow is to install the agent using the ZIP archive (see Linux Install Using ZIP with Bundled JRE).

Install the Machine Agent

  1. Before installing, review the installation notes on Install the Standalone Machine Agent.

  2. Download and install the RPM Package. From the command line, enter the following where <pkg-name.rpm> is the name of the package for your environment, such as appdynamics-machine-agent-<version>.x86_64.rpm. This command requires administrative privileges

         sudo rpm -ivh <pkg-name.rpm>

    The agent files are installed in opt/appdynamics/machine-agent and the agent is added as a service.

  3. Gather your configuration details and configure the agent by editing<machine_agent_home>/conf/controller-info.xml file or by adding system properties to the JVM startup script file.
    See Plan the Standalone Machine Agent Configuration.

    1. (Required) Configure the Controller host name and port number, and account access key 
    2. (Optional) Review memory requirements. See Standalone Machine Agent Requirements and Supported Environments.
    3. (Optional) To configure the agent to use SSL see Enable SSL for Standalone Machine Agent.
    4. (Optional) To configure the agent to use proxy settings see the proxy settings in Standalone Machine Agent Configuration Properties.
    5. (Required for Multi-Tenant Mode or SaaS installations) Configure the Agent Account Information. See Controller Accounts (Multi-Tenancy)
    6. (Optional) Application and tier name, see Standalone Machine Agent Installation Scenarios to determine if you need to specify an application name and tier name. Usually, if you are installing the Standalone Machine Agent on the same server with any APM app agent, you should not specify application name and tier name.
  4. Start the Agent. You can start the agent as a service (requires sudo or root user) or from the command line. If systemd was detected during installation, you can use the systemctl command to start the agent service. 
    • Using SysV – service appdynamics-machine-agent start
    • Using systemd – systemctl start appdynamics-machine-agent
    • From the Command Line – <machine_agent_home>/bin/machine-agent
    • From the Launcher – <machine_agent_home>/etc/init.d/appdynamics-machine-agent start

What the RPM Package Does

The RPM package manager installs the agent files to opt/appdynamics/machine-agent, creates symbolic links, sets environment variables and adds the agent as a service.

The RPM package manager creates the symbolic links to agent scripts and configuration files in the /etc directory. You can edit these links if you to need to accommodate a different installation directory, JRE, or system user account running the agent. 

Link for SysV Service Script

/etc/init.d/appdynamics-machine-agent >> /opt/appdynamics/machine-agent/etc/init.d/appdynamics-machine-agent

This script provides the following service commands:

  • Start – Starts the service, runs a script that starts the agent
  • Stop – Stops the service
  • Restart – Restarts the service
  • Status – Returns the status of the service.

Example command: service appdynamics-machine-agent start

Link for Environment Variables

SysV –  /etc/sysconfig/appdynamics-machine-agent >> /opt/appdynamics/machine-agent/etc/sysconfig/appdynamics-machine-agent

This script sets up the environment variables: 

    • MACHINE_AGENT_HOME=/opt/appdynamics/machine-agent – Specifies where the agent files are located.
    • JAVA_HOME=/opt/appdynamics/machine-agent/jre – Specifies the JRE the agent uses. The RPM package installer contains its own JRE, which we recommend you use, but you can use a different JRE as long as it meets the JRE requirements.
    • MACHINE_AGENT_USER=root – Specifies the system user for starting the agent (the default is root). It is good practice to create a non-root user to run the machine agent. The new user needs to have read-access to controller-info.xml and write access to the log file. See Permissions Required to Run the Machine Agent for more details.

systemd – The environment variables are in the service file: 

/etc/systemd/system/appdynamics-machine-agent.service >> /opt/appdynamics/machine-agent/etc/systemd/system/appdynamics-machine-agent.service

"MACHINE_AGENT_USER" variable doesn't exist in the systemd service file. The variable is just "User".

 

 

Link for Agent to Controller Communication

Sets up a link to the controller-info.xml file containing the properties for agent-to-controller communication.

/etc/appdynamics/machine-agent/controller-info.xml >> /opt/appdynamics/machine-agent/conf/controller-info.xml

Logging Configuration

The log4j.xml file controls the detail of information logged by the agent. By default, the logging level is set to "info".

/etc/appdynamics/machine-agent/logging/log4j.xml >> /opt/appdynamics/machine-agent/conf/logging/log4j.xml

Adds the Agent as a Service

After the package is installed, the appdynamics-machine-agent runs opt/appdynamics/machine-agent/bin/postInstall.sh to add the agent to the services.  The installer either copies the SysV script to add the service or, if systemd is detected, the installer copies the agent unit file, /etc/systemd/system/appdynamics-machine-agent.service and adds the agent to the services using this unit file.

Installs a systemd Unit File for the Agent Service

If systemcd is detected on the system when you install the RPM package or run the postinstall.sh script, the systemd unit file for the agent service is copied to the following location: /etc/systemd/system/appdynamics-machine-agent.service

ExecStart: This option in the systemd service file points to a script that starts the agent as a daemon. If you did not install the machine agent in /opt/appdynamics/machine-agent, then change the path to <machine-agent-home>/scripts/machine-agent-daemon. If you didn't change the moving the home directory it points to the correct place by default.

You can start and stop the agent service using the relevant systemctl commands. For information on all systemctl commands, see the man pages for systemctl.

CommandFormat

start

stop

status

restart

systemctl <command> appdynamics-machine-agent.service

disable

enable

*use the full path

systemctl <command> /etc/systemd/system/appdynamics-machine-agent.service


  • No labels