GreatSQL社区

搜索

[已解决] 启动mgr执行start group_replication时报[Warning] Too many connections.

461 6 2023-9-13 17:47
数据库版本:mysql5.7.32   mgr架构,在一个节点上执行start group_replication;后,另外两个节点报[Warning] Too many connections.  这个是什么原因呀 ,具体报错日志:

另外两个节点:

2023-09-13T15:17:15.127047+08:00 0 [Warning] Plugin group_replication reported: 'The member with address l57-149-p0:3306 has already sent the stable set. Therefore discarding the second message.'
2023-09-13T15:17:26.374618+08:00 124906801 [Note] Aborted connection 124906801 to db: '≈' user: '******' host: '10.24.150.0' (Got timeout reading communication packets)
2023-09-13T15:17:32.790664+08:00 124913232 [Note] Aborted connection 124913232 to db: '******' user: '******_rw' host: '10.24.150.0' (Got timeout reading communication packets)
2023-09-13T15:17:35.429143+08:00 124913242 [Note] Aborted connection 124913242 to db: '******' user: '******' host: '10.24.153.0' (Got timeout reading communication packets)
2023-09-13T15:17:35.997557+08:00 0 [Note] Plugin group_replication reported: 'Members joined the group: l57-147-p0:3306'
2023-09-13T15:17:35.997775+08:00 0 [Note] Plugin group_replication reported: 'Group membership changed to l56-245-p0:3306, l57-149-p0:3306, l57-147-p0:3306 on view 16520435931314177:19.'
2023-09-13T15:17:55.057341+08:00 124913294 [Note] Aborted connection 124913294 to db: '******' user: '******' host: '10.24.153.0' (Got timeout reading communication packets)
2023-09-13T15:17:56.427725+08:00 124915147 [Note] Start binlog_dump to master_thread_id(124915147) slave_server(57147), pos(, 4)
2023-09-13T15:17:56.427755+08:00 124915147 [Note] Start asynchronous binlog_dump to slave (server_id: 57147), pos(, 4)
2023-09-13T15:18:03.086520+08:00 124911435 [Note] Aborted connection 124911435 to db: ''*****'' user: '******' host: '10.24.152.0' (Got timeout reading communication packets)
2023-09-13T15:18:03.318524+08:00 124910913 [Note] Aborted connection 124910913 to db: ''*****'' user: '******' host: '10.24.152.0' (Got timeout reading communication packets)
2023-09-13T15:18:03.975331+08:00 124912201 [Note] Aborted connection 124912201 to db: ''*****'' user: '******' host: '10.24.152.0' (Got timeout reading communication packets)
2023-09-13T15:18:09.759593+08:00 0 [Warning] Too many connections
2023-09-13T15:18:10.236628+08:00 0 [Warning] Too many connections
2023-09-13T15:18:10.364998+08:00 0 [Warning] Too many connections
2023-09-13T15:18:14.780407+08:00 0 [Warning] Too many connections
2023-09-13T15:18:15.271558+08:00 0 [Warning] Too many connections
2023-09-13T15:18:15.394847+08:00 0 [Warning] Too many connections
2023-09-13T15:18:15.877647+08:00 124913352 [Note] Aborted connection 124913352 to db: '*****' user: ******' host: '10.24.153.0' (Got timeout reading communication packets)
2023-09-13T15:18:18.474383+08:00 0 [Warning] Too many connections
2023-09-13T15:18:18.613218+08:00 0 [Warning] Too many connections
2023-09-13T15:18:19.647403+08:00 0 [Warning] Too many connections
2023-09-13T15:18:19.800886+08:00 0 [Warning] Too many connections
2023-09-13T15:18:20.303423+08:00 0 [Warning] Too many connections
2023-09-13T15:18:20.431590+08:00 0 [Warning] Too many connections
2023-09-13T15:18:23.511648+08:00 0 [Warning] Too many connections


执行start group_replication节点日志:

2023-09-13T15:17:33.730225+08:00 62778662 [Note] Plugin group_replication reported: 'Group communication SSL configuration: group_replication_ssl_mode: "DISABLED"'
2023-09-13T15:17:33.730646+08:00 62778662 [Warning] Plugin group_replication reported: '[GCS] Automatically adding IPv4 localhost address to the whitelist. It is mandatory that it is added.'
2023-09-13T15:17:33.730700+08:00 62778662 [Note] Plugin group_replication reported: '[GCS] SSL was not enabled'
2023-09-13T15:17:33.730717+08:00 62778662 [Note] Plugin group_replication reported: 'Initialized group communication with configuration: group_replication_group_name: "aaaaaaaa-aaaa-aaaa-aaaa-202006091055"; group_replication_local_address: "10.10.57.147:24901"; group_replication_group_seeds: "10.10.57.147:24901,10.10.57.149:24901,10.10.56.245:24901"; group_replication_bootstrap_group: false; group_replication_poll_spin_loops: 0; group_replication_compression_threshold: 131072; group_replication_ip_whitelist: "10.10.56.0/22"'
2023-09-13T15:17:33.730753+08:00 62778662 [Note] Plugin group_replication reported: '[GCS] Configured number of attempts to join: 0'
2023-09-13T15:17:33.730762+08:00 62778662 [Note] Plugin group_replication reported: '[GCS] Configured time between attempts to join: 5 seconds'
2023-09-13T15:17:33.730779+08:00 62778662 [Note] Plugin group_replication reported: 'Member configuration: member_id: 57147; member_uuid: "b7b075b6-7dd3-11ec-95c7-000000bfbad6"; single-primary mode: "true"; group_replication_auto_increment_increment: 7; '
2023-09-13T15:17:33.732559+08:00 62779002 [Note] 'CHANGE MASTER TO FOR CHANNEL 'group_replication_applier' executed'. Previous state master_host='<NULL>', master_port= 0, master_log_file='', master_log_pos= 137254136616, master_bind=''. New state master_host='<NULL>', master_port= 0, master_log_file='', master_log_pos= 4, master_bind=''.
2023-09-13T15:17:33.746427+08:00 62779005 [Note] Slave SQL thread for channel 'group_replication_applier' initialized, starting replication in log 'FIRST' at position 0, relay log './relaylog-group_replication_applier.000448' position: 4
2023-09-13T15:17:33.746457+08:00 62778662 [Note] Plugin group_replication reported: 'Group Replication applier module successfully initialized!'
2023-09-13T15:17:33.746483+08:00 62778662 [Note] Plugin group_replication reported: 'auto_increment_increment is set to 7'
2023-09-13T15:17:33.746488+08:00 62778662 [Note] Plugin group_replication reported: 'auto_increment_offset is set to 57147'
2023-09-13T15:17:33.746665+08:00 0 [Note] Plugin group_replication reported: 'XCom protocol version: 3'
2023-09-13T15:17:33.746699+08:00 0 [Note] Plugin group_replication reported: 'XCom initialized and ready to accept incoming connections on port 24901'
2023-09-13T15:17:35.993590+08:00 62778662 [Note] Plugin group_replication reported: 'This server is working as secondary member with primary member address l57-149-p0:3306.'
2023-09-13T15:17:35.993971+08:00 0 [Note] Plugin group_replication reported: 'Group membership changed to l56-245-p0:3306, l57-149-p0:3306, l57-147-p0:3306 on view 16520435931314177:19.'
2023-09-13T15:17:56.395217+08:00 62779022 [Note] Plugin group_replication reported: 'Establishing group recovery connection with a possible donor. Attempt 1/10'
2023-09-13T15:17:56.405434+08:00 62779022 [Note] 'CHANGE MASTER TO FOR CHANNEL 'group_replication_recovery' executed'. Previous state master_host='<NULL>', master_port= 0, master_log_file='', master_log_pos= 4, master_bind=''. New state master_host='l57-149-p0', master_port= 3306, master_log_file='', master_log_pos= 4, master_bind=''.
2023-09-13T15:17:56.412440+08:00 62779022 [Note] Plugin group_replication reported: 'Establishing connection to a group replication recovery donor b3e4e604-7b55-11ec-bd1a-0000004be1ce at l57-149-p0 port: 3306.'
2023-09-13T15:17:56.413122+08:00 62779075 [Note] Slave I/O thread: Start asynchronous replication to master 'rpl_user@l57-149-p0:3306' in log 'FIRST' at position 4
2023-09-13T15:17:56.413785+08:00 62779075 [Warning] Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
2023-09-13T15:17:56.415925+08:00 62779075 [Note] Slave I/O thread for channel 'group_replication_recovery': connected to master 'rpl_user@l57-149-p0:3306',replication started in log 'FIRST' at position 4
2023-09-13T15:17:56.417284+08:00 62779076 [Note] Slave SQL thread for channel 'group_replication_recovery' initialized, starting replication in log 'FIRST' at position 0, relay log './relaylog-group_replication_recovery.000001' position: 4



全部回复(6)
yejr 2023-9-13 17:54:32
max_connections 和  max_user_connections 分别设置多大
KAiTO 2023-9-13 17:55:39
max_connections值是否设置合理,是否调大一些可以解决
pengzhaojing 2023-9-13 19:21:13
yejr 发表于 2023-9-13 17:54
max_connections 和  max_user_connections 分别设置多大

4096
pengzhaojing 2023-9-13 19:29:53
KAiTO 发表于 2023-9-13 17:55
max_connections值是否设置合理,是否调大一些可以解决

4096  我可以调大一些测试一下  但我觉得这不是根本原因
chongzh 2023-9-13 21:02:02
有可能是如下原因

1.最大连接数设置得太低
Max_used_connections
Max_used_connections_time

2.文件描述符限制太小
考虑一下my.cnf中的open_files_limit=64000,如果使用systemd的话LimitNOFILE=64000( /etc/security/limits.conf also 64000)

3.连接未关闭   
wait_timeout=900 或者更小

4. 其他linux内核参数过小
喜欢就关注我公众号:DBA烂笔头
yejr 2023-9-14 09:07:54
正常情况下,出现Too many connections和MGR切主没直接关系。

较大的可能是,在切主时有短暂卡顿,应用端反应过度,导致瞬间连接爆满。
pengzhaojing

1

主题

0

博客

4

贡献

新手上路

Rank: 1

积分
7

合作电话:010-64087828

社区邮箱:greatsql@greatdb.com

社区公众号
社区小助手
QQ群
GMT+8, 2024-5-7 13:23 , Processed in 0.017438 second(s), 14 queries , Redis On.
快速回复 返回顶部 返回列表