温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

server1_nobinlog, Error: Too many connections

发布时间:2020-06-07 16:20:44 阅读:702 作者:mysql运维 栏目:MySQL数据库
亿速云云数据库,读写分离,安全稳定,弹性扩容,低至0.3元/天!! 点击查看>>

运维人员直接把测试的机器重启了,/usr目录不存在,重新安装新的mysql,接着测试库重启myshard,有些端口能起来,有些不能起来

root@ubuntu:/data/rds/myshard/bin# ./shard_ctrl status
shard_d 0 is down
shard_d 11 is working
shard_d 12 is working
shard_d 13 is working
shard_d 14 is down
shard_d 15 is down
shard_d 16 is down
shard_d 17 is down

查看不能起来端口的日志

May 18 11:25:54 info shard_live_test_111_d[17763]HAVE_EPOLL
May 18 11:25:54 debug shard_live_test_111_d[17763]output queue ok
May 18 11:25:54 debug shard_live_test_111_d[17763]output queue ok
May 18 11:25:54 notice shard_live_test_111_d[17763]inc pooltypeMySQLnameserver1cur1min20max20idle0 [PartitionConnectionPool.cpp, #76]
May 18 11:25:54 notice shard_live_test_111_d[17763]inc pooltypeMySQLnameserver1cur2min20max20idle1 [PartitionConnectionPool.cpp, #76]
May 18 11:25:54 notice shard_live_test_111_d[17763]inc pooltypeMySQLnameserver1cur3min20max20idle2 [PartitionConnectionPool.cpp, #76]
May 18 11:25:54 notice shard_live_test_111_d[17763]inc pooltypeMySQLnameserver1cur4min20max20idle3 [PartitionConnectionPool.cpp, #76]
May 18 11:25:54 notice shard_live_test_111_d[17763]inc pooltypeMySQLnameserver1cur5min20max20idle4 [PartitionConnectionPool.cpp, #76]
May 18 11:25:54 notice shard_live_test_111_d[17763]inc pooltypeMySQLnameserver1cur6min20max20idle5 [PartitionConnectionPool.cpp, #76]
May 18 11:25:54 notice shard_live_test_111_d[17763]inc pooltypeMySQLnameserver1cur7min20max20idle6 [PartitionConnectionPool.cpp, #76]
May 18 11:25:54 notice shard_live_test_111_d[17763]inc pooltypeMySQLnameserver1cur8min20max20idle7 [PartitionConnectionPool.cpp, #76]
May 18 11:25:54 notice shard_live_test_111_d[17763]inc pooltypeMySQLnameserver1cur9min20max20idle8 [PartitionConnectionPool.cpp, #76]
May 18 11:25:54 notice shard_live_test_111_d[17763]inc pooltypeMySQLnameserver1cur10min20max20idle9 [PartitionConnectionPool.cpp, #76]
May 18 11:25:54 notice shard_live_test_111_d[17763]inc pooltypeMySQLnameserver1cur11min20max20idle10 [PartitionConnectionPool.cpp, #76]
May 18 11:25:54 notice shard_live_test_111_d[17763]inc pooltypeMySQLnameserver1cur12min20max20idle11 [PartitionConnectionPool.cpp, #76]
May 18 11:25:54 notice shard_live_test_111_d[17763]inc pooltypeMySQLnameserver1cur13min20max20idle12 [PartitionConnectionPool.cpp, #76]
May 18 11:25:54 notice shard_live_test_111_d[17763]inc pooltypeMySQLnameserver1cur14min20max20idle13 [PartitionConnectionPool.cpp, #76]
May 18 11:25:54 notice shard_live_test_111_d[17763]inc pooltypeMySQLnameserver1cur15min20max20idle14 [PartitionConnectionPool.cpp, #76]
May 18 11:25:54 notice shard_live_test_111_d[17763]inc pooltypeMySQLnameserver1cur16min20max20idle15 [PartitionConnectionPool.cpp, #76]
May 18 11:25:54 notice shard_live_test_111_d[17763]inc pooltypeMySQLnameserver1cur17min20max20idle16 [PartitionConnectionPool.cpp, #76]
May 18 11:25:54 notice shard_live_test_111_d[17763]inc pooltypeMySQLnameserver1cur18min20max20idle17 [PartitionConnectionPool.cpp, #76]
May 18 11:25:54 notice shard_live_test_111_d[17763]inc pooltypeMySQLnameserver1cur19min20max20idle18 [PartitionConnectionPool.cpp, #76]
May 18 11:25:54 notice shard_live_test_111_d[17763]inc pooltypeMySQLnameserver1cur20min20max20idle19 [PartitionConnectionPool.cpp, #76]
May 18 11:25:54 notice shard_live_test_111_d[17763]inc pooltypeMySQLnameserver1_nobinlogcur1min20max20idle0 [PartitionConnectionPool.cpp, #76]
May 18 11:25:54 notice shard_live_test_111_d[17763]inc pooltypeMySQLnameserver1_nobinlogcur2min20max20idle1 [PartitionConnectionPool.cpp, #76]
May 18 11:25:54 notice shard_live_test_111_d[17763]inc pooltypeMySQLnameserver1_nobinlogcur3min20max20idle2 [PartitionConnectionPool.cpp, #76]
May 18 11:25:54 err shard_live_test_111_d[17763]Failed to connect to databaseserver1_nobinlogErrorToo many connections
May 18 11:25:54 err shard_live_test_111_d[17763]build pool error[PartitionConnectionPool.cpp, #69]
May 18 11:25:54 err shard_live_test_111_d[17763]build pool [server1_nobinlog] error [PartitionServerPools.cpp, #141]
May 18 11:25:54 err shard_live_test_111_d[17763]Build Pools failed[db_proxy.cpp, #153]

发现myshard报mysql的连接数已经满了,加大连接数

mysql> show variables like 'max_connections';
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| max_connections | 151   |
+-----------------+-------+
1 row in set (0.00 sec)
mysql> 
mysql> 
mysql> set global max_connections = 1000;
Query OK, 0 rows affected (0.00 sec)

再次重启myshard的端口,就可以顺利启动了

root@ubuntu:/data/rds/myshard/bin# ./shard_ctrl status
shard_d 0 is down
shard_d 11 is working
shard_d 12 is working
shard_d 13 is working
shard_d 14 is working
shard_d 15 is working
shard_d 16 is working
shard_d 17 is working

这时发现810端口还是起不来,看日志报一个binlog_sync.properties文件不存在

May 18 11:39:08 notice shard_live_test_100_d[24364]: inc pool, type: MySQL, name: server1_nobinlog, cur: 17min20max20, idle: 16 [PartitionConnectionPool.cpp, #76]
May 18 11:39:08 notice shard_live_test_100_d[24364]: inc pool, type: MySQL, name: server1_nobinlog, cur: 18min20max20, idle: 17 [PartitionConnectionPool.cpp, #76]
May 18 11:39:08 notice shard_live_test_100_d[24364]: inc pool, type: MySQL, name: server1_nobinlog, cur: 19min20max20, idle: 18 [PartitionConnectionPool.cpp, #76]
May 18 11:39:08 notice shard_live_test_100_d[24364]: inc pool, type: MySQL, name: server1_nobinlog, cur: 20min20max20, idle: 19 [PartitionConnectionPool.cpp, #76]
May 18 11:39:08 err shard_live_test_100_d[24364]: open binlog sync status file [/data/myshard/live_test/shard_0/binlog_sync.properties] error:[2-No such file or directory] [BinlogSynchronizer.cpp, #77]
May 18 11:39:08 notice shard_live_test_100_d[24364]: dec pool, type: MySQL, name: server1, cur: 19min20max20, idle: 19 [PartitionConnectionPool.cpp, #165]
May 18 11:39:08 notice shard_live_test_100_d[24364]: dec pool, type: MySQL, name: server1, cur: 18min20max20, idle: 18 [PartitionConnectionPool.cpp, #165]
May 18 11:39:08 notice shard_live_test_100_d[24364]: dec pool, type: MySQL, name: server1, cur: 17min20max20, idle: 17 [PartitionConnectionPool.cpp, #165]
May 18 11:39:08 notice shard_live_test_100_d[24364]: dec pool, type: MySQL, name: server1, cur: 16min20max20, idle: 16 [PartitionConnectionPool.cpp, #165]

这个文件是记录myshard下面MySQL生成binlog的位置点,相当于mysql-bin.index的,但大小是0,

root@ubuntu:/data/myshard/live_test/shard_0# ls -l
total 12
-rw-r--r-- 1 root root    0 May 17 18:52 binlog_sync.properties
drwxr-xr-x 2 root root 4096 May 17 00:00 deleted
drwxr-xr-x 2 root root 4096 May 17 00:00 local
drwxr-xr-x 2 root root 4096 May 17 00:00 remote
-rw------- 1 root root    0 May 18 11:39 shard.lock

因为更换了MySQL,所以可以把它删除掉,让它重新生成新的位置点,重启8810成功了

May 18 11:44:23 info shard_live_test_100_d[25977]: HAVE_EPOLL
May 18 11:44:23 debug shard_live_test_100_d[25977]: output queue ok
May 18 11:44:23 debug shard_live_test_100_d[25977]: output queue ok
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1, cur: 1min20max20, idle: 0 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1, cur: 2min20max20, idle: 1 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1, cur: 3min20max20, idle: 2 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1, cur: 4min20max20, idle: 3 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1, cur: 5min20max20, idle: 4 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1, cur: 6min20max20, idle: 5 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1, cur: 7min20max20, idle: 6 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1, cur: 8min20max20, idle: 7 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1, cur: 9min20max20, idle: 8 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1, cur: 10min20max20, idle: 9 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1, cur: 11min20max20, idle: 10 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1, cur: 12min20max20, idle: 11 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1, cur: 13min20max20, idle: 12 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1, cur: 14min20max20, idle: 13 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1, cur: 15min20max20, idle: 14 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1, cur: 16min20max20, idle: 15 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1, cur: 17min20max20, idle: 16 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1, cur: 18min20max20, idle: 17 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1, cur: 19min20max20, idle: 18 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1, cur: 20min20max20, idle: 19 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1_nobinlog, cur: 1min20max20, idle: 0 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1_nobinlog, cur: 2min20max20, idle: 1 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1_nobinlog, cur: 3min20max20, idle: 2 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1_nobinlog, cur: 4min20max20, idle: 3 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1_nobinlog, cur: 5min20max20, idle: 4 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1_nobinlog, cur: 6min20max20, idle: 5 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1_nobinlog, cur: 7min20max20, idle: 6 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1_nobinlog, cur: 8min20max20, idle: 7 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1_nobinlog, cur: 9min20max20, idle: 8 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1_nobinlog, cur: 10min20max20, idle: 9 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1_nobinlog, cur: 11min20max20, idle: 10 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1_nobinlog, cur: 12min20max20, idle: 11 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1_nobinlog, cur: 13min20max20, idle: 12 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1_nobinlog, cur: 14min20max20, idle: 13 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1_nobinlog, cur: 15min20max20, idle: 14 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1_nobinlog, cur: 16min20max20, idle: 15 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1_nobinlog, cur: 17min20max20, idle: 16 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1_nobinlog, cur: 18min20max20, idle: 17 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1_nobinlog, cur: 19min20max20, idle: 18 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: inc pool, type: MySQL, name: server1_nobinlog, cur: 20min20max20, idle: 19 [PartitionConnectionPool.cpp, #76]
May 18 11:44:23 notice shard_live_test_100_d[25977]: trying connect to [127.0.0.1:12505,local]...... [BinlogScratcher.cpp, #64]
May 18 11:44:23 notice shard_live_test_100_d[25977]: trying connect to [127.0.0.1:12505,remote]...... [BinlogScratcher.cpp, #64]
May 18 11:44:23 err shard_live_test_100_d[25977]: open connect [127.0.0.1:12505,local] ,error:[111:Connection refused] [BinlogScratcher.cpp, #71]
May 18 11:44:23 err shard_live_test_100_d[25977]: open connect [127.0.0.1:12505,remote] ,error:[111:Connection refused] [BinlogScratcher.cpp, #71]
May 18 11:44:23 info shard_live_test_100_d[25977]: create listen port 8810 success
May 18 11:44:23 info shard_live_test_100_d[25977]: server start, epoll_prt=0x1d9d630
May 18 11:44:33 notice shard_live_test_100_d[25977]: request:0 proc:0 droped:0 active:0

重新生成位置文件了

root@ubuntu:/data/myshard/live_test/shard_0# cat binlog_sync.properties
<?xml version="1.0"?>
<properties>
        <property name="local-offset" value="0"/>
        <property name="remote-offset" value="0"/>
</properties>

亿速云「云数据库 MySQL」免部署即开即用,比自行安装部署数据库高出1倍以上的性能,双节点冗余防止单节点故障,数据自动定期备份随时恢复。点击查看>>

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI

开发者交流群×