[go: up one dir, main page]

CN115514765A - Method for realizing high availability of zfs multi-server - Google Patents

Method for realizing high availability of zfs multi-server Download PDF

Info

Publication number
CN115514765A
CN115514765A CN202211136364.3A CN202211136364A CN115514765A CN 115514765 A CN115514765 A CN 115514765A CN 202211136364 A CN202211136364 A CN 202211136364A CN 115514765 A CN115514765 A CN 115514765A
Authority
CN
China
Prior art keywords
zfs
multipath
service
server
availability
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211136364.3A
Other languages
Chinese (zh)
Inventor
张涛
林涛睿
蓝振志
王涛
高嵩
郭昊
林鹏程
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Vclusters Information Technology Co ltd
Original Assignee
Shenzhen Vclusters Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Vclusters Information Technology Co ltd filed Critical Shenzhen Vclusters Information Technology Co ltd
Priority to CN202211136364.3A priority Critical patent/CN115514765A/en
Publication of CN115514765A publication Critical patent/CN115514765A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1034Reaction to server failures by a load balancer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Hardware Redundancy (AREA)

Abstract

The invention discloses a method for realizing high availability of a zfs multi-server, which comprises the following steps: preparing a plurality of hardware servers as deployed zfs high-availability services; the server installs zfs software and loads a zfs.ko module; multipath software device-map-multipath is installed on all server nodes, multipath service is started after installation is successful, and a multipath module is automatically loaded at the moment; respectively sharing and mounting a magnetic disk hdd or ssd which is prepared to be stored as a zfs file system to all zfs servers through an iscsi protocol; finding the volume and mounting the volume through an iscsiadm command, and finally, all the disks have a link on a server; a multipath link is automatically generated by the multipath service. The invention has the advantages that the normal operation of the service can still be ensured and the data is not lost after any one server fails.

Description

