This article introduces how to enable the use of Apache Doris based on FQDN (Fully Qualified Domain Name). FQDN is the complete domain name of a specific computer or host on the Internet.
After Doris supports FQDN, communication between nodes is entirely based on FQDN. When adding various types of nodes, the FQDN should be directly specified. For example, the command to add a BE node is' ALT SYSTEM ADD BACK END "be_host: eartbeat_service_port",
'behost' was previously the IP address of the BE node. After starting the FQDN, be The host should specify the FQDN of the BE node.
- fe.conf file set
enable_fqdn_mode = true.
- All machines in the cluster must be configured with a host name.
- The IP address and FQDN corresponding to other machines in the cluster must be specified in the '/etc/hosts' file for each machine in the cluster.
- /The etc/hosts file cannot have duplicate IP addresses.
Enable FQDN for new cluster
- Prepare machines, for example, if you want to deploy a cluster of 3FE 3BE, you can prepare 6 machines.
- Each machine returns unique results when executing 'host'. Assuming that the execution results of six machines are fe1, fe2, fe3, be1, be2, and be3, respectively.
- Configure the real IPs corresponding to 6 FQDNs in the '/etc/hosts' of 6 machines, for example:
- Verification: It can 'ping fe2' on FE1, and can resolve the correct IP address and ping it, indicating that the network environment is available.
- fe.conf settings for each FE node
enable_ fqdn_ mode = true.
- Refer toStandard deployment
- Select several machines to deploy broker on six machines as needed, and execute
ALTER SYSTEM ADD BROKER broker_name "fe1:8000","be1:8000",...;.
Deployment of Doris for K8S
After an unexpected restart of the Pod, K8s cannot guarantee that the Pod's IP will not change, but it can ensure that the domain name remains unchanged. Based on this feature, when Doris enables FQDN, it can ensure that the Pod can still provide services normally after an unexpected restart.
Please refer to the method for deploying Doris in K8sKubernetes Deployment
Server change IP
After deploying the cluster according to 'Enable FQDN for new cluster', if you want to change the IP of the machine, whether it is switching network cards or replacing the machine, you only need to change the '/etc/hosts' of each machine.
Enable FQDN for old cluster
Precondition: The current program supports the syntax 'Alter SYSTEM MODIFY FRONTEND'<fe_ip>:<edit_log_port>'HOSTNAME'<fe_hostname>', If not, upgrade to a version that supports the syntax
At least three followers are required to perform the following operations, otherwise the cluster may not start properly
Next, follow the steps below:
Perform the following operations on the Follower and Observer nodes one by one (and finally on the Master node):
- Stop the node.
- Check if the node has stopped. Execute 'show frontends' through the MySQL client to view the Alive status of the FE node until it becomes false
- set FQDN for node:
ALTER SYSTEM MODIFY FRONTEND "<fe_ip>:<edit_log_port>" HOSTNAME "<fe_hostname>"(After stopping the master, a new master node will be selected and used to execute SQL statements)
- Modify node configuration. Modify the 'conf/fe. conf' file in the FE root directory and add the configuration:
enable_fqdn_mode = true
- Start the node.
Enabling FQDN for BE nodes only requires executing the following commands through MySQL, and there is no need to restart BE.
ALTER SYSTEM MODIFY BACKEND "<backend_ip>:<backend_port>" HOSTNAME "<be_hostname>"
Configuration item enable fqdn Can the mode be changed freely?
Cannot be changed arbitrarily. To change this configuration, follow the 'Enable FQDN for old cluster' procedure.