这个错误是什么意思(无法创建 TCP/IP 套接字 (24))?

这个错误是什么意思(无法创建 TCP/IP 套接字 (24))?

我在另一台服务器上安装了 OS RHEL 6.2 和 Mysql 5.5.23 的 Web 服务器,并且该 Web 服务器可以毫无问题地从 Mysql 服务器读取数据,但有时我会收到此错误:

[Sun Sep 23 06:13:07 2012] [error] [client XXXXX] DBI connect('XXXX:192.168.1.2:3306','XXX',...) failed: Can't create TCP/IP socket (24) at /var/www/html/file.pm line 199.

我的问题 :

这个错误是什么意思 (无法创建 TCP/IP 套接字 (24))?是操作系统错误还是 Mysql 错误?

perl -v
This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi

mysql -V
mysql  Ver 14.14 Distrib 5.5.23, for Linux (x86_64) using readline 5.1

 su - mysql -s /bin/bash -c 'ulimit -a'
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 127220
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 1024
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

答案1

这个错误是什么意思(Can't create TCP/IP socket (24))?是操作系统错误还是 Mysql 错误?

$ perror 24
OS error code  24:  Too many open files

您可以通过运行以下命令检查当前设置:

# su - mysql -s /bin/bash -c 'ulimit -a'
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 127425
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 1024
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

相关内容