Method for realizing high availability of zfs multi-server
Technical Field
The invention relates to the field of data processing, in particular to a method for realizing high availability of a zfs multi-server.
Background
A zfs file system provided by the current open-source openzfs project can provide a plurality of raidz-level data security redundancy modes, and provides a plurality of modes such as snapshot, cloning, data verification and automatic repair to ensure data security. Therefore, the method is often applied to various nas application systems, and most nas products in the mainstream market use a zfs file system as an underlying storage system. Unlike conventional file systems, where zfs combines the features of a file system and a volume manager, zfs may create file systems and volumes that span multiple hard disks or multiple storage pools to support file and block interface access, respectively.
Although zfs has various data security protection measures and excellent read-write performance, data balance can be realized through a dynamic stripe technology, and a high-efficiency snapshot function is realized through a cow mechanism, so that the zfs is favored by most IT software manufacturers. However, due to the architectural characteristics, the system can only be deployed in a single server, although the server can provide a large capacity and a large number of disks to meet the requirements of customers for high performance and high storage space as much as possible, the system is still a single server architecture, and cannot continuously provide storage access service when a host is abnormal. Therefore, a large-scale cluster mode cannot be deployed, and the function of a distributed file system with a unified namespace cannot be realized.
Disclosure of Invention
The invention provides a method for realizing high availability of a zfs multi-server, which has the advantages of ensuring normal operation of a service and no loss of data after the fault of any one server, and solves the problem that the storage access service can not be continuously provided when a host is abnormal.
The method for realizing high availability of the zfs multi-server comprises the following steps:
preparing a plurality of hardware servers as deployed zfs high-availability services;
the server installs zfs software and loads a zfs.ko module;
multipath software device-map-multipath is installed on all server nodes, multipath service is started after installation is successful, and a multipath module is automatically loaded at the moment;
respectively sharing and mounting the hard disk hdd or ssd prepared to be stored as a zfs file system to all the zfs servers through an iscsi protocol;
finding the volume and mounting the volume through an iscsiadm command, and finally, all the disks have a link on a server;
a multipath link is automatically generated by the multipath service.
Preferably, the step of automatically generating a multipath link through the multipath service further comprises:
mounting a pacemaker and coroync software on all the zfs node servers to form a cluster system;
when the pcs cluster is successfully deployed, adding a Delay service, and realizing a Delay function through a self-contained Delay service;
after the zpool is exported after the node fails and the vip is switched, importing zpool information into another node;
the starting delay added to the delay service is increased from the default 30s to 60s, the monitoring time of the corosyn is adjusted, the monitoring time is increased from the default 1s to 7s, and the configuration information is synchronized to all nodes through a command pcs cluster sync.
Preferably, the steps further comprise:
installing zfs high-availability components on all servers to/usr/lib/ocf/resource.d/heartbeat/this path;
the executed chmod + x gives an executable right;
creating a vip service to realize external provision of ip access, wherein the vip is bound to all high-availability nodes of the zfs server, and when one server fails, the vip can drift to other normal nodes immediately;
and (3) establishing a monitoring service of the network card through a pcs resource command, setting a monitoring period to be 5 seconds, repeating for 2 times, and setting single-time repetition time to be 2 seconds.
The technical scheme provided by the embodiment of the application can have the following beneficial effects:
the invention realizes a complete system for automatically switching from the bottom layer software and hardware heartbeat detection, the network card fault detection, the node fault detection, the service system, the vip and the zfs file system. The continuity of the service system is maintained at the end of the fault period, the uninterrupted client application is maintained, and the high availability characteristic of the multiple servers of the zfs file system is realized. Therefore, the invention greatly increases the service safety of the nas system, so that the nas system can meet more service application scenes, and the high-efficiency disaster-tolerant switching capability of the nas system is more beneficial to the application of the nas system to wider service fields.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic view of a flow structure of the present invention;
FIG. 2 is a link diagram of the present invention;
FIG. 3 is a schematic view of another flow structure of the present invention;
FIG. 4 is a schematic view of another flow structure of the present invention;
FIG. 5 is a flow structure design diagram of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Referring to fig. 1, the present invention provides a method 10 for implementing high availability of zfs multi-server, comprising the following steps:
preparing a plurality of hardware servers as deployed zfs high-availability services;
the server installs zfs software and loads a zfs.ko module;
multipath software device-map-multipath is installed on all server nodes, multipath service is started after installation is successful, and a multipath module is automatically loaded at the moment;
respectively sharing and mounting a magnetic disk hdd or ssd which is prepared to be stored as a zfs file system to all zfs servers through an iscsi protocol;
finding the volume and mounting the volume through an iscsiadm command, and finally, all the disks have a link on a server;
a multipath link is automatically generated by the multipath service.
When one of the links fails, other links are not affected, and the multi-activity of the disk is guaranteed. Please refer to fig. 2 for the link diagram.
Referring to fig. 3, the step of automatically generating a multipath link through the multipath service further includes:
mounting a pacemaker and corosync software on all the zfs node servers to form a cluster system;
when the pcs cluster is successfully deployed, adding a Delay service, and realizing a Delay function through a self-contained Delay service;
after the nodes fail, importing the zpool information into other nodes after the zpool is exported and the vip is switched;
the starting delay added to the delay service is increased from the default 30s to 60s, the monitoring time of the corosyn is adjusted, the monitoring time is increased from the default 1s to 7s, and the configuration information is synchronized to all nodes through a command pcs cluster sync.
In this embodiment, coroync is a cluster framework engine program, and is responsible for heartbeat detection, cluster status monitoring, message passing, and the like. The placemaker is a high-availability cluster resource manager, is responsible for command issuing and cluster maintenance, and is responsible for arbitrating nodes.
Referring to fig. 4, the steps further include:
installing zfs high-availability components on all servers to/usr/lib/ocf/resource.d/heartbeat/this path;
the executed chmod + x gives an executable right;
creating a vip service to realize the external provision of ip access, wherein the vip is bound to all high-availability nodes of a zfs server, and when one server fails, the vip can drift to other normal nodes immediately;
and (3) establishing a monitoring service of the network card through a pcs resource command, setting a monitoring period to be 5 seconds, repeating for 2 times, and setting single-time repetition time to be 2 seconds.
In this embodiment, the chmod + x is executed to give the executable authority under the zfs high-availability component/usr/lib/ocf/resource.d/heartbeat/this path, and this component is responsible for the switching function of the zfs file system after the node failure.
And creating a vip service to realize the external provision of ip access, wherein the vip is bound to the high-availability nodes of all the zfs servers, and when one server fails, the vip can immediately drift to other normal nodes and continuously maintain the tcp connection state with the client, so that the service is ensured not to be interrupted.
And (3) establishing a monitoring service of the network card through a pcs resource command, setting a monitoring period to be 5 seconds, repeating for 2 times, and setting single-time repetition time to be 2 seconds. The service is only responsible for monitoring the network card states of all nodes through link _ status _ only, and when the network card abnormality is detected, the zfs service migration operation is triggered.
Referring to fig. 5, fig. 5 is a flow structure design diagram of the present invention.
The technical scheme provided by the embodiment of the application can have the following beneficial effects:
the invention realizes a complete system for automatically switching from the bottom layer software and hardware heartbeat detection, the network card fault detection, the node fault detection, the service system, the vip and the zfs file system. The continuity of the service system is maintained at the end of the fault period, the uninterrupted client application is maintained, and the high availability characteristic of the multiple servers of the zfs file system is realized. Therefore, the invention greatly increases the service safety of the nas system, so that the nas system can meet more service application scenes, and the high-efficiency disaster-tolerant switching capability of the nas system is more beneficial to the application of the nas system to wider service fields.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (3)

