Database deployment methods, domain name resolution methods and related devices
By deploying alias resource records and modifying domain name resolution priority in the Greenplum database, the service interruption problem caused by dynamic IPs was resolved, and the database was able to operate stably and remain easy to use in a dynamic IP environment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-19
- Publication Date
- 2026-03-13
AI Technical Summary
Greenplum databases become unavailable when node IPs suddenly change, and existing technologies struggle to handle dynamic IP scenarios, leading to database service interruptions.
By deploying alias resource records in the cluster control node of the Greenplum database, using the local domain name server as the primary resolution server, and modifying the domain name resolution priority, dynamic mapping between domain names and IPs is achieved. Customized Bind software is used to allow the configuration of CNAME resource records with the same zone name, ensuring that the database service runs normally in a dynamic IP environment.
It enables stable operation of the Greenplum database in a dynamic IP environment, improves the database's usability and service reliability, and provides services by replacing virtual IPs with fixed domain names.
Smart Images

Figure CN115687294B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a database deployment method, a domain name resolution method, and related apparatus. Background Technology
[0002] In the cloud-native era, an increasing number of applications are deployed on cloud platforms. Greenplum Database is a relational database designed for database warehouse applications, a distributed database based on PostgreSQL (an open-source database). It employs an MPP (Massively Parallel Processor) architecture, where each node controls its own host, operating system, memory, and storage, eliminating sharing. Each node has its own independent disk storage and memory system. Business data is distributed across nodes according to the database model and application characteristics. These data nodes are interconnected via dedicated or commercially available networks, collaborating to provide database services as a whole.
[0003] Normally, network communication is performed by finding the IPs of other nodes to carry out installation, deployment, expansion, and upgrades. However, if the IPs of some nodes suddenly change, the database service may become unavailable. Summary of the Invention
[0004] The main technical problem solved by this invention is to provide a database deployment method, a domain name resolution method, and related devices that enable Greenplum databases to cope with dynamic IPs.
[0005] To solve the above-mentioned technical problems, one technical solution adopted by the present invention is to provide a database deployment method, which includes: receiving a Greenplum database initialization deployment request and obtaining the cluster control node corresponding to the Greenplum database initialization deployment request; obtaining the alias resource record of the cluster control node, and deploying and adding the alias resource record in the corresponding container of the cluster control node to use the alias resource record to look up domain name data, wherein the alias resource record includes the correspondence between domain name data and alias data.
[0006] The process of obtaining the cluster control node corresponding to the Greenplum database initialization deployment request includes: searching the IP data of the cluster control node for network communication and obtaining the node label of the cluster control node.
[0007] The steps before deploying and adding alias resource records to the corresponding container of the cluster control node include: setting the local name server as the primary resolution server of the cluster control node; and deploying and adding alias resource records to the local name server of the cluster control node.
[0008] The database deployment method also includes: modifying the priority of domain name resolution on the cluster control node, making the local domain name server the first priority.
[0009] The database deployment method also includes: receiving requests for new cluster control nodes and receiving new alias resource records; deploying and adding all alias resource records to the local domain name servers of all cluster control nodes.
[0010] Before receiving the Greenplum database initialization deployment request, the process also includes modifying the Greenplum database's domain name configuration rules so that alias resource records can be the same as the zone name.
[0011] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is: to provide a domain name resolution method, which includes: a local domain name resolution server receiving IP data request information, the IP data request information including alias data, the IP data request information being sent by a client server; identifying the alias data to obtain the domain name data corresponding to the alias data; and sending the domain name data to a remote server.
[0012] The process of identifying alias data and obtaining the corresponding domain name data includes: using alias resource records to read the correspondence between alias data and domain name data; parsing alias data and using the correspondence to convert alias data into domain name data.
[0013] The domain name resolution method also includes: the local domain name resolution server receiving IP data, which is obtained by resolving domain name data from the remote server; and forwarding the IP data to the client server.
[0014] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is to provide a local domain name resolution server, which includes a processor for executing the above-mentioned domain name resolution method.
[0015] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is to provide a computer-readable storage medium for storing instruction / program data, which can be executed to implement the above-mentioned database deployment method or domain name resolution method.
[0016] The beneficial effects of this invention are as follows: Unlike the prior art, this invention proposes a deployment method for Greenplum database in a containerized scenario. Alias resource records are deployed and added to the corresponding containers of the cluster control node, and aliases are mapped to real domain names. This allows the database service to continue to operate normally when the IP is not fixed, giving Greenplum database the ability to cope with dynamic IPs. Furthermore, by using fixed domain names instead of virtual IPs to provide services to the outside world, the usability of the database is improved. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating the implementation method of the database deployment method of this application;
[0018] Figure 2 This is a flowchart illustrating another implementation of the database deployment method of this application;
[0019] Figure 3 This is a flowchart illustrating one implementation method of the domain name resolution method in this application;
[0020] Figure 4 This is a flowchart illustrating a specific implementation method of the domain name resolution method in this application;
[0021] Figure 5 This is a schematic diagram of the structure of the local domain name resolution server in the embodiments of this application;
[0022] Figure 6 This is a schematic diagram of the structure of a computer-readable storage medium in an embodiment of this application. Detailed Implementation
[0023] To make the objectives, technical solutions, and effects of the present invention clearer and more explicit, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments.
[0024] Kubernetes is an open-source platform for the automated deployment, scaling, and operation of container clusters. With Kubernetes, user needs can be responded to quickly and effectively; applications can be deployed rapidly and as expected; applications can be scaled up extremely quickly; new application features can be seamlessly integrated; resources can be saved, hardware resource usage can be optimized, and a complete open-source solution for container orchestration and management can be provided.
[0025] Greenplum is a relational database for database warehouse applications, a distributed database based on PostgreSQL (an open-source database). It employs an MPP (Massively Parallel Processor) architecture, where each node controls its own host, operating system, memory, and storage, with no sharing. Each node has an independent disk storage and memory system. Business data is distributed across nodes according to the database model and application characteristics. These nodes are interconnected via dedicated or commercial networks, collaborating to provide database services as a whole. Typically, network communication, installation, deployment, expansion, and upgrades are performed by looking up the IPs of other nodes through the ` / etc / hosts` file. Deployment typically takes three forms: bare metal deployment (pure physical machines), virtual machine deployment, and containerized deployment. However, if the IPs of some nodes suddenly change, the database service may become unavailable. To accommodate this scenario where IPs change frequently but domain names remain constant, domain name resolution is introduced for distributed database deployment. Domain name resolution is the process of converting a domain name back into an IP address. One domain name corresponds to one IP address, and one IP address can correspond to multiple domain names; therefore, multiple domain names can be resolved to the same IP address simultaneously. Domain name resolution needs to be performed by a domain name resolution server. Therefore, this application provides a database deployment method.
[0026] Please refer to details. Figure 1 , Figure 1 This is a flowchart illustrating the database deployment method of this application. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily reflect that outcome. Figure 1 The illustrated process sequence is limited. For example... Figure 1 As shown, this embodiment includes:
[0027] S110: Receives the Greenplum database initialization deployment request and obtains the cluster control node corresponding to the Greenplum database initialization deployment request.
[0028] A Greenplum database is built based on a Helm template. Upon receiving a Greenplum database initialization deployment request, the cluster control node of the multiple physical machines that need to perform collaborative computing is obtained, and the cluster control node corresponding to the Greenplum database initialization deployment request is used.
[0029] S130: Obtain the alias resource record of the cluster control node, deploy and add the alias resource record to the corresponding container of the cluster control node, so as to use the alias resource record to look up domain name data.
[0030] A CNAME (Canonical Name) resource record contains the mapping between domain name data and alias data. It is a Domain Name System (DNS) resource record that can be used to alias a domain name to another canonical name. The alias resource record for each cluster control node is retrieved, and the alias resource records for all nodes are added to the corresponding container on the cluster control node, enabling each cluster control node to perform alias-domain name conversion.
[0031] Greenplum databases by default use specific domain names to map to cluster control nodes. For example, `mdw` represents the master node, `smdw` represents the standby master node, and `sdw1` represents the segment node. Open-source maintenance scripts all use these specific domain names by default and should not be modified. However, using domain aliases like `mdw` and `smdw` presents formatting issues. This type of domain alias is not allowed and does not conform to domain name standards. In DNS RFC (RFC1034, RFC1035) protocols, CNAME resource records cannot coexist with records other than NSEC and NSEC3 records. Therefore, configuring a CNAME resource record with the same name as the zone name is not allowed in a zone. Similarly, Bind9 does not support configuring a CNAME resource record with the same name as the zone name in a zone. While the standard for top-level domains is at least `.mdw` or `.smdw`, this still cannot be used. Therefore, this application is based on the open-source Bind 9.11 software and involves customized development, modifying the domain name configuration rules of the Greenplum database to allow configuring a CNAME resource record with the same name as the zone name.
[0032] Please see Figure 2 , Figure 2 This is a flowchart illustrating another implementation of the database deployment method of this application. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily reflect that outcome. Figure 2 The illustrated process sequence is limited. For example... Figure 2 As shown, this embodiment includes:
[0033] S210: Receives the Greenplum database initialization deployment request, searches for the IP data of the cluster control node for network communication, and defines the deployment network configuration as dynamic IP.
[0034] A Greenplum database was built based on the Helm template. Installation and deployment were completed by searching the ` / etc / hosts` file for the IP addresses of the cluster control nodes across multiple physical machines for network communication. The IP addresses of each cluster control node were set to dynamic IPs. An IP address (Internet Protocol address) is an address used by devices connected to a network to exchange data. A static IP address is a fixed IP address assigned to a computer connected to the network, so it does not obtain a different IP address each time it connects. A dynamic IP address, unlike a static IP address, is randomly selected by the system from the available IP address space when the computer connects to the network, thus obtaining a different IP address each time it connects.
[0035] S230: Obtain the node label of the cluster control node and obtain the alias resource record of the cluster control node.
[0036] Set a node label for each cluster control node to distinguish different cluster control nodes, and obtain the alias resource record corresponding to each cluster control node.
[0037] S250: Set the local name server as the primary DNS server for the cluster control node, and deploy and add the CNAME resource record to the local name server of the cluster control node.
[0038] Modify the nameserver setting in the ` / etc / resolv.conf` file to `127.0.0.1`. This causes the operating system to use the local DNS server on each cluster control node as the primary DNS server and send the CNAME records of all cluster control nodes to the local DNS server. Specifically, add CNAME records for all nodes to the local DNS server, and other nodes also need to add CNAME records for all nodes. This allows the entire distributed system to identify each other through domain name aliases. All nodes start the domain name resolution service process. The CNAME record (mdw.zone) is as follows:
[0039]
[0040] The CNAME resource record is deployed and added to the local domain name server of the cluster control node using the above method.
[0041] S270: Modify the priority of domain name resolution on the cluster control node, making the local domain name server the first priority.
[0042] Modify the hosts configuration in the ` / etc / nsswitch.conf` file. This configuration sets the priority order for domain name resolution. Change the original priority from "files" to "dns," making the local name server the first priority. After the modification, the cluster control node will prioritize resolving domain names from the local name server.
[0043] Furthermore, after deployment, when the Greenplum database needs to expand by adding new cluster control nodes, it receives requests for new cluster control nodes and modifies the name server in the ` / etc / resolv.conf` file on all cluster control nodes to `127.0.0.1`. This causes the operating system to use the local name server (DNS server) of each cluster control node, including the newly added cluster control node, as the primary resolution server and to receive the newly added alias resource record. Alias resource records are also added to the local name server for all cluster control nodes, ensuring that the entire distributed system can identify each other through domain name aliases, and all nodes initiate the domain name resolution process. Therefore, the installation and deployment of the domain name-based Greenplum database cluster is complete.
[0044] This invention proposes a deployment method for Greenplum database in a containerized scenario. Alias resource records are deployed and added to the corresponding containers of the cluster control node, and the aliases are mapped to the real domain names. This allows the database service to continue to run normally when the IP is not fixed, giving Greenplum database the ability to cope with dynamic IPs. Furthermore, by using fixed domain names instead of virtual IPs to provide services to the outside world, the usability of the database is improved.
[0045] This application provides domain name resolution services based on the completion of the Greenplum database deployment described above. For details, please refer to... Figure 3 , Figure 3 This is a flowchart illustrating one implementation method of the domain name resolution method described in this application. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily reflect that outcome. Figure 3 The illustrated process sequence is limited. For example... Figure 3 As shown, this embodiment includes:
[0046] S310: The local domain name resolution server receives IP data request information.
[0047] The local domain name resolution server receives IP data request information from the client server, which includes alias data.
[0048] S330: Identify alias data and obtain the domain name data corresponding to the alias data.
[0049] Using the database deployment method described above, the domain name resolution priority of the cluster control node is set. First, the local domain name resolution server is used to perform domain name resolution service. The local domain name resolution server has alias resource records deployed in it. These alias resource records store the real domain name data corresponding to the alias data. Therefore, the correspondence between alias data and domain name data is read using the alias resource records; the alias data is resolved, and the correspondence is used to convert the alias data into domain name data.
[0050] S350: Sends domain name data to a remote server.
[0051] The local domain name resolution server sends the domain name data to the remote server that needs to request the IP address, and performs the conversion between the domain name data and the IP address data.
[0052] S370: The local domain name resolution server receives IP data and forwards it to the client server.
[0053] The local domain name resolution server receives IP data from the remote server and forwards the IP data directly to the client server.
[0054] In one specific implementation, domain name resolution is performed using the kubeDNS or coreDNS service within Kubernetes. This means that a domain name resolution server exists within Kubernetes, providing domain name resolution services to all nodes. However, this domain name is subject to certain restrictions; it must be either `podName.serviceName.namespace.svc.cluster.local.` or `podName.serviceName.namespace`, i.e., the actual domain name. This domain name format is not suitable for applications with specific domain name specifications. In the Greenplum database, `mdw`, `smdw`, or `sdw1` are used to represent the master node, backup master node, or segment node, i.e., specific domain names are used to represent each node. Therefore, the method designed and deployed in this application enables `ping mdw` and `ping podName.serviceName.namespace.svc.cluster.local.` to achieve the same effect when performing domain name resolution in the Greenplum database.
[0055] Specifically, this application uses bind9 for the domain name resolution process, performing alias resolution and domain name forwarding to meet the needs of customized domain names. Please refer to [link to relevant documentation]. Figure 4 , Figure 4 This is a flowchart illustrating a specific implementation method of the domain name resolution method in this application.
[0056] The client server sends an IP request to the local DNS server. In one implementation, this involves sending the alias "mdw". The local DNS server uses a CNAME resource record in bind9 to associate the alias data with the real domain name data. Specifically, "mdw" is associated with "podName.serviceName.namespace.svc.cluster.local.", making "mdw" an alias for "podName.serviceName.namespace.svc.cluster.local." The local DNS server uses bind9's forwarding function to forward the resolved real domain name data to a remote DNS server (which can be kubeDNS or coreDNS). The remote DNS server performs correct resolution based on the real domain name to obtain the correct IP address, which is then resent to the local DNS server. The local DNS server then uses bind9's forwarding function to forward the received real IP address to the client server.
[0057] In this implementation, by utilizing a local domain name resolution server to convert and forward specific domain names to their real domain names, the real IP address can be obtained remotely. This approach is capable of handling dynamic IP scenarios, ensuring the database service continues to operate normally even after IP changes. Furthermore, it enables faster, more convenient, and more reliable node scheduling when deployed on the Kubernetes cloud platform. Simultaneously, using a fixed domain name instead of a virtual IP address to provide services externally improves the database's usability.
[0058] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a local domain name resolution server in an embodiment of this application. In this embodiment, the local domain name resolution server 51 includes a processor 52.
[0059] Processor 52 can also be referred to as a CPU (Central Processing Unit). Processor 52 may be an integrated circuit chip with signal processing capabilities. Processor 52 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor, or processor 52 can be any conventional processor.
[0060] The local domain name resolution server 51 may further include a memory (not shown) for storing instructions and data required for the processor 52 to run.
[0061] The processor 52 is used to execute instructions to implement the method provided by any embodiment and any non-conflicting combination of the domain name resolution method of this application described above.
[0062] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of a computer-readable storage medium in an embodiment of this application. The computer-readable storage medium 61 in this embodiment stores instruction / program data 62. When executed, this instruction / program data 62 implements the methods provided by any embodiment of the Greenplum database deployment or domain name resolution method, or any non-conflicting combination thereof. The instruction / program data 62 can be formed into a program file and stored in the storage medium 61 as a software product, so that a computer device (which may be a personal computer, server, or network device, etc.) or processor can execute all or part of the steps of the methods in various embodiments of this application. The aforementioned storage medium 61 includes various media capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, or terminal devices such as computers, servers, mobile phones, and tablets.
[0063] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.
[0064] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0065] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A database deployment method characterized by, The method comprises: receiving a Greenplum database initialization deployment request and obtaining a cluster control node corresponding to the Greenplum database initialization deployment request, the cluster control node being configured as a dynamic IP; obtaining an alias resource record of the cluster control node, adding the alias resource record in the corresponding container of the cluster control node, and using the alias resource record to find domain name data, the alias resource record comprising a corresponding relationship between alias data and the domain name data; The method further comprises, before receiving the Greenplum database initialization deployment request: modify the domain name configuration rule of the Greenplum database, so that the alias resource record can be the same as the zone name.
2. The database deployment method of claim 1, wherein, The method further comprises, before receiving the Greenplum database initialization deployment request: searching for IP data of the cluster control node for network communication and obtaining node labels of the cluster control node.
3. The database deployment method of claim 2, wherein, The method further comprises, before adding the alias resource record in the corresponding container of the cluster control node: setting a local domain name server as a primary resolution server of the cluster control node; adding the alias resource record in the local domain name server of the cluster control node.
4. The database deployment method of claim 3, wherein, The method further comprises: modifying the priority of the cluster control node for domain name resolution, and setting the local domain name server as the first priority.
5. The database deployment method of claim 3, wherein, The method further comprises: receiving an added cluster control node request and receiving an added alias resource record; adding all alias resource records in the local domain name server of all cluster control nodes.
6. A domain name resolution method characterized by, The database is deployed by the database deployment method of any one of claims 1-5, and the method comprises, The local domain name resolution server receives IP data request information, the IP data request information comprising alias data, and the IP data request information being sent by a client server; identifying the alias data to obtain domain name data corresponding to the alias data; sending the domain name data to a remote server.
7. The domain name resolution method of claim 6, wherein, The method further comprises: reading the corresponding relationship between the alias data and the domain name data using the alias resource record; parsing the alias data and converting the alias data into the domain name data using the corresponding relationship.
8. The domain name resolution method of claim 6, wherein, The method further comprises: The local domain name resolution server receives IP data, the IP data being obtained by the remote server by parsing the domain name data; forwarding the IP data to the client server.
9. A local domain name resolution server, characterized by The processor is configured to execute instructions to implement the domain name resolution method of any one of claims 6-8.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium is configured to store instructions / program data that can be executed to implement the database deployment method of any one of claims 1-5 or the domain name resolution method of any one of claims 6-8.
Citation Information
Patent Citations
Response time measurement method, device and system and storage medium
CN113301172A