AppDynamics Knowledge Base

How to run a standalone on-premise controller as a service in Linux

How to run a standalone on-premise controller as a service in Linux

A Step-by-Step Guide to run the standalone on-premise controller as a service in the Linux environment.

When you run a standalone on-premise controller manually, you can follow the steps described in the documentation below: https://docs.appdynamics.com/appd/onprem/24.x/latest/en/controller-deployment/administer-the-control...

However, there might be situations where you need to run the standalone on-premise controller as a service in a Linux environment. If so, you can follow the steps below.

  1. Change the user to root
    sudo -i​
  2. Install the library below (optional)
    apt install libxml2-utils -y​
    OR
    yum install libxml2 -y​
  3. Move to the directory below:
    cd /opt/appdynamics/platform/product/controller/controller-ha​
  4. Set up the controller db password and validate it
    ./set_mysql_password_file.sh -p <controller-db-password>​
    Output results:
    Checking if db credential is valid...​
  5. Move to the directory below
    cd /opt/appdynamics/platform/product/controller/controller-ha/init​
  6. Run the script below
    ./install-init.sh -s​
    Output results:
    update-rc.d will be used for installing init
    installed /etc/sudoers.d/appdynamics
    installing /etc/init.d/appdcontroller-db
    installing /etc/default/appdcontroller-db
    installing /etc/init.d/appdcontroller
    installing /etc/default/appdcontroller​
  7. Run the commands below to enable the newly created service:
    systemctl enable appdcontroller
    systemctl enable appdcontroller-db
    systemctl restart appdcontroller
    systemctl restart appdcontroller-db
    systemctl status appdcontroller
    systemctl status appdcontroller-db​

Additionally, you might create your own unit file with the start/stop commands to run the standalone on-premise controller as a service in a Linux environment without using our script.

Comments

I also created a unit file with the start/stop commands to run the standalone on-premise controller as a service in a Linux environment without using the script.

[Unit]
Description = AppDynamics After=network.target

[Service]
TimeoutStartSec=600
Type=forking
ExecStartPre=<APPD HOME>/platform/platform-admin/bin/platform-admin.sh start-platform-admin
ExecStartPre=<APPD HOME>/platform/platform-admin/bin/platform-admin.sh login --user-name <user> --password <password>
ExecStartPre=<APPD HOME>/platform/platform-admin/bin/platform-admin.sh start-controller-db --platform-name=<platform name>
ExecStart=<APPD HOME>/platform/platform-admin/bin/platform-admin.sh start-controller-appserver --platform-name=<platform name>
ExecStopPre=<APPD HOME>/platform/platform-admin/bin/platform-admin.sh stop-controller-db --platform-name=<platform name>
ExecStopPre=<APPD HOME>/platform/platform-admin/bin/platform-admin.sh stop-controller-db --platform-name=<platform name>
ExecStop=<APPD HOME>/platform/platform-admin/bin/platform-admin.sh stop-platform-admin
Restart=always
User=ubuntu
Group=ubuntu

[Install]
WantedBy=multi-user.target   

Then I ran systemctl daemon-reload to reflect the changes.

==============================

I also created the unit file below and verified that this unit file also works well.

[Unit]
Description = AppDynamics After=network.target

[Service]
TimeoutStartSec=600
Type=forking
ExecStartPre=<APPD HOME>/platform/platform-admin/bin/platform-admin.sh start-platform-admin
ExecStartPre=<APPD HOME>/platform/product/controller/bin/controller.sh start-db
ExecStart=<APPD HOME>/platform/product/controller/bin/controller.sh start-appserver
ExecStopPre=<APPD HOME>/platform/product/controller/bin/controller.sh stop-appserver
ExecStopPre=<APPD HOME>/platform/product/controller/bin/controller.sh stop-db
ExecStop=<APPD HOME>/platform/platform-admin/bin/platform-admin.sh stop-platform-admin
Restart=always
User=ubuntu
Group=ubuntu

[Install]
WantedBy=multi-user.target 

※ I ran systemctl daemon-reload to reflect the changes.

Version history
Last update:
‎01-15-2025 08:54 AM
Updated by: