A cluster building method, device, equipment and medium

By building high-availability clusters and highly available network file system services in the cluster, and using the firewall silent IP and NFS silent sharing methods, the problem that NFSv3 and NFSv4 cannot support transparent failover at the same time is solved, achieving high availability and service continuity of NFS services.

CN116155699BActive Publication Date: 2025-03-14ZHENGZHOU YUNHAI INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310165993.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-24
Publication Date
2025-03-14
Estimated Expiration
2043-02-24

AI Technical Summary

Technical Problem

In cluster applications, NFSv3 and NFSv4 cannot support transparent failover at the same time, resulting in the impact of service continuity.

Method used

By building a high-availability cluster, create high-availability network file system services, and configure the cluster to achieve transparent failover using the preset firewall silent IP method and the preset network file system silent sharing method.

Benefits of technology

It realizes high availability of NFS services, ensures the continuity of NFS services, can automatically switch and restore file read and write IO when node failure, and maintains continuous client connections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116155699B_ABST
    Figure CN116155699B_ABST
Patent Text Reader

Abstract

The present application discloses a cluster building method, device, equipment and medium, and relates to the field of server clusters. The method includes: using a preset cluster configuration method to create and start a target high-availability cluster; creating a highly available network file system service for the target high-availability cluster, and configuring the network file system service using a preset service configuration method; configuring the target high-availability cluster using a preset firewall silent IP method and a preset network file system silent sharing method, so that when there is a faulty node in the cluster, the data input and output request process initiated by the client corresponding to the target high-availability cluster is controlled. The present invention creates a highly available cluster and creates a highly available network file system service for the highly available cluster, and uses a preset firewall silent IP method and a preset NFS silent sharing method to provide a highly available NFS sharing service, which ensures the continuity of the NFS service business and has great practical value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of server clusters, and in particular to a cluster building method, device, equipment and medium. Background Art

[0002] In a cluster environment consisting of multiple nodes and using high availability, if a node (such as node 1) loses power or has other faults, services deployed on node 1, such as NFS (Network File System) services, need to be immediately transferred to other available nodes (such as node 2) and provide NFS services. This process is imperceptible and transparent to the client. This is the basic concept of transparent failover. Through transparent failover of NFS services, high availability of NFS services is achieved, ensuring the continuity of NFS services.

[0003] The cluster needs to be highly available, and the service also needs to be highly available to achieve transparent failover. NFSv3 is a stateless protocol, that is, the client that mounts the NFSv3 share cannot perceive the status of the NFS server (network file system server) or the share, while NFSv4 is a stateful protocol. The client that mounts the NFSv4 share can perceive the status of the NFS server or share (whether it is restarted or exists) through the response to the IO (input / output) operation request. The IO operation is terminated when the share does not exist. In this way, when the NFS server fails, the NFSv3 client cannot perceive it, but the NFSv4 client can perceive it. In this way, the NFSv3 client can maintain a continuous connection with the NFS server, but the NFSv4 client cannot maintain a continuous connection. Since it takes a certain amount of time to switch cluster nodes and services, NFSv3 supports transparent failover at this time, but NFSv4 cannot support transparent failover.

[0004] As can be seen from the above, in the cluster application process, how to avoid the transparent failover caused by the inability to support NFSv3 and NFSv4 at the same time is a problem to be solved in the art. Summary of the invention

[0005] In view of this, the purpose of the present invention is to provide a cluster construction method, device, equipment and medium, which can realize transparent fault switching of NFS service through the constructed high-availability cluster, realize high availability of NFS service, and ensure the continuity of NFS business. The specific scheme is as follows:

[0006] In a first aspect, the present application discloses a cluster building method, comprising:

[0007] Use the preset cluster configuration method to create and start the target high-availability cluster;

[0008] Creating a highly available network file system service for the target highly available cluster, and configuring the network file system service using a preset service configuration method;

[0009] The target high-availability cluster is configured using a preset firewall silent IP method and a preset network file system silent sharing method, so that when there is a faulty node in the cluster, the data input and output request process initiated by the client corresponding to the target high-availability cluster is controlled.

[0010] Optionally, the step of creating and starting a target high-availability cluster using a preset cluster creation method includes:

[0011] Using a preset system management instruction to start the cluster resource manager service and the cluster engine service, and setting the cluster resource manager service and the cluster engine service to start automatically at boot, and then starting the daemon service corresponding to the cluster resource manager service;

[0012] Create a hacluster user for the target high-availability cluster and set a password;

[0013] Using the account and password of the hacluster user, create several nodes in the target high-availability cluster, and perform authorization processing between the several nodes;

[0014] A target high-availability cluster whose cluster name is a preset cluster name is generated based on the plurality of nodes, and the target high-availability cluster is started.

[0015] Optionally, the using of a preset system management instruction to start a cluster resource manager service and a cluster engine service, setting the cluster resource manager service and the cluster engine service to start automatically upon boot, and then starting a daemon service corresponding to the cluster resource manager service, includes:

[0016] The Pacemaker service and the Corosync service are started by using the preset system management instructions, and the Pacemaker service and the Corosync service are set to start automatically at boot, and then the pcsd daemon service corresponding to the cluster resource manager service is started.

[0017] Optionally, after creating and starting the target high-availability cluster using the preset cluster configuration method, the method further includes:

[0018] A fence action is configured for the target high-availability cluster to be a target fence device that restarts a failed node.

[0019] Optionally, creating a highly available network file system service for the target highly available cluster and configuring the network file system service using a preset service configuration method includes:

[0020] Creating a network file system service as a clone resource in the target high-availability cluster;

[0021] When the client corresponding to the target high-availability cluster creates a network file sharing system service in the network file system service, the preset start and stop sequence rules are used to constrain the start and stop sequence of the file system resources and the network file sharing system service; the file system resources are the resources of the file system that the target high-availability cluster uses to provide file access services to the outside world.

[0022] Optionally, configuring the target high-availability cluster by using a preset firewall silent IP method and a preset network file system silent sharing method includes:

[0023] The target high-availability cluster is configured so that when there is a faulty node in the cluster, a preset firewall silent command is used to control the client to access the node IP of the faulty node without returning an error, and a preset network file system command interface is used to control the data input and output requests initiated by the client corresponding to the target high-availability cluster without returning an error; when the network file system service of the faulty node drifts to the target available node, a preset firewall silent elimination command is used to control the client to allow access to the node IP of the faulty node, and the preset network file system command interface is used to restore normal processing of data input and output requests initiated by the client corresponding to the target high-availability cluster.

[0024] Optionally, the using a preset firewall silent command to control the client to access the node IP of the faulty node without returning an error includes:

[0025] Use the preset firewall silent command to create a rich rule for controlling the client to access the node IP of the faulty node without returning an error;

[0026] Accordingly, the use of a preset firewall to silently eliminate the command to control the client to allow access to the node IP of the faulty node includes:

[0027] Use the preset firewall silent elimination command to delete the rich rule for controlling the client to prohibit access to the node IP of the faulty node.

[0028] In a second aspect, the present application discloses a cluster building device, comprising:

[0029] The cluster creation module is used to create and start the target high-availability cluster using the preset cluster configuration method;

[0030] A network file system service creation module, used to create a highly available network file system service for the target highly available cluster, and configure the network file system service using a preset service configuration method;

[0031] The cluster configuration module is used to configure the target high-availability cluster using a preset firewall silent IP method and a preset network file system silent sharing method, so that when there is a faulty node in the cluster, the data input and output request process initiated by the client corresponding to the target high-availability cluster is controlled.

[0032] In a third aspect, the present application discloses an electronic device, comprising:

[0033] Memory, used to store computer programs;

[0034] The processor is used to execute the computer program to implement the aforementioned cluster building method.

[0035] In a fourth aspect, the present application discloses a computer storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned disclosed cluster building method are implemented.

[0036] This application uses a preset cluster configuration method to create and start a target high-availability cluster; creates a highly available network file system service for the target high-availability cluster, and configures the network file system service using a preset service configuration method; configures the target high-availability cluster using a preset firewall silent IP method and a preset network file system silent sharing method, so that when there is a faulty node in the cluster, the data input and output request process initiated by the client corresponding to the target high-availability cluster is controlled. In this way, the present invention creates a highly available cluster and creates a highly available network file system service for the high-availability cluster, and finally uses a preset firewall silent IP method and a preset NFS silent sharing method. It can provide a highly available NFS sharing service, ensure the continuity of the NFS service business, and has great practical value. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0038] Figure 1 A flow chart of a cluster building method provided for this application;

[0039] Figure 2 A specific cluster building method flow chart provided for this application;

[0040] Figure 3 A schematic diagram of the structure of a cluster building device provided in this application;

[0041] Figure 4 A structural diagram of an electronic device provided for this application. DETAILED DESCRIPTION

[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0043] In the prior art, NFSv3 supports transparent failover, but NFSv4 does not support transparent failover. In this application, the client mounted with NFSv3 / NFSv4 can maintain continuous connection during IO operation, and can automatically restore file read and write IO after service switching, thereby realizing transparent failover, achieving high availability of NFS service, and ensuring the continuity of NFS business.

[0044] The embodiment of the present invention discloses a cluster building method, see Figure 1 Said method comprises:

[0045] Step S11: Create and start a target high-availability cluster using a preset cluster configuration method.

[0046] In this embodiment, to realize transparent failover of NFS service, two points need to be achieved: first, high availability of cluster, and second, high availability of NFS service.

[0047] In this embodiment, the use of a preset cluster creation method to create and start a target high-availability cluster may include: using a preset system management instruction to start a cluster resource manager service and a cluster engine service, and setting the cluster resource manager service and the cluster engine service to start automatically at boot, and then starting the daemon service corresponding to the cluster resource manager service; creating a hacluster user for the target high-availability cluster and setting a password; using the account and password of the hacluster user to create several nodes in the target high-availability cluster, and performing authorization processing between the several nodes; generating a target high-availability cluster with a cluster name of the preset cluster name based on the several nodes, and starting the target high-availability cluster. After the use of the preset cluster configuration method to create and start the target high-availability cluster, it also includes: configuring a fence action for the target high-availability cluster to restart the target fence device of the failed node.

[0048] Cluster high availability means that when a node or server fails, another node can automatically and immediately provide services to the outside world, that is, the resources of the failed node are transferred to another available node and provide services to the outside world. Through the above steps, a high-availability cluster can be created.

[0049] Step S12: creating a highly available network file system service for the target highly available cluster, and configuring the network file system service using a preset service configuration method.

[0050] In this embodiment, the network file system service is an NFS service. In this embodiment, after a highly available network file system service is created for the target highly available cluster, the NFS service as a cluster resource can be taken over by an available node when a node fails. After the network file system service is created, the network file system service is also configured, and finally an NFS service cluster framework is built.

[0051] Step S13: The target high-availability cluster is configured using a preset firewall silent IP method and a preset network file system silent sharing method, so that when there is a faulty node in the cluster, the data input and output request process initiated by the client corresponding to the target high-availability cluster is controlled.

[0052] In this embodiment, since NFSv4 is stateful, when NFS resources drift due to a node failure, it takes a certain amount of time to recover from drift to NFS sharing service. Therefore, during this period of time, the IO operation initiated by the client will result in an error, causing the shared connection to be disconnected. Therefore, a solution is needed to prevent the NFS service from returning an error during drift or resource switching back.

[0053] There are two ideas to solve the above problem. One is to start from the NFS service itself and enable the NFS service to have the ability of cluster service. This solution cannot be implemented temporarily because the current architecture does not support cluster capabilities. The second is to start from the cluster and use the system's capabilities to prevent the NFS service from returning errors. The method proposed in the present invention is based on the above-mentioned method of cluster configuration starting from the cluster. The specific solution is: use the firewall silent IP technology combined with the NFS silent sharing technology, wait for the NFS sharing on the faulty node to drift to the available node to restore the NFS sharing service, and then release the firewall's silence on the IP and the silence on the NFS sharing.

[0054] In this embodiment, the target high-availability cluster is configured using the preset firewall silent IP method and the preset network file system silent sharing method, which may include: configuring the target high-availability cluster to not return an error when a faulty node exists in the cluster, using the preset firewall silent command to control the client to access the node IP (i.e., Internet Protocol) of the faulty node, and using the preset network file system command interface to control the data input and output requests initiated by the client corresponding to the target high-availability cluster to not return an error; when the network file system service of the faulty node drifts to the target available node, using the preset firewall silent elimination command to control the client to allow access to the node IP of the faulty node, and using the preset network file system command interface to restore normal processing of data input and output requests initiated by the client corresponding to the target high-availability cluster.

[0055] In this embodiment, the use of a preset firewall silent command to control the client to access the node IP of the faulty node without returning an error may include: using a preset firewall silent command to create a rich rule for controlling the client to access the node IP of the faulty node without returning an error; correspondingly, the use of a preset firewall silent elimination command to control the client to allow access to the node IP of the faulty node includes: using a preset firewall silent elimination command to delete the rich rule for controlling the client to prohibit access to the node IP of the faulty node.

[0056] In the specific implementation process, the above preset firewall silent IP method can be applied by using the command firewall-cmd--zone=public--add-rich-rule=”rule family=inet destination address=node fault IP port port=2049reject type=tcp-reset”, that is, creating a rich rule. Then use firewall-cmd--reload to make it effective. The above command can also reduce the failover time.

[0057] To eliminate the silent IP of the firewall, delete the corresponding rich rule, that is, firewall-cmd --zone = public --remove-rich-rule = "rule family = inet destination address = node failure IP port port = 2049 reject type = tcp-reset", and then use firewall-cmd --reload to make it effective.

[0058] Applying the above preset network file system silent sharing method (i.e. NFS sharing silent method) means that the developed NFS command interface does not return an error to the IO request of the NFS sharing client, which is a double guarantee. Subsequent elimination of NFS sharing silence means using the developed NFS command interface to restore the normal processing of the NFS sharing client IO request. In this way, NFS sharing will be restored to normal and the client IO will be restored. The above commands are similar for ipv4 and ipv6, and will not be described in detail.

[0059] The present invention uses a preset cluster configuration method to create and start a target high-availability cluster; creates a highly available network file system service for the target high-availability cluster, and configures the network file system service using a preset service configuration method; configures the target high-availability cluster using a preset firewall silent IP method and a preset network file system silent sharing method, so that when there is a faulty node in the cluster, the data input and output request process initiated by the client corresponding to the target high-availability cluster is controlled. In this way, the present invention creates a highly available cluster and creates a highly available network file system service for the high-availability cluster, and finally uses a preset firewall silent IP method and a preset NFS silent sharing method. It can provide a highly available NFS sharing service, ensure the continuity of the NFS service business, and has great practical value.

[0060] Figure 2 A flow chart of a specific cluster building method provided in the embodiment of this application. Figure 2 As shown, the method includes:

[0061] Step S21: Start the Pacemaker service and the Corosync service using a preset system management instruction, set the Pacemaker service and the Corosync service to start automatically at boot, and then start the pcsd daemon service corresponding to the cluster resource manager service.

[0062] In this embodiment, Pacemaker and Corosync can be used to achieve cluster high availability. Pacemaker is an open source high-availability resource manager that can implement cluster resource scheduling management, but cannot implement heartbeat intercommunication between cluster nodes. It is necessary to combine Corosync to realize the transmission of cluster heartbeat information and transaction information. The specific steps are to use systemctl to start the Pacemaker service and the Corosync service, set the boot-up auto-start, and start the pcsd daemon service.

[0063] Step S22: Create a hacluster user for the target high-availability cluster and set a password, use the hacluster user account and the password to create several nodes in the target high-availability cluster, and perform authorization processing between the several nodes, generate a target high-availability cluster with a cluster name of a preset cluster name based on the several nodes, and start the target high-availability cluster.

[0064] In this step, create a cluster user hacluster (i.e. High Availability Cluster) and set a password. Use this account and password to create mutual authorization for cluster nodes. The command is (taking two nodes as an example, node1 and node2 are the node names): pcs cluster auth node1 node2-u hacluster-pha@pwd123; then configure the cluster name, for example, the cluster configuration name is nfscluster, and then use the following command to generate the cluster: pcs cluster setup--enable--name nfscluster--wait_for_all 1--last_man_standing 1--token 10000node1 node2. Finally, start the cluster: pcs cluster start--all, and the cluster is started.

[0065] Step S23: configuring a fence action for the target high-availability cluster as a target fence device that restarts the failed node.

[0066] In this embodiment, it is also necessary to create a fence device for each node of the cluster when the brain is split. The function of the fence is to isolate unnecessary hosts. When a host loses contact with the cluster, it is isolated to prevent brain split. Here, the fence action is specified as node restart. Use the following command to create (taking node1 as an example): pcs stonish create fence_node1 (stonish device name) fence_virsh (fence execution action script) ipaddr = 172.16.2.12 (node ​​IP) login = superuser port = 6666 (specified port) pcmk_reboot_action = reboot (specified node restart) pcmk_host_map = node1:6666. In this way, a high-availability cluster is created.

[0067] Step S24: creating a network file system service as a clone resource in the target high-availability cluster.

[0068] Next, we need to create a highly available NFS service. First, we need to create the NFS service as a clone resource of the cluster. The creation command is: pcs resource create nfs_server (resource name) ocf:heartbeat:anything (resource type) attr = AA (attribute setting) clone. In this way, when a node fails, the NFS service can be taken over by an available node as a cluster resource, and the script anything is called to perform the takeover action (start / stop).

[0069] Step S25: When the client corresponding to the target high-availability cluster creates a network file sharing system service in the network file system service, the start and stop sequence of the file system resources and the network file sharing system service is constrained by using a preset start and stop sequence rule; the file system resources are the resources of the file system for which the target high-availability cluster provides file access services to the outside world.

[0070] In this step, the NFS sharing service (i.e. the above-mentioned network file sharing system service) is provided by the NFS service (i.e. the above-mentioned network file system service), is actively created by the customer, and is monitored as a resource of the cluster. The creation command is similar to: pcs resource create nfsshare ocf:heartbeat:ganesha (resource type) attr=BB (attribute setting), calling the script ganesha to perform the takeover action (start / stop). However, the NFS sharing service depends on the file system, so there needs to be a startup order constraint when the node drifts and releases resources, that is, start the file system resource first, then start the NFS sharing service, and when stopping the resource, stop the NFS sharing service resource first, and then stop the file system resource. You can use pcsconstraint order to set the order constraint to control the resource start and stop order.

[0071] In this embodiment, if you want to provide NFS sharing services to the outside world, you also need a business IP that is open to the outside world by NFS, so the IP also needs to be monitored as a resource of the cluster, and the creation command is similar to that of NFS shared resources.

[0072] Step S26: The target high-availability cluster is configured using a preset firewall silent IP method and a preset network file system silent sharing method, so that when there is a faulty node in the cluster, the data input and output request process initiated by the client corresponding to the target high-availability cluster is controlled.

[0073] For a more specific processing procedure of step S26, reference may be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be described in detail here.

[0074] This embodiment proposes a transparent failover mechanism for NFS services based on a Pacemaker high-availability cluster, so that the client mounted with NFSv3 / NFSv4 can maintain continuous connection during IO operations, and can automatically restore file read and write IO after service switching, thus realizing transparent failover. The high availability of NFS services is realized, the continuity of NFS service business is guaranteed, and it has great practical value.

[0075] See also Figure 3 As shown, the embodiment of the present application discloses a cluster building device, which may specifically include:

[0076] The cluster creation module 11 is used to create and start a target high-availability cluster using a preset cluster configuration method;

[0077] A network file system service creation module 12, used to create a highly available network file system service for the target highly available cluster, and configure the network file system service using a preset service configuration method;

[0078] The cluster configuration module 13 is used to configure the target high-availability cluster using a preset firewall silent IP method and a preset network file system silent sharing method, so that when there is a faulty node in the cluster, the data input and output request process initiated by the client corresponding to the target high-availability cluster is controlled.

[0079] The present invention uses a preset cluster configuration method to create and start a target high-availability cluster; creates a highly available network file system service for the target high-availability cluster, and configures the network file system service using a preset service configuration method; configures the target high-availability cluster using a preset firewall silent IP method and a preset network file system silent sharing method, so that when there is a faulty node in the cluster, the data input and output request process initiated by the client corresponding to the target high-availability cluster is controlled. In this way, the present invention creates a highly available cluster and creates a highly available network file system service for the high-availability cluster, and finally uses a preset firewall silent IP method and a preset NFS silent sharing method. It can provide a highly available NFS sharing service, ensure the continuity of the NFS service business, and has great practical value.

[0080] In some specific embodiments, the cluster creation module 11 may specifically include:

[0081] A service startup unit, used to start the cluster resource manager service and the cluster engine service by using a preset system management instruction, and set the cluster resource manager service and the cluster engine service to start automatically at boot, and then start the daemon service corresponding to the cluster resource manager service;

[0082] User creation unit, used to create the hacluster user for the target high-availability cluster and set the password;

[0083] A node creation unit, used to create several nodes in the target high-availability cluster using the account and password of the hacluster user, and perform authorization processing between the several nodes;

[0084] The cluster generation and startup unit is used to generate a target high-availability cluster whose cluster name is a preset cluster name based on the plurality of nodes, and to start the target high-availability cluster.

[0085] In some specific embodiments, the service initiation unit may specifically include:

[0086] The Pacemaker service and Corosync service starting unit is used to start the Pacemaker service and the Corosync service using a preset system management instruction, and set the Pacemaker service and the Corosync service to start automatically at boot, and then start the pcsd daemon service corresponding to the cluster resource manager service.

[0087] In some specific embodiments, the cluster building device may further include:

[0088] The fence device configuration unit is used to configure a target fence device whose fence action is to restart a failed node for the target high-availability cluster.

[0089] In some specific embodiments, the network file system service creation module 12 may specifically include:

[0090] A clone resource creation unit, used to create a network file system service as a clone resource in the target high-availability cluster;

[0091] A start-stop sequence constraint unit is used to use preset start-stop sequence rules to constrain the start-stop sequence of file system resources and the network file sharing system service when the client corresponding to the target high-availability cluster creates a network file sharing system service in the network file system service; the file system resources are the resources of the file system of the target high-availability cluster that provides file access services to the outside world.

[0092] In some specific embodiments, the cluster configuration module 13 may specifically include:

[0093] The method application unit is used to configure the target high-availability cluster to use a preset firewall silent command to control the client to access the node IP of the faulty node without returning an error when there is a faulty node in the cluster, and use a preset network file system command interface to control the data input and output requests initiated by the client corresponding to the target high-availability cluster without returning an error; when the network file system service of the faulty node drifts to the target available node, use a preset firewall silent elimination command to control the client to allow access to the node IP of the faulty node, and use the preset network file system command interface to restore normal processing of data input and output requests initiated by the client corresponding to the target high-availability cluster.

[0094] In some specific embodiments, the method application unit may specifically include:

[0095] A rich rule creation unit, used to use a preset firewall silent command to create a rich rule for controlling a client to access the node IP of the faulty node without returning an error;

[0096] Accordingly, the method application unit may specifically include:

[0097] The rich rule deleting unit is used to use a preset firewall silent elimination command to delete the rich rule for controlling the client to prohibit access to the node IP of the faulty node.

[0098] Furthermore, the present application also discloses an electronic device. Figure 4 This is a structural diagram of an electronic device 20 according to an exemplary embodiment, and the content in the diagram cannot be considered as any limitation on the scope of use of the present application.

[0099] Figure 4 The present invention provides a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a display screen 24, an input / output interface 25, a communication interface 26, and a communication bus 27. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement:

[0100] Use the preset cluster configuration method to create and start the target high-availability cluster;

[0101] Creating a highly available network file system service for the target highly available cluster, and configuring the network file system service using a preset service configuration method;

[0102] The target high-availability cluster is configured using a preset firewall silent IP method and a preset network file system silent sharing method, so that when there is a faulty node in the cluster, the data input and output request process initiated by the client corresponding to the target high-availability cluster is controlled.

[0103] In addition, the electronic device 20 in this embodiment can specifically be an electronic computer, and the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 26 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0104] In addition, the memory 22 as a carrier for resource storage may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include an operating system 221, a computer program 222 and virtual machine data 223, etc. The virtual machine data 223 may include various data. The storage method may be temporary storage or permanent storage.

[0105] The operating system 221 is used to manage and control the hardware devices on the electronic device 20 and the computer program 222, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the cluster building method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.

[0106] Further, the present application also discloses a computer-readable storage medium, wherein the computer-readable storage medium mentioned here includes a random access memory (Random Access Memory, RAM), a memory, a read-only memory (Read-Only Memory, ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a magnetic disk or an optical disk or any other form of storage medium known in the technical field. Wherein, when the computer program is executed by the processor, the aforementioned disclosed cluster building method is implemented. For the specific steps of the method, reference can be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.

[0107] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts refer to the method part description. Professionals can also further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but this implementation should not be considered to exceed the scope of this application.

[0108] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0109] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0110] The cluster building method, device, equipment, and storage medium provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A cluster building method, characterized in that: include: Use the preset cluster configuration method to create and start the target high-availability cluster; Creating a highly available network file system service for the target highly available cluster, and configuring the network file system service using a preset service configuration method; The target high-availability cluster is configured using a preset firewall silent IP method and a preset network file system silent sharing method, so that when there is a faulty node in the cluster, the data input and output request process initiated by the client corresponding to the target high-availability cluster is controlled; The method of configuring the target high-availability cluster by using a preset firewall silent IP method and a preset network file system silent sharing method includes: The target high-availability cluster is configured so that when there is a faulty node in the cluster, a preset firewall silent command is used to control the client to access the node IP of the faulty node without returning an error, and a preset network file system command interface is used to control the data input and output requests initiated by the client corresponding to the target high-availability cluster without returning an error; when the network file system service of the faulty node drifts to the target available node, a preset firewall silent elimination command is used to control the client to allow access to the node IP of the faulty node, and the preset network file system command interface is used to restore normal processing of data input and output requests initiated by the client corresponding to the target high-availability cluster.

2. The cluster building method according to claim 1, characterized in that: The method of creating and starting a target high-availability cluster using a preset cluster creation method includes: Using a preset system management instruction to start the cluster resource manager service and the cluster engine service, and setting the cluster resource manager service and the cluster engine service to start automatically at boot, and then starting the daemon service corresponding to the cluster resource manager service; Create a hacluster user for the target high-availability cluster and set a password; Using the account and password of the hacluster user, create several nodes in the target high-availability cluster, and perform authorization processing between the several nodes; A target high-availability cluster whose cluster name is a preset cluster name is generated based on the plurality of nodes, and the target high-availability cluster is started.

3. The cluster building method according to claim 2, characterized in that: The method of starting the cluster resource manager service and the cluster engine service by using a preset system management instruction, setting the cluster resource manager service and the cluster engine service to start automatically at boot, and then starting the daemon process service corresponding to the cluster resource manager service includes: The Pacemaker service and the Corosync service are started by using the preset system management instructions, and the Pacemaker service and the Corosync service are set to start automatically at boot, and then the pcsd daemon service corresponding to the cluster resource manager service is started.

4. The cluster building method according to claim 1, characterized in that: After the target high-availability cluster is created and started using the preset cluster configuration method, the method further includes: A fence action is configured for the target high-availability cluster to be a target fence device that restarts a failed node.

5. The cluster building method according to claim 2, characterized in that: The step of creating a highly available network file system service for the target highly available cluster and configuring the network file system service using a preset service configuration method includes: Creating a network file system service as a clone resource in the target high-availability cluster; When the client corresponding to the target high-availability cluster creates a network file sharing system service in the network file system service, the preset start and stop sequence rules are used to constrain the start and stop sequence of the file system resources and the network file sharing system service; the file system resources are the resources of the file system that the target high-availability cluster uses to provide file access services to the outside world.

6. The cluster building method according to claim 1, characterized in that: The method of using a preset firewall silent command to control the client to access the node IP of the faulty node without returning an error includes: Use the preset firewall silent command to create a rich rule for controlling the client to access the node IP of the faulty node without returning an error; Accordingly, the use of a preset firewall to silently eliminate the command to control the client to allow access to the node IP of the faulty node includes: Use the preset firewall silent elimination command to delete the rich rule for controlling the client to prohibit access to the node IP of the faulty node.

7. A cluster building device, characterized in that: include: The cluster creation module is used to create and start the target high-availability cluster using the preset cluster configuration method; A network file system service creation module, used to create a highly available network file system service for the target highly available cluster, and configure the network file system service using a preset service configuration method; A cluster configuration module, used to configure the target high-availability cluster using a preset firewall silent IP method and a preset network file system silent sharing method, so as to control the data input and output request process initiated by the client corresponding to the target high-availability cluster when there is a faulty node in the cluster; The method of configuring the target high-availability cluster by using a preset firewall silent IP method and a preset network file system silent sharing method includes: The target high-availability cluster is configured so that when there is a faulty node in the cluster, a preset firewall silent command is used to control the client to access the node IP of the faulty node without returning an error, and a preset network file system command interface is used to control the data input and output requests initiated by the client corresponding to the target high-availability cluster without returning an error; when the network file system service of the faulty node drifts to the target available node, a preset firewall silent elimination command is used to control the client to allow access to the node IP of the faulty node, and the preset network file system command interface is used to restore normal processing of data input and output requests initiated by the client corresponding to the target high-availability cluster.

8. An electronic device, characterized in that: It comprises a processor and a memory; wherein, when the processor executes the computer program stored in the memory, the cluster building method according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein, when the computer program is executed by a processor, the cluster building method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • High availability method and system for NAS cluster as well as electronic equipment and storage medium

    CN108923992A

  • User mode network file system dual-stack access method, device and equipment

    CN111225020A