Recently, a new MySQL instance has been added to the server where MySQL Enterprise monitor has been deployed, causing the MySQL Enterprise monitor to crash unexpectedly and fail to restart successfully. An error message was received with BIND on TCP/IP port:address already in use. Here is a solution to this problem for your reference.
1, fault phenomenon
[[email protected] init.d]#./mysql-monitor-server start
Starting MySQL service [OK]
150127 09:57:34 mysqld_safe Logging to '/opt/mysql/enterprise/monitor/mysql/runtime/mysqld.log '.
150127 09:57:35 Mysqld_safe starting mysqld daemon with databases from/opt/mysql/enterprise/monitor/mysql/data/
./MYSQL-MONITOR-SERVER:TOMCAT (PID 28303) already running
150127 09:57:42 mysqld_safe mysqld from PID File/opt/mysql/enterprise/monitor/mysql/runtime/mysqld.pid ended
2. Fault Analysis
#查看日志, prompt for bind on TCP/IP port:address already in use, address is used, as follows
[Email protected] init.d]# tail-100/opt/mysql/enterprise/monitor/mysql/runtime/mysqld.log |grep "ERROR"-A5
2015-01-27 09:57:36 30753 [ERROR] Can ' t start server:bind on TCP/IP port:address already in use
2015-01-27 09:57:36 30753 [ERROR] Do you already has another MYSQLD server running on port:13306?
2015-01-27 09:57:36 30753 [ERROR] Aborting
2015-01-27 09:57:36 30753 [Note] Binlog End
2015-01-27 09:57:36 30753 [Note] shutting down plugin ' partition '
2015-01-27 09:57:36 30753 [Note] shutting down plugin ' ARCHIVE '
2015-01-27 09:57:36 30753 [Note] shutting down plugin ' blackhole '
2015-01-27 09:57:36 30753 [Note] shutting down plugin ' ARCHIVE '
2015-01-27 09:57:36 30753 [Note] shutting down plugin ' blackhole '
#根据上述错误提示, verify that the default MySQL Enterprise monitor port number 13306, as below, is not occupied
[[email protected] init.d]# netstat-nltp|grep MySQL
TCP 0 0::: 3306:::* LISTEN 8734/mysqld
TCP 0 0::: 3307:::* LISTEN 9489/mysqld
3, fault resolution
#故障现象里有一个提示为tomcat (PID 28303) already running
#这个引起了我的注意, so try to kill the Tomcat-related process first
[Email protected] init.d]# Ps-ef|grep 28303|grep-v grep
Mysqlmem 28303 28302 4 Jan20? 07:35:03 Jsvc.exec-java-home/opt/mysql/enterprise/monitor/java
-user mysqlmem-pidfile/opt/mysql/enterprise/monitor/apache-tomcat/temp/catalina.pid-wait 10-outfile
/opt/mysql/enterprise/monitor/apache-tomcat/logs/catalina-daemon.out-errfile &1-classpath
/opt/mysql/enterprise/monitor/apache-tomcat/bin/bootstrap.jar:
/opt/mysql/enterprise/monitor/apache-tomcat/bin/commons-daemon.jar:
/opt/mysql/enterprise/monitor/apache-tomcat/bin/tomcat-juli.jar-dnop-xmx768m-xms768m
-xx:+heapdumponoutofmemoryerror-xx:heapdumppath=/opt/mysql/enterprise/monitor/apache-tomcat/temp
-xx:+useparalleloldgc-xx:maxpermsize=512m-djava.util.logging.manager=org.apache.juli.classloaderlogmanager
-djava.endorsed.dirs=-dcatalina.base=/opt/mysql/enterprise/monitor/apache-tomcat
-dcatalina.home=/opt/mysql/enterprise/monitor/apache-tomcat
-djava.io.tmpdir=/opt/mysql/enterprise/monitor/apache-tomcat/temp Org.apache.catalina.startup.Bootstrap
[Email protected] init.d]# kill-9 28303
#再次检查是否有tomcat相关进程存在, kill Tomcat-related processes individually
[Email protected] init.d]# Ps-ef|grep Tomcat
[Email protected] init.d]# kill-9 28302
[Email protected] init.d]# kill-9 30867
# Author:leshami
# Blog:http://blog.csdn.net/leshami
#再次重新启动mysql em, start normal at this time
[[email protected] init.d]#./mysql-monitor-server start
Starting MySQL service [OK]
150127 10:16:08 mysqld_safe Logging to '/opt/mysql/enterprise/monitor/mysql/runtime/mysqld.log '.
150127 10:16:08 Mysqld_safe starting mysqld daemon with databases from/opt/mysql/enterprise/monitor/mysql/data/
Starting Tomcat service [OK]
#检查mysql the state of EM
[Email protected] init.d]#./mysql-monitor-server status
MySQL Enterprise MySQL is running
MySQL Enterprise Tomcat is running
Port number for #检查mysql
[[email protected] init.d]# netstat-nltp|grep MySQL
TCP 0 0::: 3306:::* LISTEN 8734/mysqld
TCP 0 0::: 3307:::* LISTEN 9489/mysqld
TCP 0 0::: 13306:::* LISTEN 31584/mysqld
MySQL "Bind on TCP/IP port:address already in use"