MySQL Shell 8.0  /  ...  /  Configuring the Host Name

6.2.2 Configuring the Host Name

In a production deployment, the instances in which you use run-on separate machines, therefore each machine must have a unique hostname and be able to resolve the hostnames of the other machines, which run server instances. If this is not the case, you can:

  1. Configure each machine to map the IP of each other machine to a hostname. See your operating system documentation for details. This configuration is the recommended solution.

  2. Set up a Domain Name System (DNS) service.

  3. Configure the report_host variable in the MySQL configuration of each instance to a suitable externally reachable address.

AdminAPI supports using IP addresses instead of host names. From MySQL Shell 8.0.18, AdminAPI supports IPv6 addresses if the target MySQL Server version is higher than 8.0.13.

When using MySQL Shell 8.0.18 or higher, if all cluster instances are running 8.0.14 or higher, then you can use an IPv6 address or a hostname that resolves to an IPv6 address in connection strings and with options such as localAddress and ipAllowlist. For more information on using IPv6, see Support For IPv6 And For Mixed IPv6 And IPv4 Groups.

Previous versions support IPv4 addresses only.

To verify whether the hostname of a MySQL server you have correctly configured, process the following query. This query shows how the instance reports its address to other servers and try to connect to that MySQL server from other hosts using the returned address:

	SELECT coalesce(@@report_host, @@hostname);