WL#11652: Support multiple addresses for the --bind-address command option

Affects: Server-8.0   —   Status: Complete

The MySQL server can be configured to listen to:
1) One (and only one) IPv4 interface and one(and only one) IPv6 interface
 or
2) All interfaces that are configured on a server.
See
https://dev.mysql.com/doc/refman/5.7/en/server-options.html#option_mysqld_bind-
address

If at OS level, the server has multiple networks addresses, there is a need to
configure the MySQL server to listen to a set of addresses. This will enable the
MySQL server to restrict an address the server should *not* listen to as well.

A typical example is to have network segments split on parts like:

1. Business flow
2. Management and monitoring
3. Backup

Through the current --bind-address config variable, it is not possible to
configure the MySQL server to listen to only two network addresses.

User's Use case.
================
This worklog was inspired by user requests. Example of one such request
is quoted below:
Currently, mysql seems to support only exactly one IP address to bind to
(besides binding to IN_ADDR_ANY that means all addresses).

This is a disadvantage in HA Cluster configurations, where a cluster
framework stops/starts stand-alone mysql instances (non-NDB) on
physical servers within a cluster.

Within such frameworks, you don't want to bind to IN_ADDR_ANY
but rather to specific IP adresses in order to allow the cluster framework
to switch two instances of an application onto the same cluster node
(with the same (standard) port number).

This is currently possible with mysql, but only for exacly one IP address
per mysql instance.

In situations where you need more than one IP address for an HA
instance, you either have to bind to IN_ADDR_ANY and somehow
make sure that no two mysql instances will run on any cluster node
at the same time, or find other means by which to provide the second
address (tcp forwarder, NAT on a firewall - whatever).

Both solutions are not ideal, so this feature request is for a configuration
option allowing more than one IP address to be specified.
 

General description of a way to satisfy user's Feature Request.
===============================================================
The suggestion is to support a comma separated list of bind-addresses the
MySQL server should listen to incoming connections. Since the system call
"bind" only supports listening to one or all configured addresses of a server, 
separate sockets need to be configured per network address given in this list.
This will be very sensitive to connect performance, and should be implemented
in a way that if only one address is given to --bind-address, this penalty
is minimized.

The list of addresses cannot accept any of the wildcard options. The server
should not start if any of the addresses given through the --bind-address
option is not available at OS level.

Worklog scope
=============
This worklog won't affect Xplugin or Group Replication including XCom
in any way.

References.
===========
http://bugs.mysql.com/bug.php?id=14979