Prerequisites
To enable FQDN access for a cluster, make sure the following requirements are satisfied:- Each machine in the cluster must have a hostname.
- In the file /etc/hosts on each machine, you must specify the corresponding IP addresses and FQDNs of other machines in the cluster.
- IP addresses in the /etc/hosts file must be unique.
Set up a new cluster with FQDN access
By default, FE nodes in a new cluster are started via IP address access. To start a new cluster with FQDN access, you must start the FE nodes by running the following commands when you start the cluster for the first time:--host_type specifies the access method that is used to start the node. Valid values include FQDN and IP. You only need to specify this property ONCE when you start the node for the first time.
Each BE node identifies itself with BE Address defined in the FE metadata. Therefore, you DO NOT need to specify --host_type when you start BE nodes. If the BE Address defines a BE node with an FQDN, the BE node identifies itself with this FQDN.
Enable FQDN access in an existing cluster
To enable FQDN access in an existing cluster that was previously started via IP addresses, you must first upgrade the database to version 2.4.0 or later.Enable FQDN access for FE nodes
You need to enable FQDN access for all the non-Leader Follower FE nodes before enabling that for the Leader FE node.CAUTION Make sure that the cluster has at least three Follower FE nodes before you enable FQDN access for FE nodes.
Enable FQDN access for non-Leader Follower FE nodes
-
Navigate to the deployment directory of the FE node, and run the following command to stop the FE node:
-
Execute the following statement via your MySQL client to check the
Alivestatus of the FE node that you have stopped. Wait until theAlivestatus becomesfalse. -
Execute the following statement to replace the IP address with FQDN.
-
Run the following command to start the FE node with FQDN access.
The property
--host_typespecifies the access method that is used to start the node. Valid values includeFQDNandIP. You only need to specify this property ONCE when you restart the node after you modify the node. -
Check the
Alivestatus of the FE node. Wait until theAlivestatus becomestrue. -
Repeat the above steps to enable FQDN access for the other non-Leader Follower FE nodes one after another when the
Alivestatus of the current FE node istrue.
Enable FQDN access for the Leader FE node
After all the non-Leader FE nodes have been modified and restarted successfully, you can now enable FQDN access for the Leader FE node.NOTE Before the Leader FE node is enabled with FQDN access, the FQDNs used to add nodes to a cluster are still transformed into the corresponding IP addresses. After a Leader FE node with FQDN access enabled is elected for the cluster, the FQDNs will not be transformed into IP addresses.
-
Navigate to the deployment directory of the Leader FE node, and run the following command to stop the Leader FE node.
-
Execute the following statement via your MySQL client to check whether a new Leader FE node has been elected for the cluster.
Any FE node with status
AliveandisMasterbeingtrueis a Leader FE that is running. -
Execute the following statement to replace the IP address with FQDN.
-
Run the following command to start the FE node with FQDN access.
The property
--host_typespecifies the access method that is used to start the node. Valid values includeFQDNandIP. You only need to specify this property ONCE when you restart the node after you modify the node. -
Check the
Alivestatus of the FE node.
Alive status becomes true, the FE node is successfully modified and added to the cluster as a Follower FE node.
Enable FQDN access for BE nodes
Execute the following statement via your MySQL client to replace the IP address with FQDN to enable FQDN access for the BE node.NOTE You DO NOT need to restart the BE node after FQDN access is enabled.
Rollback
To rollback an FQDN access-enabled cluster to an earlier version that does not support FQDN access, you must first enable IP address access for all nodes in the cluster. You can refer Enable FQDN access in an existing cluster for the general guidance except that you need to change the SQL commands to the following ones:- Enable IP address access for an FE node:
- Enable IP address access for a BE node: