CN108133034B - Shared storage access method and related device - Google Patents

Shared storage access method and related device Download PDF

Info

Publication number
CN108133034B
CN108133034B CN201810016667.9A CN201810016667A CN108133034B CN 108133034 B CN108133034 B CN 108133034B CN 201810016667 A CN201810016667 A CN 201810016667A CN 108133034 B CN108133034 B CN 108133034B
Authority
CN
China
Prior art keywords
host
shared storage
access
storage device
shared
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.)
Active
Application number
CN201810016667.9A
Other languages
Chinese (zh)
Other versions
CN108133034A (en
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.)
New H3C Cloud Technologies Co Ltd
Original Assignee
New H3C Cloud Technologies 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 New H3C Cloud Technologies Co Ltd filed Critical New H3C Cloud Technologies Co Ltd
Priority to CN201810016667.9A priority Critical patent/CN108133034B/en
Publication of CN108133034A publication Critical patent/CN108133034A/en
Application granted granted Critical
Publication of CN108133034B publication Critical patent/CN108133034B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/188Virtual file systems
    • G06F16/196Specific adaptations of the file system to access devices and non-file objects via standard file system access operations, e.g. pseudo file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0727Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a storage system, e.g. in a DASD or network based storage system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/176Support for shared access to files; File sharing support
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45579I/O management, e.g. providing access to device drivers or storage

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention relates to the technical field of shared storage, and provides a shared storage access method and a related device, wherein a first host, a second host and a shared storage device which is connected with the first host and the second host form a shared access system, a first access link is pre-established between the first host and the second host and the shared storage device, and a second access link is pre-established between the first host and the second host; the method comprises the following steps: when the first host detects that the access to the shared storage device is failed, the first host accesses the second host through the second access link, and the shared storage device is accessed through the first access link between the second host and the shared storage device. The shared storage access method provided by the embodiment of the invention can realize indirect access of the first host to the shared storage device, ensure that the first host can always access the shared storage device, and improve the reliability of the first host in accessing the shared storage device.

Description

Shared storage access method and related device
Technical Field
The invention relates to the technical field of shared storage, in particular to a shared storage access method and a related device.
Background
The shared file system is a cluster formed by a plurality of nodes, the plurality of nodes can access the same storage space, a file is read and written on any node, other nodes can access the file, and the read and write permissions are negotiated among the nodes through a distributed lock. A shared file system is usually established on each host to access the storage device, so as to implement file sharing among the hosts, and once a failure occurs when a host accesses the storage device, the host cannot access the shared file, which brings inconvenience.
Disclosure of Invention
Embodiments of the present invention provide a shared storage access method and a related apparatus, so as to improve reliability of a host accessing a storage device.
In order to achieve the above purpose, the embodiment of the present invention adopts the following technical solutions:
in a first aspect, an embodiment of the present invention provides a shared storage access method, which is applied to a first host in a shared access system, where the shared access system includes: the system comprises a first host, a second host and a shared storage device connected with the first host and the second host, wherein a first access link is pre-established between the first host and the shared storage device, and a second access link is pre-established between the first host and the second host; the method comprises the following steps: and when the first host detects that the access to the shared storage device is failed, the first host accesses the second host through the second access link, and the shared storage device is accessed through the first access link between the second host and the shared storage device.
In a second aspect, an embodiment of the present invention provides a shared storage access apparatus, which is applied to a first host in a shared access system, where the shared access system includes: the system comprises a first host, a second host and a shared storage device connected with the first host and the second host, wherein a first access link is pre-established between the first host and the shared storage device, and a second access link is pre-established between the first host and the second host; the device comprises a detection module and a first execution module. The detection module is used for detecting the access state of the first host to the shared storage device, and sending a detection result when detecting that the access to the shared storage device is failed; the first execution module is used for accessing the second host through the second access link and accessing the shared storage device through the first access link between the second host and the shared storage device when receiving a result that the detection module detects that the access to the shared storage device is failed.
In a third aspect, an embodiment of the present invention further provides a first host, where the first host, the second host, and a shared storage device connected to both the first host and the second host form a shared access system, a first access link is pre-established between the first host and the shared storage device, and a second access link is pre-established between the first host and the second host. The first host includes: one or more processors; memory for storing one or more programs that, when executed by the one or more processors, cause the one or more processors to implement the shared memory access method described above.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the above-mentioned shared storage access method.
Compared with the prior art, in the shared storage access method and the related device provided by the embodiments of the present invention, the first host, the second host, and the shared storage device connected to both the first host and the second host form a shared access system, in general, the first host and the second host access the shared storage device, when the first host detects that the access to the shared storage device is failed, the first host firstly accesses the second host through a second access link which is pre-established between the first host and the second host, the shared storage is accessed via a pre-established first access link between the second host and the shared storage, therefore, indirect access of the first host to the shared storage device is realized, the first host can be guaranteed to be always capable of accessing the shared storage device, and reliability of the first host for accessing the shared storage device is improved.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
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 embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a block diagram illustrating a shared access system according to an embodiment of the present invention.
Fig. 2 is a flowchart illustrating a shared storage access method according to a first embodiment of the present invention.
Fig. 3 is a block diagram of a first host according to a second embodiment of the present invention.
Fig. 4 is a block diagram illustrating a shared storage access apparatus according to a third embodiment of the present invention.
Icon: 10-a first host; 20-a second host; 30-shared storage; 101-a processor; 102-a memory; 103-a bus; 104-a communication interface; 200-shared storage access means; 201-a detection module; 202-a first execution module; 203-second execution module.
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 only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present invention, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Referring to fig. 1, fig. 1 is a block diagram illustrating a shared access system according to an embodiment of the present invention. The shared access system includes a first host 10, at least one second host 20, and a shared storage device 30, wherein the first host 10 and the second host 20 are both connected to the shared storage device 30 via a network, and the first host 10 and the second host 20 may be connected to the shared storage device 30 via a storage network, which may be, but is not limited to, an ip storage network, an fc storage network, and the like. The second host 20 and the first host 10 are connected by a network, and the second host 20 and the first host 10 may be connected by an internal service network or a management network.
In the embodiment of the present invention, a first access link is pre-established between the first host 10 and the second host 20 and the shared storage device 30, and a second access link is pre-established between the first host 10 and the second host 20. The first host 10, the second host 20 may be, but are not limited to, a physical host, a virtual host, and the like. The Operating System (OS) of the first host 10 and the second host 20 may be, but is not limited to, a Windows system, a Linux operating system, and the like. The shared storage 30 may be, but is not limited to, a storage server, a file server, and the like.
It should be noted that the first host 10, the shared storage apparatus 30, and the plurality of nodes form a shared file cluster, the first host 10 and the plurality of nodes can access the shared storage apparatus 30, and a shared access system is established in the shared file cluster. In order to improve the reliability of the first host 10 accessing the shared storage 30, at least one node with high reliability is selected from the plurality of nodes as the second host 20, so that a second access link is pre-established between the first host 10 and the second host 20. The second host 20 may be selected according to host attributes corresponding to each node, such as CPU occupancy, IP address sorting, host name sorting, and the like.
First embodiment
Referring to fig. 2, fig. 2 is a flowchart illustrating a shared memory access method according to an embodiment of the present invention. The shared storage access method comprises the following steps:
step S101, when the first host detects that the access to the shared storage device is failed, the first host accesses the second host through the second access link, and accesses the shared storage device through the first access link between the second host and the shared storage device.
In the embodiment of the present invention, the first host 10 and the second host 20 respectively have a first access link pre-established with the shared storage device 30, and the first access link includes a shared file system access link. That is, the first host 10 and the second host 20 are each pre-configured with a shared file system for accessing the shared storage 30. The shared file system may be, but is not limited to, an ocfs2 file system, a vmfs file system, or the like. Taking the first host 10 as an example, the method for establishing the shared file system on the first host 10 may be: first, an ocfs2 file system is established on the first host 10; the ocfs2 file system is then mounted under the local directory of the first host 10.
In the embodiment of the present invention, a second access link is pre-established between the first host 10 and the second host 20, and the second access link includes a network file system access link. That is, the first host 10 and the second host 20 are pre-configured with a network file system for establishing a network file system access link, so that the first host 10 can access the second host 20 through the network file system access link. The network file system may be, but is not limited to, an nfs file system, a cifs file system, and the like.
As an embodiment, the method for configuring the network file system for establishing the network file system access link on the first host 10 and the second host 20 may be: first, configuring the second host 20 as a server of a network file system, for example, configuring nfs server export/ocfs2 on the second host 20, that is, configuring the second host 20 as a server of an nfs file system, and its output directory is/ocfs 2; then, a network file system of the first host 10 accessing the second host 20 is established on the first host 10, and the first host 10 is set as a network file system client and the second host 20 is set as a network file system server, that is, the first host 10 mounts the output directory of the second host 20 under the local directory of the first host 10, thereby establishing a network file system access link between the first host 10 and the second host 20.
In the embodiment of the present invention, the shared file system and the network file system established on the first host 10 may be merged into a virtual file system, the virtual file system is mounted under the local directory of the first host 10, and the mounting point may be named as/ocfsnfs.
In the embodiment of the present invention, the first host 10 defaults to directly access the shared storage device 30 through a pre-established shared file system access link between the first host 10 and the shared storage device 30, and when the first host 10 detects that the access to the shared storage device 30 is failed, the second host 20 is accessed through the pre-established network file system access link between the first host 10 and the second host 20, and the shared storage device 30 is accessed through the pre-established shared file system access link between the second host 20 and the shared storage device 30.
As an embodiment, the access state of the first host 10 to the shared storage device 30 may be detected by a detection process on the first host 10, where the detection method may be real-time detection, or detection may be performed at preset time intervals (for example, 5 seconds), or when access fails, information of the failure is fed back to the first host 10, and this is not limited herein. When the detection process on the first host 10 detects that the access to the shared storage 30 is failed, the detection process sends a detection result to the file system daemon of the first host 10. When the file system daemon of the first host 10 receives the detection result that the access to the shared storage device 30 is failed, the shared storage access path is switched, that is, the second host 20 is accessed through the network file system access link pre-established between the first host 10 and the second host 20, and the shared storage device 30 is accessed through the shared file system access link pre-established between the second host 20 and the shared storage device 30.
In order to effectively improve the utilization rate of the hosts, a virtual machine is usually deployed on the first host 10, and a disk image file of the virtual machine is placed on a shared file system configured on the first host 10, and in the shared file cluster in the prior art, when the first host 10 accesses the shared storage device 30 abnormally, the virtual machine is frozen.
In the embodiment of the present invention, when a virtual machine is deployed on the first host 10, the disk image file of the virtual machine is stored in a virtual file system formed by merging a shared file system and a network file system established on the first host 10, for example, the disk image file of the virtual machine is stored in/ocfsnfs. The first host 10 defaults to directly access the shared storage device 30 through a pre-established shared file system access link between the first host 10 and the shared storage device 30, and when the first host 10 detects that access to the shared storage device 30 fails, path switching is performed, that is, the second host 20 is accessed through a pre-established network file system access link between the first host 10 and the second host 20, and the shared storage device 30 is accessed through a pre-established shared file system access link between the second host 20 and the shared storage device 30, and since the virtual machine does not sense path switching inside the virtual file system, the virtual machine can continue to operate normally.
In practical applications, there are usually a plurality of second hosts 20, so a network file system access link can be pre-established between the first host 10 and each second host 20 to ensure that a plurality of backup paths can be switched when the first host 10 fails to access the shared storage device 30. For example, if the first host 10 is a, and the second host 20 has two hosts, respectively B and C, an a-B network file system access link is first established on a, where a is a network file system client and B is a network file system server; and then establishing an A-C network file system access link on A, wherein A is a network file system client and C is a network file system server.
When the first host 10 detects that the access to the shared storage apparatus 30 is failed, a target second host is selected from the plurality of second hosts 20 according to a preset rule, the target second host is accessed through a network file system access link pre-established between the first host 10 and the target second host, and the first host 10 accesses the shared storage apparatus 30 through a shared file system access link pre-established between the target second host and the shared storage apparatus 30.
As an embodiment, the method for selecting the target second host from the plurality of second hosts 20 according to the preset rule may be: firstly, at least one host to be accessed, which has a normal access state to the shared storage apparatus 30, is selected from the plurality of second hosts 20, and the host to be accessed may be the second host 20 which can be normally accessed by the first host 10 and can normally access the shared storage apparatus 30; and then, selecting a target second host according to host attributes corresponding to each host to be accessed, wherein the host attributes comprise at least one of CPU occupancy rate, IP address sorting and host name sorting.
In the embodiment of the present invention, when there are a plurality of second hosts 20 and a network file system access link is pre-established between the first host 10 and each second host 20, if a detection process on the first host 10 detects that the access of the first host 10 to the shared storage device 30 fails, the detection process sends a detection result to a file system daemon of the first host 10; when the file system daemon of the first host 10 receives a detection result that the access of the first host 10 to the shared storage device 30 is failed, at first, at least one host to be accessed, which can be normally accessed by the first host 10 and can normally access the shared storage device 30, is selected from the plurality of second hosts 20, and then a target second host is selected according to the host attribute corresponding to each host to be accessed; after the target second host is selected, the target second host is accessed through a network file system access link pre-established between the first host 10 and the target second host, and the first host 10 accesses the shared storage device 30 through a shared file system access link pre-established between the target second host and the shared storage device 30.
In the embodiment of the present invention, when there are a plurality of second hosts 20 and virtual machines are deployed on the first host 10, and the disk image file of the virtual machine is stored in the virtual file system formed by the shared file system and the network file system established on the first host 10, since the virtual machine does not sense the path switching inside the virtual file system, that is, a path from the first host 10 directly accessing the shared storage 30 through the shared file system access link, switches to the first host 10 accessing the target second host through the network file system access link pre-established between the first host 10 and the target second host, the path of access to the shared storage 30 through the pre-established shared file system access link between the target second host and the shared storage 30, and thus the virtual machine deployed on the first host 10 continues to operate normally.
In the embodiment of the present invention, when the first host 10 recovers the access to the shared storage device 30, the first host 10 may also recover the direct access to the shared storage device 30, and therefore, the embodiment of the present invention may further include:
step S102, when the first host detects that the access connection to the shared storage device is recovered, the first host directly accesses the shared storage device through a first access link pre-established with the shared storage device.
In the embodiment of the present invention, when the detection process on the first host 10 detects that the access connection to the shared storage apparatus 30 is recovered, the detection process switches to the pre-established shared file system access link between the first host 10 and the shared storage apparatus 30 to directly access the shared storage apparatus 30.
Compared with the prior art, the shared storage access method provided by the embodiment of the invention has the beneficial effects that:
first, when the first host 10 fails to access the shared storage device 30 and the second host 20 can normally access the shared storage device 30, the path switching is performed inside the virtual file system, so that the first host 10 directly accesses the shared storage device 30 through the first access link between the first host 10 and the shared storage device 30, the first host 10 accesses the second host 20 through the second access link, and the shared storage device 30 is accessed through the first access link between the second host 20 and the shared storage device 30. If the first host 10 is deployed with a virtual machine, the virtual machine continues to operate normally as the virtual machine does not sense the path switching inside the virtual file system;
secondly, when there are multiple second hosts 20, a network file system access link is pre-established between the first host 10 and each second host 20, so that multiple backup paths for the first host 10 to access the shared storage device 30 can be ensured to switch when a failure occurs, and the reliability is higher.
In addition, the shared storage access method provided in the embodiment of the present invention may be used to implement access path backup of a file, and the access path backup of the file generally has two ways: local backup and remote backup, however, the problem of insufficient local storage space is easily caused in the local backup; remote backup usually needs to write multiple files at the same time, and performance problems such as data loss and the like are easy to occur. When the access path of the file is backed up by using the shared storage access method provided by the embodiment of the invention, the first host 10 is normally written into the shared storage device 30, and if the first host 10 fails, the file is indirectly written into the shared storage device 30 through the second host 20 and is written once, so that the problem that the first host 10 does not have enough storage space is solved, and the problem that the file does not need to be written into the shared storage device 30 in real time is solved.
Second embodiment
Referring to fig. 3, fig. 3 is a block diagram illustrating a first host 10 according to a second embodiment of the present invention. The first host 10 comprises a processor 101, a memory 102, a bus 103 and a communication interface 104, wherein the processor 101, the memory 102 and the communication interface 104 are connected through the bus 103; the processor 101 is for executing executable modules, such as computer programs, stored in the memory 102.
The Memory 102 may include a high-speed Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized by at least one communication interface 104 (which may be wired or wireless).
Bus 103 may be an ISA bus, PCI bus, EISA bus, or the like. Only one bi-directional arrow is shown in fig. 3, but this does not indicate only one bus or one type of bus.
The memory 102 is used for storing programs, such as the shared memory access device 200 shown in fig. 4. The shared memory access device 200 includes at least one software function module which may be stored in the memory 102 in the form of software or firmware (firmware) or fixed in the operating system of the first host 10. After receiving the execution instruction, the processor 101 executes the program to implement the shared memory access method disclosed in the first embodiment of the present invention.
The processor 101 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 101. The Processor 101 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The storage medium is located in the memory 102, and the processor 101 reads the information in the memory 102 and completes the steps of the method in combination with the hardware thereof.
The embodiment also provides a computer-readable storage medium, on which a computer program is stored, and the computer program realizes the shared storage access method disclosed in the first embodiment of the present invention when being executed by the processor 101.
Third embodiment
Referring to fig. 4, fig. 4 is a block diagram illustrating a shared memory access apparatus 200 according to a third embodiment of the present invention. The shared memory access device 200 is stored in the memory 102 of the first host 10 provided in the second embodiment of the present invention and is executed by the processor 101 of the first host 10. The shared memory access device 200 includes a detection module 201, a first execution module 202, and a second execution module 203.
The detecting module 201 is configured to detect an access state of the first host to the shared storage device, and send a detection result when detecting that an access failure occurs to the shared storage device.
In the embodiment of the present invention, the detection module 201 may be a detection process on the first host 10.
A first executing module 202, configured to, when receiving a result that the detecting module detects that the access to the shared storage apparatus is failed, access the second host through the second access link, and access the shared storage apparatus through the first access link between the second host and the shared storage apparatus.
In the embodiment of the present invention, when the detection process of the detection module 201 detects that the access of the first host 10 to the shared storage device 30 is failed, the detection process sends a detection result to the file system daemon of the first execution module 202, so that the virtual file system switches the shared storage access path, that is, accesses the second host 20 through the second access link, and accesses the shared storage device 30 through the first access link between the second host 20 and the shared storage device 30.
In an embodiment of the invention, the first access link comprises a shared file system access link, and the second access link comprises a network file system access link; the first executing module 202 is specifically configured to, when the first host 10 detects that the access to the shared storage device 30 is failed, access the second host 20 through a network file system access link pre-established between the first host 10 and the second host 20, and the first host 10 accesses the shared storage device 30 through the shared file system access link pre-established between the second host 20 and the shared storage device 30.
In this embodiment of the present invention, when the number of the second hosts 20 is multiple, the first executing module 202 is specifically configured to, when the first host 10 detects that the access to the shared storage device 30 fails, select a target second host from the multiple second hosts 20 according to a preset rule, access the target second host through a network file system access link pre-established between the first host 10 and the target second host, and the first host 10 accesses the shared storage device 30 through a shared file system access link pre-established between the target second host and the shared storage device 30.
The second executing module 203 is configured to, when the first host detects that the access connection to the shared storage device is recovered, perform direct access to the shared storage device through the first access link pre-established with the shared storage device by the first host.
In summary, in the shared storage access method and the related apparatus provided in the embodiments of the present invention, the first host, the second host, and the shared storage apparatus connected to both the first host and the second host form a shared access system, a first access link is pre-established between the first host and the second host and the shared storage apparatus, and a second access link is pre-established between the first host and the second host; the method comprises the following steps: and when the first host detects that the access to the shared storage device is failed, the first host accesses the second host through the second access link, and the shared storage device is accessed through the first access link between the second host and the shared storage device. The shared storage access method provided by the embodiment of the invention can realize indirect access of the first host to the shared storage device, ensure that the first host can always access the shared storage device, and improve the reliability of the first host in accessing the shared storage device.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes. It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.

Claims (10)

1. A shared storage access method applied to a first host in a shared access system, the shared access system comprising: the system comprises a first host, a second host and a shared storage device connected with the first host and the second host, wherein a first access link is pre-established between the first host and the shared storage device, and a second access link is pre-established between the first host and the second host; the method comprises the following steps:
when the first host detects that the access to the shared storage device is failed, the first host accesses the second host through the second access link, and accesses the shared storage device through a first access link between the second host and the shared storage device, wherein the first access link comprises a shared file system access link, the second access link comprises a network file system access link, a virtual machine is deployed on the first host, and a virtual image file of the virtual machine is stored on a virtual file system formed by a shared file system and a network file system established on the first host.
2. The method of claim 1, wherein the step of accessing the second host over the second access link when the first host detects a failure in accessing the shared storage, the step of accessing the shared storage over the first access link between the second host and the shared storage comprising:
when the first host detects that the access to the shared storage device is failed, the second host is accessed through the network file system access link which is pre-established between the first host and the second host, and the first host accesses the shared storage device through the shared file system access link which is pre-established between the second host and the shared storage device.
3. The method of claim 2, wherein when the second host is multiple, and when the first host detects a failure in accessing the shared storage, the step of accessing the second host through the second access link and accessing the shared storage through the first access link between the second host and the shared storage comprises:
when the first host detects that the access to the shared storage device is failed, a target second host is selected from the multiple second hosts according to a preset rule, the target second host is accessed through a network file system access link pre-established between the first host and the target second host, and the first host accesses the shared storage device through a shared file system access link pre-established between the target second host and the shared storage device.
4. The method of claim 3, wherein the selecting a target second host among the plurality of second hosts according to a preset rule when the first host detects that the access to the shared storage device is failed comprises:
when the first host detects that the access to the shared storage device is failed, selecting at least one host to be accessed from a plurality of second hosts, wherein the access state of the host to be accessed to the shared storage device is normal;
and selecting the target second host according to host attributes corresponding to each host to be accessed, wherein the host attributes comprise at least one of CPU occupancy rate, IP address sorting and host name sorting.
5. The method of claim 1 or 3, wherein the method further comprises:
when the first host detects that the access connection to the shared storage device is recovered, the first host directly accesses the shared storage device through the first access link pre-established between the first host and the shared storage device.
6. A shared storage access apparatus for use with a first host in a shared access system, the shared access system comprising: the system comprises a first host, a second host and a shared storage device connected with the first host and the second host, wherein a first access link is pre-established between the first host and the shared storage device, and a second access link is pre-established between the first host and the second host; the device comprises:
the detection module is used for detecting the access state of the first host to the shared storage device and sending a detection result when detecting that the access to the shared storage device is failed;
a first executing module, configured to, when receiving a result that the detecting module detects that access to the shared storage device is failed, access the second host through the second access link, and access the shared storage device through a first access link between the second host and the shared storage device, where the first access link includes a shared file system access link, the second access link includes a network file system access link, and a virtual machine is deployed on the first host, and a virtual image file of the virtual machine is stored in a virtual file system formed by a shared file system and a network file system established on the first host.
7. The apparatus of claim 6, wherein the first execution module is specifically configured to:
when the first host detects that the access to the shared storage device is failed, the second host is accessed through the network file system access link which is pre-established between the first host and the second host, and the first host accesses the shared storage device through the shared file system access link which is pre-established between the second host and the shared storage device.
8. The apparatus of claim 7, wherein when the second host is multiple, the first execution module is specifically configured to:
when the first host detects that the access to the shared storage device is failed, a target second host is selected from the multiple second hosts according to a preset rule, the target second host is accessed through a network file system access link pre-established between the first host and the target second host, and the first host accesses the shared storage device through a shared file system access link pre-established between the target second host and the shared storage device.
9. A first host computer is characterized in that the first host computer, a second host computer and a shared storage device connected with the first host computer and the second host computer form a shared access system, a first access link is pre-established between the first host computer and the shared storage device, a second access link is pre-established between the first host computer and the second host computer; the first host includes:
one or more processors;
memory for storing one or more programs that, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-5.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN201810016667.9A 2018-01-08 2018-01-08 Shared storage access method and related device Active CN108133034B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810016667.9A CN108133034B (en) 2018-01-08 2018-01-08 Shared storage access method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810016667.9A CN108133034B (en) 2018-01-08 2018-01-08 Shared storage access method and related device

Publications (2)

Publication Number Publication Date
CN108133034A CN108133034A (en) 2018-06-08
CN108133034B true CN108133034B (en) 2021-07-06

Family

ID=62400509

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810016667.9A Active CN108133034B (en) 2018-01-08 2018-01-08 Shared storage access method and related device

Country Status (1)

Country Link
CN (1) CN108133034B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110119400B (en) * 2019-04-04 2021-07-20 上海易点时空网络有限公司 Unique identifier generation method and device suitable for logic operation
CN112948158A (en) * 2021-02-19 2021-06-11 山东英信计算机技术有限公司 File sharing method, device, equipment and computer readable storage medium
CN115794434A (en) * 2022-11-18 2023-03-14 电子科技大学 Shared storage-based multi-die integrated micro system and multi-die interaction method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04340155A (en) * 1991-05-16 1992-11-26 Fuji Facom Corp Fault recovery device for shared link structure in computer system
CN102662751A (en) * 2012-03-30 2012-09-12 浪潮电子信息产业股份有限公司 Method for improving availability of virtual machine system based on thermomigration
CN104320274A (en) * 2014-10-24 2015-01-28 华为技术有限公司 Disaster tolerance method and device
CN105718589A (en) * 2016-01-26 2016-06-29 华为技术有限公司 File access method and device
CN106776113A (en) * 2016-02-18 2017-05-31 新华三技术有限公司 A kind of virtual machine backup method and device
CN107453888A (en) * 2016-05-31 2017-12-08 深圳市深信服电子科技有限公司 The management method and device of the cluster virtual machine of high availability

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100417094C (en) * 2006-01-11 2008-09-03 大唐移动通信设备有限公司 Network failure recovery method with redundancy port
CN101394301A (en) * 2007-09-21 2009-03-25 华为技术有限公司 Micro general hardware platform system, apparatus for telecommunication and computer, and communication method thereof
WO2015139327A1 (en) * 2014-03-21 2015-09-24 华为技术有限公司 Failover method, apparatus and system
US10114691B2 (en) * 2014-04-21 2018-10-30 Hitachi, Ltd. Information storage system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04340155A (en) * 1991-05-16 1992-11-26 Fuji Facom Corp Fault recovery device for shared link structure in computer system
CN102662751A (en) * 2012-03-30 2012-09-12 浪潮电子信息产业股份有限公司 Method for improving availability of virtual machine system based on thermomigration
CN104320274A (en) * 2014-10-24 2015-01-28 华为技术有限公司 Disaster tolerance method and device
CN105718589A (en) * 2016-01-26 2016-06-29 华为技术有限公司 File access method and device
CN106776113A (en) * 2016-02-18 2017-05-31 新华三技术有限公司 A kind of virtual machine backup method and device
CN107453888A (en) * 2016-05-31 2017-12-08 深圳市深信服电子科技有限公司 The management method and device of the cluster virtual machine of high availability

