While the script is included in the HA toolkit, you can use the script to install the Controller as a service even if you are not deploying an HA environment.
To run the script you need to be logged in as the root user, since the script creates a new AppDynamics user in your sudoers group based on your existing Controller root user. The script starts the Controller as this user.
In addition, there needs to be a C compiler on the system. You can install a C compiler using the package manager for your operating system. For example, on Yum-based Linux distributions, you can use the following command to install the GNU Compiler, which includes a C compiler:
Installing the Service
To install the Controller as a Linux service using the HA script:
- Create a directory named HA in your Controller home directory and install the toolkit in the directory as described in Using the High Availability (HA) Toolkit.
Save and encrypt the MySQL password:
This will prompt for the MySQL password, which will then be saved in encrypted form.
New controllers remove the db/.rootpw file from the controller installation for security reasons. Only the internal scripts use the password to access the database. As the HA package requires frequent database access, it is impractical to prompt for the password every time the database is use. Therefore, there is nothing else you would have to do with the password.
Log in as the root user. For example, from the command line:
Run the script from the Controller home as follows:
The Controller now starts automatically when the Controller machine starts up.
You can use these commands to start, stop, or restart the service manually, or check the status of the service, respectively:
Uninstall the Service
You can run uninstall-init.sh (also included in the HA toolkit) to remove the service.