1. A method for realizing high availability of a zfs multi-server is characterized by comprising the following steps:
preparing a plurality of hardware servers as deployed zfs high-availability services;
the server installs zfs software and loads a zfs.ko module;
multipath software device-map-multipath is installed on all server nodes, multipath service is started after installation is successful, and a multipath module is automatically loaded at the moment;
respectively sharing and mounting a magnetic disk hdd or ssd which is prepared to be stored as a zfs file system to all zfs servers through an iscsi protocol;
finding the volume and mounting the volume through an iscsiadm command, and finally, all the disks have a link on a server;
a multipath link is automatically generated by the multipath service.
2. The method of claim 1, wherein the step of automatically generating a multipath link via the multipathd service further comprises:
mounting a pacemaker and corosync software on all the zfs node servers to form a cluster system;
when the pcs cluster is successfully deployed, adding a Delay service, and realizing a Delay function through a self-contained Delay service;
after the zpool is exported after the node fails and the vip is switched, importing zpool information into another node;
and increasing the starting delay for the delay service from the default 30s to 60s, adjusting the monitoring time of the corosyn, increasing the monitoring time from the default 1s to 7s, and synchronizing the configuration information to all nodes by commanding pcs cluster sync.
3. The method of claim 2, wherein the steps further comprise:
installing zfs high-availability components on all servers to/usr/lib/ocf/resource.d/heartbeat/this path;
the execution chmod + x gives an executable authority;
creating a vip service to realize the external provision of ip access, wherein the vip is bound to all high-availability nodes of a zfs server, and when one server fails, the vip can drift to other normal nodes immediately;
and (3) establishing a monitoring service of the network card through a pcs resource command, setting a monitoring period to be 5 seconds, repeating for 2 times, and setting single-time repetition time to be 2 seconds.
CN202211136364.3A 2022-09-19 2022-09-19 Method for realizing high availability of zfs multi-server Pending CN115514765A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211136364.3A CN115514765A (en) 2022-09-19 2022-09-19 Method for realizing high availability of zfs multi-server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211136364.3A CN115514765A (en) 2022-09-19 2022-09-19 Method for realizing high availability of zfs multi-server

Publications (1)

Publication Number Publication Date
CN115514765A true CN115514765A (en) 2022-12-23

Family

ID=84504802

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211136364.3A Pending CN115514765A (en) 2022-09-19 2022-09-19 Method for realizing high availability of zfs multi-server

Country Status (1)

Country Link
CN (1) CN115514765A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7890793B1 (en) * 2008-05-21 2011-02-15 Symantec Corporation Techniques for restoring file system resources
CN105260377A (en) * 2015-09-01 2016-01-20 浪潮(北京)电子信息产业有限公司 An upgrade method and system based on tiered storage
CN111488395A (en) * 2020-04-02 2020-08-04 中国船舶重工集团公司第七一六研究所 Double-node high-availability distributed storage system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7890793B1 (en) * 2008-05-21 2011-02-15 Symantec Corporation Techniques for restoring file system resources
CN105260377A (en) * 2015-09-01 2016-01-20 浪潮(北京)电子信息产业有限公司 An upgrade method and system based on tiered storage
CN111488395A (en) * 2020-04-02 2020-08-04 中国船舶重工集团公司第七一六研究所 Double-node high-availability distributed storage system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
EWWHITE: "ZFS High-Availability NAS", pages 1 - 18, Retrieved from the Internet <URL:https://github.com/ewwhite/zfs-ha/wiki> *

Similar Documents

Publication Publication Date Title
US7370336B2 (en) Distributed computing infrastructure including small peer-to-peer applications
CN107343034B (en) QConf-based Redis high availability system and method
US7370083B2 (en) System and method for providing virtual network attached storage using excess distributed storage capacity
KR101547719B1 (en) Maintaining data integrity in data servers across data centers
US5822531A (en) Method and system for dynamically reconfiguring a cluster of computer systems
US20030120772A1 (en) Data fail-over for a multi-computer system
US7085956B2 (en) System and method for concurrent logical device swapping
US20070061379A1 (en) Method and apparatus for sequencing transactions globally in a distributed database cluster
US20070180309A1 (en) System and method for mirroring data
CN111949444A (en) Data backup and recovery system and method based on distributed service cluster
JP2009529193A (en) Data storage system
CN101808127A (en) Data backup method, system and server
CN111935244B (en) Service request processing system and super-integration all-in-one machine
CN115878384A (en) Distributed cluster based on backup disaster recovery system and construction method
CN108984320A (en) A kind of anti-fissure method and device of message queue cluster
CN112202853A (en) Data synchronization method, system, computer device and storage medium
CN107357800A (en) A kind of database High Availabitity zero loses solution method
US20200183800A1 (en) Dynamic data restoration from multiple recovery sites implementing synchronous remote mirroring
CN117675835A (en) LDAP high-availability system based on Kubernetes environment and implementation method
CN116594812A (en) Disaster recovery method, system, equipment and storage medium for cluster
US20160056996A1 (en) System and Method for Implementing High Availability of Server in Cloud Environment
CN115514765A (en) Method for realizing high availability of zfs multi-server
CN111367711A (en) Safety disaster recovery method based on super fusion data
CN116069860A (en) Data synchronization method and multi-activity system
Kolano High performance reliable file transfers using automatic many-to-many parallelization

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination