Stopping and Starting QuerySurge Services
When making configuration changes, performing backups, or diagnosing issues, you will likely need to stop and restart one or more QuerySurge services. Because services has specific dependencies on other services, stopping and starting must be done in the correct order to ensure integrity of your data and availability of the QuerySurge application.
QuerySurge's service dependencies are defined as follows:
- Agents are dependent on Tomcat
- Statsmon is dependent on Tomcat
- Tomcat is dependent on MySQL
On Windows, use the Services console to manage services. The console can be launched by going to Start -> Run, and running the command, services.msc. On Linux, use a terminal to run the commands listed below.
Note: Stopping and starting system services typically requires administrator permissions (or equivalent) on each machine. Windows machines will prompt for elevated permissions. On Linux, prefix the commands with sudo or the equivalent command for your environment, as needed.
Note: Make sure all users have logged out of QuerySurge, and that no data tests are executing before you stop QuerySurge services.
How to Stop QuerySurge Services
QuerySurge services must be stopped in the following order:
- Agent(s)
- Agent-local Statsmon
- Tomcat-local Statsmon
- MySQL-local Statsmon
- Tomcat
- MySQL
To stop the services:
- Make sure all users are logged out and that all executions are completed. QuerySurge should be quiescent.
- Shut down all QuerySurge Services on the same machine (available on Linux):
- Linux - Use the following command:
-
Distribution with init.d:
service QuerySurge stop -
Distribution with systemd:
systemctl stop QuerySurge
-
Distribution with init.d:
- Linux - Use the following command:
- Shut down all QuerySurge Agents. On each Agent machine:
- Windows - Using the Windows Services console, stop the QuerySurgeAgent service.
- Linux - Use the following command:
-
Distribution with init.d:
service QuerySurge stop agent -
Distribution with systemd:
<install_dir>/QuerySurge/querysurge.sh stop agent
-
Distribution with init.d:
- Shut down all QuerySurge Agent-local Statsmon services. On each Agent machine:
- Windows - Using the Windows Services console, stop the QuerySurgeStatsmon service.
- Linux - Use the following command:
-
Distribution with init.d:
service QuerySurge stop statsmon -
Distribution with systemd:
<install_dir>/QuerySurge/querysurge.sh stop statsmon
-
Distribution with init.d:
- Shut down QuerySurge Tomcat-local Statsmon:
Note: If QuerySurge components are installed on the same box, a single QuerySurgeStatsmon service is installed for all.- Windows - Using the Windows Services console, stop the QuerySurgeStatsmon service.
- Linux - Use the following command:
-
Distribution with init.d:
service QuerySurge stop statsmon -
Distribution with systemd:
<install_dir>/QuerySurge/querysurge.sh stop statsmon
-
Distribution with init.d:
- Shut down QuerySurge MySQL-local Statsmon:
- Windows - Using the Windows Services console, stop the QuerySurgeStatsmon service.
- Linux - Use the following command:
-
Distribution with init.d:
service QuerySurge stop statsmon -
Distribution with systemd:
<install_dir>/QuerySurge/querysurge.sh stop statsmon
-
Distribution with init.d:
- Shut down the QuerySurge Tomcat service:
- Windows - Using the Windows Services console, stop the QuerySurgeTomcat service.
- Linux - Use the following command:
-
Distribution with init.d:
service QuerySurge stop tomcat -
Distribution with systemd:
<install_dir>/QuerySurge/querysurge.sh stop tomcat
-
Distribution with init.d:
- Shut down the QuerySurge MySQL database:
Note: If you are preparing for a database backup, it is strongly recommended that you use the "slow shutdown" option for MySQL (see the article on backups here).
In other scenarios, where a slow shutdown is not necessary:- Windows - Using the Windows Services console, stop the QuerySurgeMySQL service.
- Linux - Use the following command:
-
System with init.d:
service QuerySurge stop mysql -
System with systemd:
<install_dir>/QuerySurge/querysurge.sh stop mysql
-
System with init.d:
How to Start QuerySurge Services
QuerySurge services must be started in the following order:
- MySQL
- Tomcat
- MySQL-local Statsmon
- Tomcat-local Statsmon
- Agent(s)
- Agent-local Statsmon
To start the services:
- Start all QuerySurge Services on the same machine (available on Linux):
- Linux - Use the following command:
-
System with init.d:
service QuerySurge start -
System with systemd:
systemctl start QuerySurge
-
System with init.d:
- Linux - Use the following command:
- Start the QuerySurge MySQL database:
- Windows - Using the Windows Services console, start the QuerySurgeMySQL service.
- Linux - Use the following command:
-
System with init.d:
service QuerySurge start mysql -
System with systemd:
<install_dir>/QuerySurge/querysurge.sh start mysql
-
System with init.d:
- Start the QuerySurge Tomcat App server:
- Windows - Using the Windows Services console, start the QuerySurgeTomcat service.
- Linux - Use the following command:
-
System with init.d:
service QuerySurge start tomcat -
System with systemd:
<install_dir>/QuerySurge/querysurge.sh start tomcat
-
System with init.d:
- Start QuerySurge MySQL-local Statsmon:
- Windows - Using the Windows Services console, start the QuerySurgeStatsmon service.
- Linux - Use the following command:
-
System with init.d:
service QuerySurge start statsmon -
System with systemd:
<install_dir>/QuerySurge/querysurge.sh start statsmon
-
System with init.d:
- Start QuerySurge Tomcat-local Statsmon:
- Windows - Using the Windows Services console, start the QuerySurgeStatsmon service.
- Linux - Use the following command:
-
System with init.d:
service QuerySurge start statsmon -
System with systemd:
<install_dir>/QuerySurge/querysurge.sh start statsmon
-
System with init.d:
- Start all QuerySurge Agents. On each Agent machine:
- Windows - Using the Windows Services console, start the QuerySurgeAgent service.
- Linux - Use the following command:
-
System with init.d:
service QuerySurge start agent -
System with systemd:
<install_dir>/QuerySurge/querysurge.sh start agent
-
System with init.d:
- Start QuerySurge Agent-local Statsmon on each Agent box:
- Windows - Using the Windows Services console, start the QuerySurgeStatsmon service.
- Linux - Use the following command:
-
System with init.d:
service QuerySurge start statsmon -
System with systemd:
<install_dir>/QuerySurge/querysurge.sh start statsmon
-
System with init.d: