MySQL "Bind on TCP/IP port: Address already in use"

   最近在已部署MySQL Enterprise Monitor的服务器上新增了MySQL实例,导致MySQL Enterprise Monitor异常宕机了,无法重新启动成功。收到了Bind on TCP/IP port: Address already in use的错误提示。下面是这个问题的解决办法,供大家参考。 1、故障现象 [root@SZAPP03 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、故障分析 #查看日志,提示为Bind on TCP/IP port: Address already in use,地址在使用,如下 [root@SZAPP03 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 have 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' #根据上述错误提示,核查缺省的mysql enterprise monitor 端口号13306,如下,并没有被占用 [root@SZAPP03 init.d]# netstat -nltp|grep mysql tcp        0      0 :::3306                     :::*                        LISTEN      8734/mysqld          tcp        0      0 :::3307                     :::*                        LISTEN      9489/mysqld   

3、故障解决

#故障现象里有一个提示为tomcat  (pid 28303) already running #这个引起了我的注意,于是尝试先kill到tomcat相关进程 [root@SZAPP03 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 [root@SZAPP03 init.d]# kill -9 28303 #再次检查是否有tomcat相关进程存在,逐一kill tomcat相关进程 [root@SZAPP03 init.d]# ps -ef|grep tomcat [root@SZAPP03 init.d]# kill -9 28302 [root@SZAPP03 init.d]# kill -9 30867 # Author : Leshami # Blog   : http://blog.csdn.net/leshami #再次重新启动mysql em,此时启动正常 [root@SZAPP03 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 em的状态 [root@SZAPP03 init.d]# ./mysql-monitor-server status MySQL Enterprise MySQL is running MySQL Enterprise Tomcat is running #检查mysql 的端口号 [root@SZAPP03 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

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

相关文章

来自专栏IT杂记

Linux主机之间ssh免密登录配置

修改ssh配置 每台linux主机修改配置文件/etc/ssh/sshd_config RSAAuthentication yes PubkeyAuthenti...

26810
来自专栏代码拾遗

Spring Boot 2.0 教程 - 日志详解

Spring Boot 内部使用commons logging 作为日志输出工具,同时也可以配置其他的工具例如,Java Logging,Log4j2,log...

1574
来自专栏JadePeng的技术博客

Jhipster Registry(Eureka Server) Docker双向联通与高可用部署

构建Image并push到registry,这里是192.168.86.8:5000/registry-dev

1765
来自专栏Ryan Miao

gradle中使用嵌入式(embedded) tomcat, debug 启动

在gradle项目中使用embedded tomcat。 最开始部署项目需要手动将web项目打成war包,然后手动上传到tomcat的webapp下,然后启动t...

4459
来自专栏Java3y

Druid数据库连接池就是这么简单

前言 本章节主要讲解Druid数据库连接池,为什么要学Druid数据库连接池呢?? 我的知识储备数据库连接池有两种->C3P0,DBCP,可是现在看起来并不够用...

44911
来自专栏逆向技术

调试器编写第一讲,调试器基本框架

                  调试器编写第一讲,调试器基本框架 今天开始调试器第一讲,调试器的基本框架,我们用过很多调试器,比如 WinDbg,Olly...

2515
来自专栏Pythonista

Mac下安装ipython

1892
来自专栏颇忒脱的技术博客

利用VisualVm和JMX远程监控K8S里的Java进程

在利用VisualVm和JMX远程监控Java进程和VisualVm利用SSL连接JMX的方法里介绍了如何使用VisualVm+JMX监控远程Java进程的方法...

2741
来自专栏张善友的专栏

CentOS 安装PostgreSQL 9.1

PostgreSQL通常也简称Postgres,是一个关系型数据库管理系统,适用于各种Linux操作系统、Windows、Solaris、BSD和Mac OS ...

3358
来自专栏运维技术迷

crontab执行python脚本提示ImportError解决方法

早上看到hadoop的计算结果没有进入到mysql数据库,查看关于hadoop计划任务的输出日志发现有报错信息。果断拿来手动执行相关的python脚本,并没有错...

3755

扫码关注云+社区