Bug #110773 group_replication start faild use different ips and same port on same server
Submitted: 23 Apr 2023 7:56 Modified: 18 Sep 9:55
Reporter: chao wang Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Group Replication Severity:S3 (Non-critical)
Version:mysql 8.0.32 OS:Any
Assigned to: CPU Architecture:Any

[23 Apr 2023 7:56] chao wang
Description:
I try to start 3 MySQL Servers(Server version: 8.0.32) on SAME server that has 3 IP Addresses (192.168.0.100, 192.168.0.101, 192.168.0.102) 
and bind each MySQL server to a different IP address on same server and use group_replication_communication_stack = "MYSQL",
then 3 MySQL server Group replication will start filed on same sever also.
mysql config like this:(every mysql use same port but different ip)

mysql1:
bind_address = 192.168.0.100
port = 3306

admin_address = 192.168.0.100
admin_port = 13306

mysqlx_bind_address = 192.168.0.100
mysqlx_port = 33060

report_host  = 192.168.0.100
report_port  = 3306
group_replication_communication_stack = "MYSQL"

mysql2:
bind_address = 192.168.0.101
port = 3306

admin_address = 192.168.0.101
admin_port = 13306

mysqlx_bind_address = 192.168.0.101
mysqlx_port = 33060

report_host  = 192.168.0.101
report_port  = 3306
group_replication_communication_stack = "MYSQL"

mysql3:
bind_address = 192.168.0.102
port = 3306

admin_address = 192.168.0.102
admin_port = 13306

mysqlx_bind_address = 192.168.0.102
mysqlx_port = 33060

report_host  = 192.168.0.102
report_port  = 3306
group_replication_communication_stack = "MYSQL"

errors:
2023-04-23T00:26:37.518624-07:00 0 [Note] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] Using MySQL as Communication Stack for XCom'
2023-04-23T00:26:37.518789-07:00 0 [Note] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] Successfully connected to the local XCom via anonymous pipe'
2023-04-23T00:26:37.522529-07:00 0 [ERROR] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] Error connecting to all peers. Member join failed. Local port: 3306'
2023-04-23T00:26:37.582697-07:00 0 [ERROR] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] The member was unable to join the group. Local port: 3306'
2023-04-23T00:26:37.582713-07:00 0 [Note] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] Sleeping for 5 seconds before retrying to join the group. There are 9 more attempt(s) before giving up.'
2023-04-23T00:26:42.616372-07:00 0 [Note] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] Using MySQL as Communication Stack for XCom'
2023-04-23T00:26:42.616506-07:00 0 [Note] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] Successfully connected to the local XCom via anonymous pipe'
2023-04-23T00:26:42.617928-07:00 0 [ERROR] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] Error connecting to all peers. Member join failed. Local port: 3306'
2023-04-23T00:26:42.680951-07:00 0 [ERROR] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] The member was unable to join the group. Local port: 3306'
2023-04-23T00:26:42.680967-07:00 0 [Note] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] Sleeping for 5 seconds before retrying to join the group. There are 8 more attempt(s) before giving up.'

=======================================================================
If I use this config(different port), group_replication will start success.

mysql1:
bind_address = 192.168.0.100
port = 3306

admin_address = 192.168.0.100
admin_port = 13306

mysqlx_bind_address = 192.168.0.100
mysqlx_port = 33060

report_host  = 192.168.0.100
report_port  = 3306
group_replication_communication_stack = "MYSQL"

mysql2:
bind_address = 192.168.0.101
port = 3307

admin_address = 192.168.0.101
admin_port = 13307

mysqlx_bind_address = 192.168.0.101
mysqlx_port = 33070

report_host  = 192.168.0.101
report_port  = 3307
group_replication_communication_stack = "MYSQL"

mysql3:
bind_address = 192.168.0.102
port = 3308

admin_address = 192.168.0.102
admin_port = 13308

mysqlx_bind_address = 192.168.0.102
mysqlx_port = 33080

report_host  = 192.168.0.102
report_port  = 3308
group_replication_communication_stack = "MYSQL"
=======================================================================

How to repeat:
on same server(has 3 IP Addresses 192.168.0.100, 192.168.0.101, 192.168.0.102) config like this:

mysql1:
bind_address = 192.168.0.100
port = 3306

admin_address = 192.168.0.100
admin_port = 13306

mysqlx_bind_address = 192.168.0.100
mysqlx_port = 33060

report_host  = 192.168.0.100
report_port  = 3306
group_replication_communication_stack = "MYSQL"

mysql2:
bind_address = 192.168.0.101
port = 3306

admin_address = 192.168.0.101
admin_port = 13306

mysqlx_bind_address = 192.168.0.101
mysqlx_port = 33060

report_host  = 192.168.0.101
report_port  = 3306
group_replication_communication_stack = "MYSQL"

mysql3:
bind_address = 192.168.0.102
port = 3306

admin_address = 192.168.0.102
admin_port = 13306

mysqlx_bind_address = 192.168.0.102
mysqlx_port = 33060

report_host  = 192.168.0.102
report_port  = 3306
group_replication_communication_stack = "MYSQL"
[23 Apr 2023 7:57] chao wang
modify
[7 Jul 20:48] MySQL Admin
Posted by developer: Bug status updated to 'Patch pending'
[17 Jul 14:48] MySQL Admin
Posted by developer: Bug status updated to 'Patch approved'
[17 Jul 20:48] MySQL Admin
Posted by developer: Bug status updated to 'Documenting'
[18 Sep 9:55] Edward Gilmore
Posted by developer:
 
Added the following note to the MySQL Server 26.10.0 release notes:

Group Replication: With the MySQL communication stack, multiple members
on one multihomed host could fail to join when they used different IP
addresses but the same SQL port. Local members are now identified by their
configured endpoint rather than all local interfaces. The XCom stack still
requires distinct localAddress ports. Errors were returned similar to the
following:

[ERROR] [MY-011735] [Repl] Plugin
group_replication reported: '[GCS] Error connecting to all peers. Member
join failed. Local port: 3306' [ERROR] [MY-011735] [Repl] Plugin
group_replication reported: '[GCS] The member was unable to join the
group. Local port: 3306'