Also Published As

Publication number Publication date
CN108133034A (en) 2018-06-08

Similar Documents

Publication Publication Date Title
US11163653B2 (en) Storage cluster failure detection
US10977277B2 (en) Systems and methods for database zone sharding and API integration
US8655851B2 (en) Method and system for performing a clean file lock recovery during a network filesystem server migration or failover
US10997211B2 (en) Systems and methods for database zone sharding and API integration
US8533171B2 (en) Method and system for restarting file lock services at an adoptive node during a network filesystem server migration or failover
US9934107B1 (en) Designating backup nodes and backing up in parallel in a high-availability environment
US9075856B2 (en) Systems and methods for distributing replication tasks within computing clusters
CN106776130B (en) Log recovery method, storage device and storage node
WO2018121456A1 (en) Data storage method, server and storage system
CN108540315B (en) Distributed storage system, method and device
CN108133034B (en) Shared storage access method and related device
US10855515B2 (en) Implementing switchover operations between computing nodes
KR101983208B1 (en) Data management method, node and system for database cluster
CN111176888B (en) Disaster recovery method, device and system for cloud storage
US11184435B2 (en) Message transmission method and apparatus in cluster file system
US11210003B2 (en) Method, device and computer program product for restoring data based on replacing child node identifiers with parent node identifier
US10509705B2 (en) Application protection through a combined functionality failure manager
US8683258B2 (en) Fast I/O failure detection and cluster wide failover
CN111049928A (en) Data synchronization method, system, electronic device and computer readable storage medium
CN111818124B (en) Data storage method, data storage device, electronic equipment and medium
CN113157487A (en) Data recovery method and apparatus thereof
CN106708865B (en) Method and device for accessing window data in stream processing system
CN112600690B (en) Configuration data synchronization method, device, equipment and storage medium
CN111787113B (en) Node fault processing method and device, storage medium and electronic equipment
US9465654B2 (en) Intelligent failover or shutdown of an application using input/output shipping in response to loss of connectivity to data storage in a cluster

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
GR01 Patent grant
GR01 Patent grant