Linux Install Using the RPM Package

This page describes how to install the Machine Agent on Linux systems that support the RPM Package Manager:

  • CentOS
  • RHEL
  • Fedora
  • openSUSE
  • SUSE Linux Enterprise Server

  • AARCH

For Linux systems that do not support RPM, use the JRE Bundled Zip Archive.

The RPM installer makes these changes to the host machine:

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

These changes are necessary to enable non-root users to configure and run an RPM-installed agent. 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.

CODE
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 stops. To continue, you must define users and groups.If this is an issue in your environment, then you install the agent using the ZIP archive (see Linux Install Using ZIP with Bundled JRE).

Install the Machine Agent

  1. Before installing, review Install the Machine Agent.
  2. Download and install the RPM Package. With administrative privileges, enter the following CLI code where <pkg-name.rpm> is the name of the package for your environment, such as appdynamics-machine-agent-<version>.x86_64.rpm.
    CODE
    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 the <machine_agent_home>/conf/controller-info.xml file or by adding system properties to the JVM startup script file. See Linux Install Using the RPM Package.
    1. (Required) Configure the Controller host name, port number, and account access key.
    2. (Optional) Review memory requirements. See Machine Agent Requirements and Supported Environments.
    3. (Optional) Configure the agent to use SSL. See Enable SSL for Machine Agent.
    4. (Optional) Configure the agent to use proxy settings. See Machine Agent Configuration Properties.
    5. (Required for Multi-Tenant Mode or SaaS installations) Configure the Agent Account Information. See Multi-Tenant Controller Accounts.
    6. (Optional) Determine if you need to specify an application name and tier name. See Machine Agent Installation Scenarios. If you are installing the Machine Agent on the same server with any Splunk AppDynamics app agent, do 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

RPM パッケージ機能

RPM パッケージマネージャは、エージェントファイルを opt/appdynamics/machine-agent にインストールし、シンボリックリンクを作成し、環境変数を設定し、エージェントをサービスとして追加します。

SysV サービススクリプトのリンク

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

このスクリプトには、次のサービスコマンドが用意されています。

  • Start:サービスを開始し、エージェントを起動するスクリプトを実行します。
  • Stop:サービスを停止します。
  • Restart:サービスを再起動します。
  • Status:サービスのステータスを返します。

例: service appdynamics-machine-agent start

環境変数のリンク

SysV:

CODE
/etc/sysconfig/appdynamics-machine-agent >> /opt/appdynamics/machine-agent/etc/sysconfig/appdynamics-machine-agent

このスクリプトは、環境変数を設定します。

  • MACHINE_AGENT_HOME=/opt/appdynamics/machine-agent:マシンエージェントファイルが配置されている場所を指定します。
  • JAVA_HOME=/opt/appdynamics/machine-agent/jre:エージェントが使用する JRE を指定します。独自の JRE を含む RPM パッケージインストーラを使用することを推奨しています。ただし、JRE の要件を満たしている限り、別の JRE を使用できます。
  • MACHINE_AGENT_USER=root:エージェントを起動するためのシステムユーザーを指定します(デフォルトは root)。マシンエージェントを実行するための非ルートユーザーを作成することを推奨します。新しいユーザには、controller-info.xml の読み取りアクセス権とログファイルへの書き込みアクセス権が必要です。「マシンエージェントを実行するために必要な権限」を参照してください。

systemd:環境変数は次のサービスファイルにあります。

CODE
/etc/systemd/system/appdynamics-machine-agent.service >> /opt/appdynamics/machine-agent/etc/systemd/system/appdynamics-machine-agent.service
注: 「MACHINE_AGENT_USER」変数は systemd サービスファイルにはありません。変数は User だけです。

エージェントからコントローラへの通信のリンク

エージェントからコントローラへの通信のプロパティを含む controller-info.xml ファイルへのリンクを設定します。

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

ロギングの設定

log4j.xml ファイルは、エージェントによってログに記録される情報の詳細を制御します。デフォルトでは、ログレベルは info に設定されます。

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

エージェントをサービスとして追加する

パッケージがインストールされた後、appdynamics-machine-agent によって opt/appdynamics/machine-agent/bin/postInstall.sh がサービスに追加されます。インストーラは、SysV スクリプトをコピーしてサービスを追加します。または、systemd が検出された場合は、インストーラはエージェント ユニット ファイルの /etc/systemd/system/appdynamics-machine-agent.service をコピーし、このユニットファイルを使用してエージェントをサービスに追加します。

エージェントサービスの systemd ユニットファイルをインストールする

RPM パッケージをインストールするとき、または postinstall.sh スクリプトを実行するときにシステムで systemcd が検出された場合、エージェントサービスの systemd ユニットファイルが次の場所にコピーされます。/etc/systemd/system/appdynamics-machine-agent.service

ExecStart:systemd サービスファイルのこのオプションは、エージェントをデーモンとして起動するスクリプトを指します。/opt/appdynamics/machine-agent にマシンエージェントをインストールしていない場合は、パスを <machine-agent-home>/scripts/machine-agent-daemon に変更します。パスを編集していない場合は、デフォルトで正しい場所を指しています。

関連する systemctl コマンドを使用して、エージェントサービスを開始および停止できます。すべての systemctl コマンドの詳細については、systemctl の man ページを参照してください。

コマンド 形式

起動

停止

status

再起動

systemctl <command> appdynamics-machine-agent.service

disable

イネーブル化

(フルパスを使用)

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