本节介绍如何在 UNIX、Linux 和 Mac 平台上控制 MySQL Enterprise Service Manager 服务。Microsoft Windows 支持多种附加方法, 在 Windows 上启动/停止 MySQL Enterprise Monitor Services中进行了描述。
以下服务由 MySQL Enterprise Service Manager 安装:
MySQL服务器
Tomcat 服务器
使用安装在 MySQL Enterprise Service Manager 安装目录根目录中
的脚本
mysqlmonitorctl.sh
/访问 MySQL Enterprise Service Manager 服务。mysqlmonitor.bat
要查看可用选项,请运行命令 mysqlmonitorctl.sh help
。
该help
参数产生以下输出:
$>./mysqlmonitorctl.sh help
./mysqlmonitorctl.sh (start|stop|status|restart)
./mysqlmonitorctl.sh (start|stop|status|restart) mysql
./mysqlmonitorctl.sh (start|stop|status|restart) tomcat
help - this screen
start - start the service(s)
stop - stop the service(s)
restart - restart or start the service(s)
status - report the status of the service
要自动启动所有 Service Manager 组件,请
mysqlmonitorctl.sh start
从您的启动脚本中调用。
启动服务:
$> ./mysqlmonitorctl.sh start
./mysqlmonitorctl.sh : mysql started
nohup: redirecting stderr to stdout
Starting mysqld daemon with databases from /opt/mysql/enterprise/monitor/mysql/data/
Using CATALINA_BASE: /opt/mysql/enterprise/monitor/apache-tomcat
Using CATALINA_HOME: /opt/mysql/enterprise/monitor/apache-tomcat
Using CATALINA_TMPDIR: /opt/mysql/enterprise/monitor/apache-tomcat/temp
Using JRE_HOME: /opt/mysql/enterprise/monitor/java
如果您尝试启动服务并且它已经在运行,则会警告您服务已经在运行。
该restart
命令相当于执行一个stop
and thenstart
操作。
服务管理器可能需要一些时间才能启动并在完成后变得可用mysqlmonitorctl.sh start
。
此脚本还可以检查 Tomcat Web 服务器或 MySQL 存储库的状态。
$> ./mysqlmonitorctl.sh status
MySQL Network MySQL is running
MySQL Network Tomcat is running
安装服务管理器后,您可以配置 MySQL 企业监视器用户界面,如 第 4.5 节“MySQL 企业服务管理器配置设置”中所述。
您可以通过以下其他方式停止或启动 MySQL Enterprise Service Manager 服务:
Windows 开始菜单上的启动/停止 MySQL Enterprise Monitor Services项。
Microsoft 管理控制台 的服务面板 。右键单击任一MySQL Enterprise服务以显示可用选项。
Windows 命令行,使用
sc
或net
命令。在命令行中,服务名称为 mysqlenterprisetomcat和 mysqlenterprisemysql。
例如:
$> sc start mysqlenterprisemysql
笔记必须使用 以管理员身份运行选项启动命令行终端。