CN111225020B - User mode network file system dual-stack access method, device and equipment - Google Patents

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

Info

Publication number
CN111225020B
CN111225020B CN201911083371.XA CN201911083371A CN111225020B CN 111225020 B CN111225020 B CN 111225020B CN 201911083371 A CN201911083371 A CN 201911083371A CN 111225020 B CN111225020 B CN 111225020B
Authority
CN
China
Prior art keywords
client
address
connection
fault
shared directory
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
CN201911083371.XA
Other languages
Chinese (zh)
Other versions
CN111225020A (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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN201911083371.XA priority Critical patent/CN111225020B/en
Priority to PCT/CN2020/073116 priority patent/WO2021088254A1/en
Publication of CN111225020A publication Critical patent/CN111225020A/en
Application granted granted Critical
Publication of CN111225020B publication Critical patent/CN111225020B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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]
    • 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
    • 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/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/686Types of network addresses using dual-stack hosts, e.g. in Internet protocol version 4 [IPv4]/Internet protocol version 6 [IPv6] networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a dual-stack access method of a user mode network file system, which comprises the following steps: establishing a first connection with the client by using a first IP address of the client, and providing access service for the client through the first connection by using the specified shared directory; when the first connection is disconnected, determining a second IP address of the client through an identifier field corresponding to the client; establishing a second connection between the designated shared directory and the client by using the second IP address; the method allows the client to be connected with the server by a first IP address and a second IP address, and the IP protocol version numbers of the two IP addresses are different; therefore, when the first connection is interrupted, the identifier field can be used for determining a second IP address of the client, and the connection can be reestablished by using the second IP address; the invention also provides a dual-stack access device, equipment and a computer readable storage medium of the user mode network file system, and the dual-stack access device, the equipment and the computer readable storage medium also have the beneficial effects.

Description

User mode network file system dual-stack access method, device and equipment
Technical Field
The invention relates to the technical field of file systems, in particular to a dual-stack access method of a user mode network file system, a dual-stack access device of the user mode network file system, dual-stack access equipment of the user mode network file system and a computer readable storage medium.
Background
Nfs (network File system), a kernel-mode network File system, is one of File systems supported by FreeBSD, and allows computers in a network to share resources through a TCP/IP network. When the NFS is applied, a client application that has the NFS mounted locally can transparently read and write files located on a remote NFS server, just like accessing local files. The NFS-Ganesha is a user-mode network file system, belongs to an open source project, and has better manageability and maintainability compared with a kernel-mode network file system in a system service fault scene, and the user-mode NFS-Ganesha is easy to implement and maintain, so that the application prospect of mass large-data distributed object storage NFS-Ganesha is very wide. However, a server in the existing user-mode network file system only allows access to one IP address, and there is only one network connection between the server and one client, that is, only allows access to the IPV4 address or only allows access to the IPV6 address, and when the server loses the network connection with the client, the server needs to be restarted to recover the network connection, which is complex in operation and high in cost. Therefore, the existing user mode network file system has the problem of difficult recovery after network connection failure.
Therefore, how to solve the problem that the existing user-mode network file system is difficult to recover after network connection failure is a technical problem to be solved by the technical personnel in the field.
Disclosure of Invention
In view of the above, the present invention provides a dual-stack access method for a user-mode network file system, a dual-stack access device for a user-mode network file system, and a computer-readable storage medium, which solve the problem of difficult recovery after a network connection failure in the existing user-mode network file system.
In order to solve the technical problem, the invention provides a dual-stack access method for a user mode network file system, which comprises the following steps:
establishing a first connection with a client by using a first IP address of the client, and providing access service for the client through the first connection by using a specified shared directory; the appointed shared directory is a shared directory with a mounting format corresponding to the IP protocol version of the first IP address;
when the first connection is disconnected, determining a second IP address of the client through an identifier field corresponding to the client; wherein the first IP address and the second IP address have different IP protocol versions;
establishing a second connection between the designated shared directory and the client using the second IP address.
Optionally, the method further includes:
when fault information of an NFS file lock of a target file is received, analyzing the fault information, and determining the type of the fault of the NFS file lock; wherein the target file is a file accessed by the client;
when the NFS file lock fault is a first type fault, sending notification information to the client; wherein, the first type of fault is a fault caused by a server operation error;
when the NFS file lock fault is a second type fault, releasing the NFS file lock; and the second type of fault is a fault caused by connection interruption between the client and the second type of fault.
Optionally, the method further includes:
when a first NFS request sent by the client is received, acquiring a client sequence ID of the client;
generating an identifier ID in the identifier field using the client sequence ID, and composing the identifier field using the identifier ID, the first IP address, and the second IP address.
Optionally, the establishing a first connection with the client by using a first IP address of the client, and providing an access service for the client through the first connection by using a specified shared directory includes:
acquiring an access request sent by the client through the first IP address, and determining equipment appointed by the access request in the appointed shared directory;
and establishing the first connection between the client and the specified shared directory, and providing the access service for the client by using the first connection.
Optionally, the determining, in the specified shared directory, a device specified by the access request includes:
judging whether the equipment exists in the specified shared directory or not;
if not, mounting the equipment into the specified shared directory according to a target mounting format; wherein the target mount format corresponds to the IP protocol version of the first IP address;
if yes, determining the equipment specified by the access request.
Optionally, the obtaining the access request sent by the client through the first IP address includes:
and establishing a monitoring socket, monitoring each port by using the monitoring socket, and acquiring the access request sent by the client through the first IP address when monitoring the access request.
Optionally, the establishing the first connection between the client and the specified shared directory, and providing the access service for the client by using the first connection, includes:
creating a TCP socket of a target version, and connecting the client and the specified shared directory by using the TCP socket; the target version corresponds to the IP protocol version of the first IP address;
and utilizing the TCP socket to provide access service for the client.
Optionally, before the establishing the first connection with the client by using the first IP address of the client, the method further includes:
and adding IPV6 configuration information in the configuration file, and loading a TI-RPC library.
Optionally, after adding the IPV6 configuration information in the configuration file, the method further includes:
setting the IP address of each port by using a port setting function; wherein the IP address comprises an IPV4 address and an IPV6 address;
setting the format of the IPV4 address as ffff a.b.c.d; wherein the a.b.c.d is the original address of the IPV4 address.
Optionally, before the establishing the first connection with the client by using the first IP address of the client, the method further includes:
the dual stack access switch is set and turned on.
Optionally, the method further includes:
when an IP address view request is received, the IP address view request is responded with the IPV4 address and the IPV6 address.
The invention also provides a dual-stack access device of the user mode network file system, which comprises:
the system comprises a first connection module, a second connection module and a third connection module, wherein the first connection module is used for establishing first connection with a client by using a first IP address of the client and providing access service for the client through the first connection by using a specified shared directory; the appointed shared directory is a shared directory with a mounting format corresponding to the IP protocol version of the first IP address;
an obtaining module, configured to determine, when the first connection is disconnected, a second IP address of the client through an identifier field corresponding to the client; wherein the first IP address and the second IP address have different IP protocol versions;
and the second connection module is used for establishing second connection between the specified shared directory and the client by using the second IP address.
The invention also provides a dual-stack access device of the user mode network file system, which comprises a memory and a processor, wherein:
the memory is used for storing a computer program;
the processor is used for executing the computer program to realize the user mode network file system dual-stack access method.
The invention also provides a computer readable storage medium for storing a computer program, wherein the computer program realizes the above-mentioned dual-stack access method for the user-mode network file system when being executed by a processor.
The invention provides a dual-stack access method of a user mode network file system, which comprises the steps of establishing a first connection with a client by utilizing a first IP address of the client, and providing access service for the client through the first connection by utilizing a specified shared directory; the designated shared directory is a shared directory with a mounting format corresponding to the IP protocol version of the first IP address. When the first connection is disconnected, determining a second IP address of the client through an identifier field corresponding to the client; the first IP address and the second IP address have different IP protocol versions; a second connection between the specified shared directory and the client is established using the second IP address.
It can be seen that the method allows a client to connect to a server with a first IP address and a second IP address, and the IP protocol version numbers of the two IP addresses are different. Therefore, the client can firstly establish a first connection with the server by adopting the first IP address and acquire the access service through the first connection. When the first connection established between the server and the client through the first IP address is interrupted, the second IP address of the client can be determined by using the identifier field, and the network connection between the server and the client is reestablished by using the second IP address, so that the problem that the existing user-mode network file system is difficult to recover after network connection failure exists is solved.
In addition, the invention also provides a dual-stack access device of the user mode network file system, dual-stack access equipment of the user mode network file system and a computer readable storage medium, and the dual-stack access device, the dual-stack access equipment and the computer readable storage medium also have the beneficial effects.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a dual-stack access method for a user-mode network file system according to an embodiment of the present invention;
fig. 2 is a flowchart of a dual stack setting method for a user-mode network file system according to an embodiment of the present invention;
fig. 3 is a flowchart of access service acquisition according to an embodiment of the present invention;
FIG. 4 is a block diagram illustrating a method for recovering a file lock failure according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a dual-stack access device of a user-mode network file system according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a dual-stack access device of a user-mode network file system according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, 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. 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.
Referring to fig. 1, fig. 1 is a flowchart of a dual stack access method for a user mode network file system according to an embodiment of the present invention. The method comprises the following steps:
s101: and establishing a first connection with the client by using the first IP address of the client, and providing access service for the client through the first connection by using the specified shared directory.
In the user mode network file system, the server provides access service for the client, so the method can be executed by the server, in the embodiment of the invention, the client and the server are both Linux system platforms, and specifically, the system type of the client and the server can be CentOS Linux release 7.2.1511. It should be noted that the client in the embodiment of the present invention is a client mounted with a dual stack access service, and the server in the embodiment of the present invention is a server mounted with a dual stack access service. The dual stack access is access supporting two protocols of IPV4 and IPV6, so that the client in the embodiment of the present invention may connect with the server by using an IPV4 address or an IPV6 address and obtain access service, and the server in the embodiment of the present invention may establish connection with the client by using an IPV4 address or an IPV6 address and provide access service for the client.
The server establishes a first connection with the client by using the first IP address of the client, and the specific connection method and process are not limited in this embodiment, for example, a connection port of the client may be monitored, and when a connection request sent by the client through a port to which the first IP address is bound is monitored, the connection is established with the client by using the first IP address of the client; or a connection request which is sent by the client and specifies the first IP address can be received, and after the connection request is received, the connection is established with the client by using the first IP address in the connection request. The first IP address may be an IPV4 address or an IPV6 address, and the specific content of the first IP address is not limited in this embodiment, for example, when the first IP address is an IPV4 address, the first IP address may be 100.7.44.1; or when the first IP address is an IPV6 address, the first IP address may be fe80::20c:29ff:: fe26:5f 62.
After the server establishes a first connection with the client using the first IP address, the server may provide access services to the client through the first connection using the specified shared directory. It should be noted that, the designated shared directory is a shared directory whose mount format corresponds to the IP protocol version of the first IP address, and when the first IP address is an IPV4 address, the designated shared directory is a shared directory mounted in an IPV4 format; when the first IP address is the IPV6 address, the designated shared directory is the shared directory mounted in the IPV6 format. One or more devices are hung in the appointed sharing directory, and the devices are used for storing files and providing services for the client. By connecting the specified shared directory to the client via the first connection, the specified shared directory can be used to provide access services to the client via the first connection. The types of the access services may be various, and the client may obtain the corresponding access service according to the self-requirement and an instruction sent by the user to the client, which is not limited in this embodiment.
S102: and when the first connection is disconnected, determining a second IP address of the client through the corresponding identifier field of the client.
In the embodiment of the present invention, the reason causing the disconnection of the first connection is not limited, and any situation or the disconnection of the first connection caused by a failure may perform this step, for example, when the server switches from the dual stack mode to the single stack mode due to a failure or other reasons, for example, when the first connection is the IPV4 connection, and the server switches from the dual stack mode to the IPV6 single stack mode; or when the client switches from the dual stack mode to the single stack mode due to a failure or other reasons, for example, when the first connection is the IPV6 connection, the client switches from the dual stack mode to the IPV4 single stack mode; or may be a first connection disconnection caused by a network failure.
It should be noted that the IP protocol version of the first IP address is different from that of the second IP address. When the first connection is disconnected, the second IP address of the client may be determined by the corresponding identifier field of the client. The identifier field is stored locally at the server for managing and identifying the individual clients and their network addresses. The identifier field may include a client id and corresponding first and second IP addresses, or may include only first and second IP addresses corresponding to each other. Because there are multiple protocol versions of the user-mode network file system, the identifier field may be different in different versions, for example, in the NFSv3 version protocol, a caller _ name field may be used as the identifier field, and each client stores its own first IP address and second IP address in the caller _ name field, so as to reconnect with the client when a connection failure occurs; or in the NFSv4 version protocol, a clientid field may be used as an identifier field, and each client and its corresponding first IP address and second IP address may be marked by the clientid field, so as to reconnect with the client when a connection failure occurs.
The construction process of the identifier field can be selected and adjusted according to actual conditions, for example, after the clients in the user mode network file system are all mounted with the dual-stack protocol, the first IP address and the second IP address of each client are counted and input into the server, and the identifier field is constructed; or after the dual stack protocol is mounted on both the server and the client in the user mode network file system, the first IP address and the second IP address corresponding to each client are counted by acquiring the IP address used when each client sends the NFS request. Preferably, in this embodiment, in order to complete the identifier field as soon as possible, when a first NFS request sent by the client is received, the client sequence id of the client is obtained, the identifier id in the identifier field is generated by using the client sequence id, and the identifier field corresponding to the client is formed by using the identifier id, the first IP address and the second IP address. The first NFS request may be any request, for example, an identification request, i.e., a request for matching identifier fields. The method for acquiring the client id of the client by the server is not limited in this embodiment, the client id may be a sequencing id of the client in the whole distributed network file system, or may also be MAC address information of the client, and the generation method of the identifier id may be various.
S103: a second connection between the specified shared directory and the client is established using the second IP address.
When the identifier field is used to determine the second IP address corresponding to the client, the connection may be reestablished with the client by using the second IP address, that is, the second connection between the specified shared directory and the client is established by using the second IP address, and after the second connection is established, the server may continue to provide the access service for the client by using the second connection, or may perform other operations, which is not limited in this embodiment.
It should be noted that, the method for establishing the second connection between the specified shared directory and the client by using the second IP address is not limited, for example, the server may send a connection request to the second IP address, and when the client receives the connection request, the server establishes the second connection with the server by using the second IP address, and the server may connect the specified shared directory and the client by using the second connection; or a connection request sent by the client by using the second IP address can be waited, and when the IP address of the connection request is detected to be the second IP address, a second connection between the specified shared directory and the client is established.
By applying the dual-stack access method for the user mode network file system provided by the embodiment of the invention, the client is allowed to be connected with the server by utilizing the first IP address and the second IP address, and the IP protocol version numbers of the two IP addresses are different. Therefore, the client can firstly establish a first connection with the server by adopting the first IP address and acquire the access service through the first connection. When the first connection established between the server and the client through the first IP address is interrupted, the second IP address of the client can be determined by using the identifier field, and the network connection between the server and the client is reestablished by using the second IP address.
Based on the foregoing embodiment of the present invention, because both the server and the client in the embodiment of the present invention are devices supporting dual stack access service, a specific dual stack setting method will be described in the embodiment of the present invention, so that the client and the server can implement dual stack access service, specifically please refer to fig. 2, where fig. 2 is a flowchart of a dual stack setting method for a user-mode network file system provided in the embodiment of the present invention, including:
s201: IPV6 information is added to the configuration file and the TI-RPC library is loaded.
Because most of clients in the existing user mode network file system acquire services by using an IPV4 address and most of servers provide services by using an IPV4 address, IPV6 configuration information needs to be added to a configuration file of a server to enable the server to support an IPV6 protocol. Of course, the IPV6 configuration information also needs to be added to the client's configuration file to enable the client to support the IPV6 protocol. Specifically, in the configuration environment:
vim/etc/sysctl.conf
#net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.all.disable_ipv6=0
net.ipv6.conf.default.disable_ipv6=0
net.ipv6.conf.lo.disable_ipv6=0
wherein,/etc/sysctl.conf is the configuration file. After entering the above, the sysctl-p instruction needs to be executed in order to enable the IPV6 protocol. Since the server portmap daemon is not compatible with IPV6, the TI-RPC library needs to be loaded in order to enable the rpcbind service.
S202: and setting the IP address of each port by using a port setting function.
The port setting function is used for setting an IP address corresponding to a port, and since both the server and the client support dual stack access services, IPV6 addresses need to be bound to part of ports on the server and each client, and IPV4 addresses need to be bound to the other ports. Specifically, the IPV4 address and the port may be bound by a Bind _ sockets _ V4 function, and the IPV6 address and the port may be bound by a Bind _ sockets _ V6 function.
S203: the format of the IPV4 address is set to ffff a.b.c.d.
In order to prevent the server and the client from failing in the dual stack mode, the format of the IPV4 address of the server is set, the IPV4 address is set to 128 bits, the first 80 is set to 0, the middle 16 bits are set to ffff, the last 32 is a.b.c.d, and the a.b.c.d is the original address of the IPV4 address. For example, when the original address of the IPV4 address is 100.7.44.1, the IPV4 address after setting is ffff 100.7.44.1. Accordingly, the IPV4 address format of each client also needs to be set.
S204: the dual stack access switch is set and turned on.
In order to make the server support the dual-stack access, a dual-stack access switch is also needed. Specifically, the dual stack access switch can be successfully set by adding an IPV6 switch field in the target configuration file, for example, a v6 disable/true field is added in the target configuration file/etc/ganesha. conf, and when the v6disable is false, it indicates that the dual stack access switch is turned on. Correspondingly, a dual-stack access switch needs to be set and opened for each client. After the configuration is finished, the IP address view request may be responded with the IPV4 address and the IPV6 address when the IP address view request is received.
Based on the foregoing embodiment of the present invention, a process of a client acquiring an access service from a server through a first connection will be specifically described in the embodiment of the present invention, please refer to fig. 3, where fig. 3 is a flow chart for acquiring an access service provided in the embodiment of the present invention, and specifically includes:
s301: and acquiring an access request sent by the client through the first IP address, and determining equipment specified by the access request in a specified shared directory.
The method for obtaining the access request is not limited in this embodiment, for example, the operation of obtaining the access request sent by the client through the first IP address may be executed in real time, and the operation is repeatedly executed when the access request is not obtained. Preferably, a listening socket may be established, each port is listened by using the listening socket, and the access request sent by the client through the first IP address is acquired when the access request is listened. The ports comprise a port bound with an IPV4 address and a port bound with an IPV6 address, and the IP address protocol version bound with the port for monitoring the access request is the same as the IP protocol version of the first IP address.
After the access request is obtained, determining an appointed shared directory, wherein the appointed shared directory is a shared directory with a mounting format corresponding to the IP protocol version of the first IP address, one or more devices are mounted in the appointed shared directory, and the device appointed by the access request is determined in the appointed shared directory.
Further, in one possible implementation, the device specified by the access request does not exist in the specified shared directory. Therefore, before determining the device specified by the access request, it can be determined whether the device specified by the access request exists in the implementation shared directory. If so, determining the equipment specified by the access request; if the IP address does not exist in the shared directory, mounting equipment specified by the access request into a specified shared directory according to a target mounting format, wherein the target mounting format corresponds to the IP protocol version of the first IP address, namely when the first IP address is an IPV4 address, the target mounting format is an IPV4 format; when the first IP address is IPV6 version, the target mount format is IPV6 version.
S302: and establishing a first connection between the client and the specified shared directory, and providing access service for the client by using the first connection.
In particular, a target version of a TCP socket may be created, with which to connect the client and the specified shared directory, i.e. with which to act as the first connection. Wherein the target version corresponds to the IP protocol version of the first IP address, i.e. when the first IP address is an IPV4 address, the target version should be a TCP4 version; when the first IP address is an IPV6 address, the target version should be TCP6 version. After the TCP socket is created, the access service is provided for the client by using the TCP socket.
Based on the foregoing embodiment of the present invention, in a possible situation, when a client accesses a certain file through a server, a file lock failure occurs, an embodiment of the present invention will describe a method for recovering a file lock failure, and specifically refer to fig. 4, where fig. 4 is a method for recovering a file lock failure according to an embodiment of the present invention, and includes:
s401: when fault information of the NFS file lock of the target file is received, analyzing the fault information, and determining the type of the fault of the NFS file lock.
The target file is a file accessed by the client, the client can be opened in a read mode or a write mode when accessing the file, no matter the client accesses the target file in any mode, when the NFS file lock of the target file fails, the server receives failure information of the NFS file lock of the target file, and the failure information may be notification information of notify. When fault information of the NFS file lock of the target file is received, analyzing the fault information, and determining the type of the NFS file lock fault of the target file. The present embodiment does not limit the specific determination method, and reference may be made to related technologies, which are not described herein again.
S402: and when the NFS file lock fault is the first type fault, sending notification information to the client.
It should be noted that the first type of failure is a failure caused by a server operation error, that is, a server operation error causes a failure of an NFS file lock of a target file. At this time, notification information needs to be sent to the client, so that the client re-applies for the authorized lock of the target file, i.e. the NFS file lock of the target file. Specifically, when the client re-applies for the authorized lock, the identifier field is required to determine the identity of the application client, and when the application client is a client that has previously accessed the target file, the application client is allowed to continue accessing the file.
S403: and when the NFS file lock fault is the second type fault, releasing the NFS file lock.
It should be noted that the second type of failure is a failure caused by a connection terminal with the client, that is, a failure of an NFS file lock caused by disconnection between the server and the client. At this point, the authorized locks, i.e., the NFS file locks of the target file, may be released. After the NFS file lock is released, other operations may also be performed, and the specific content is not limited in this embodiment.
By applying the dual-stack access method for the user mode network file system provided by the embodiment of the invention, the fault type can be determined when the NFS file lock fails, and the fault can be recovered by adopting a corresponding means, so that the problems of file opening conflict and the like caused by the failure of the NFS file lock in the user mode network file system are avoided.
The following introduces a dual-stack access device of a user mode network file system provided in an embodiment of the present invention, and the dual-stack access device of the user mode network file system described below and the dual-stack access method of the user mode network file system described above may be referred to in correspondence with each other.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a dual-stack access device of a user-mode network file system according to an embodiment of the present invention, including:
a first connection module 510, configured to establish a first connection with the client by using a first IP address of the client, and provide access service for the client through the first connection by using the specified shared directory; the designated shared directory is a shared directory with a mounting format corresponding to the IP protocol version of the first IP address;
an obtaining module 520, configured to determine, when the first connection is disconnected, a second IP address of the client according to an identifier field corresponding to the client; the first IP address and the second IP address have different IP protocol versions;
a second connection module 530, configured to establish a second connection between the specified shared directory and the client using the second IP address.
Optionally, the method further includes:
the fault type determining module is used for analyzing fault information and determining the type of the fault of the NFS file lock when the fault information of the NFS file lock of the target file is received; the target file is a file accessed by the client;
the first recovery module is used for sending notification information to the client when the NFS file lock fault is a first-class fault; the first type of fault is a fault caused by a server operation error;
the second recovery module is used for releasing the NFS file lock when the NFS file lock fault is a second type of fault; wherein the second type of failure is a failure caused by connection interruption with the client.
Optionally, the method further includes:
the sequence ID acquisition module is used for acquiring the client sequence ID of the client when receiving a first NFS request sent by the client;
and the identifier field generating module is used for generating an identifier ID in the identifier field by using the client sequence ID and forming the identifier field by using the identifier ID, the first IP address and the second IP address.
Optionally, the first connection module 510 includes:
the determining unit is used for acquiring an access request sent by a client through a first IP address and determining equipment appointed by the access request in an appointed shared directory;
and the service unit is used for establishing a first connection between the client and the specified shared directory and providing access service for the client by using the first connection.
Optionally, the determining unit includes:
a judging subunit, configured to judge whether a device exists in the designated shared directory;
the mounting subunit is used for mounting the equipment into the specified shared directory according to the target mounting format if the equipment does not exist in the specified shared directory; wherein the target mount format corresponds to an IP protocol version of the first IP address;
and the determining subunit is used for determining the equipment specified by the access request if the equipment exists in the specified shared directory.
Optionally, the determining unit includes:
and the monitoring subunit is used for establishing a monitoring socket, monitoring each port by using the monitoring socket, and acquiring the access request sent by the client through the first IP address when the access request is monitored.
Optionally, the service unit includes:
a socket creating subunit, configured to create a TCP socket of a target version, and connect the client and the designated shared directory by using the TCP socket; the target version corresponds to an IP protocol version of the first IP address;
and the service subunit is used for providing access service for the client by utilizing the TCP socket.
Optionally, the method further includes:
and the configuration module is used for adding IPV6 configuration information in the configuration file and loading the TI-RPC library.
Optionally, the method further includes:
the address setting module is used for setting the IP address of each port by using a port setting function; wherein, the IP address comprises an IPV4 address and an IPV6 address;
the format modification module is used for setting the format of the IPV4 address as ffff a.b.c.d; wherein, a.b.c.d is the original address of the IPV4 address.
Optionally, the method further includes:
and the double-stack switch setting module is used for setting and starting the double-stack access switch.
Optionally, the method further includes:
and the request response module is used for responding to the IP address viewing request by utilizing the IPV4 address and the IPV6 address when the IP address viewing request is received.
The following introduces a dual-stack access device of a user mode network file system provided in an embodiment of the present invention, and the dual-stack access device of the user mode network file system described below and the dual-stack access method of the user mode network file system described above may be referred to in a corresponding manner.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a user-mode dual-stack access device for a network file system according to an embodiment of the present invention, where the user-mode dual-stack access device for a network file system includes a memory and a processor, where:
a memory 610 for storing a computer program;
and a processor 620 for executing a computer program to implement the user-mode network file system dual-stack access method.
The following introduces a computer-readable storage medium provided in an embodiment of the present invention, and the computer-readable storage medium described below and the user-mode network file system dual-stack access method described above may be referred to correspondingly.
The invention also provides a computer readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the above-mentioned dual stack access method for a user-mode network file system.
The computer-readable storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it should also be noted that, herein, relationships such as first and second, etc., are intended only 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.
The present invention provides a user mode network file system dual stack access method, a user mode network file system dual stack access device and a computer readable storage medium, which are introduced in detail above, wherein a specific example is applied in the present document to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (13)

1. A dual-stack access method for a user mode network file system is characterized by comprising the following steps:
establishing a first connection with a client by using a first IP address of the client, and providing access service for the client through the first connection by using a specified shared directory; the appointed shared directory is a shared directory with a mounting format corresponding to the IP protocol version of the first IP address;
when the first connection is disconnected, determining a second IP address of the client through an identifier field corresponding to the client; wherein the first IP address and the second IP address have different IP protocol versions;
establishing a second connection between the designated shared directory and the client using the second IP address;
when fault information of an NFS file lock of a target file is received, analyzing the fault information, and determining the type of the fault of the NFS file lock; wherein the target file is a file accessed by the client;
when the NFS file lock fault is a first type fault, sending notification information to the client; wherein, the first type of fault is a fault caused by a server operation error;
when the NFS file lock fault is a second type fault, releasing the NFS file lock; and the second type of fault is a fault caused by connection interruption between the client and the second type of fault.
2. The dual stack access method for a user-mode network file system according to claim 1, further comprising, before said establishing a first connection with a client using a first IP address of the client:
when a first NFS request sent by the client is received, acquiring a client sequence ID of the client;
generating an identifier ID in the identifier field using the client sequence ID, and composing the identifier field using the identifier ID, the first IP address, and the second IP address.
3. The dual stack access method for a user-mode network file system according to claim 1, wherein the establishing a first connection with the client using a first IP address of the client and providing access services to the client through the first connection using a specified shared directory comprises:
acquiring an access request sent by the client through the first IP address, and determining equipment appointed by the access request in the appointed shared directory;
and establishing the first connection between the client and the specified shared directory, and providing the access service for the client by using the first connection.
4. The dual stack access method for a user-mode network file system according to claim 3, wherein said determining the device specified by the access request in the specified shared directory comprises:
judging whether the equipment exists in the specified shared directory or not;
if not, mounting the equipment into the specified shared directory according to a target mounting format; wherein the target mount format corresponds to the IP protocol version of the first IP address;
if yes, determining the equipment specified by the access request.
5. The dual-stack access method for the user-mode network file system according to claim 4, wherein the obtaining the access request sent by the client through the first IP address includes:
and establishing a monitoring socket, monitoring each port by using the monitoring socket, and acquiring the access request sent by the client through the first IP address when monitoring the access request.
6. The user-mode network file system dual-stack access method of claim 5, wherein the establishing the first connection between the client and the specified shared directory, and the providing the access service for the client using the first connection, comprises:
creating a TCP socket of a target version, and connecting the client and the specified shared directory by using the TCP socket; the target version corresponds to the IP protocol version of the first IP address;
and utilizing the TCP socket to provide access service for the client.
7. The dual stack access method for a user-mode network file system according to claim 1, further comprising, before said establishing a first connection with a client using a first IP address of the client:
and adding IPV6 configuration information in the configuration file, and loading a TI-RPC library.
8. The dual stack access method for a user-mode network file system according to claim 7, after adding IPV6 configuration information in the configuration file, further comprising:
setting the IP address of each port by using a port setting function; wherein the IP address comprises an IPV4 address and an IPV6 address;
setting the format of the IPV4 address as ffff a.b.c.d; wherein the a.b.c.d is the original address of the IPV4 address.
9. The user-mode network file system dual-stack access method of claim 8, further comprising, before the establishing a first connection with the client using the first IP address of the client:
the dual stack access switch is set and turned on.
10. The dual stack access method for a user-mode network file system of claim 9, further comprising:
when an IP address view request is received, the IP address view request is responded with the IPV4 address and the IPV6 address.
11. A dual stack access device for a user-mode network file system, comprising:
the system comprises a first connection module, a second connection module and a third connection module, wherein the first connection module is used for establishing first connection with a client by using a first IP address of the client and providing access service for the client through the first connection by using a specified shared directory; the appointed shared directory is a shared directory with a mounting format corresponding to the IP protocol version of the first IP address;
an obtaining module, configured to determine, when the first connection is disconnected, a second IP address of the client through an identifier field corresponding to the client; wherein the first IP address and the second IP address have different IP protocol versions;
a second connection module, configured to establish a second connection between the specified shared directory and the client using the second IP address;
the fault type determining module is used for analyzing fault information and determining the type of the fault of the NFS file lock when the fault information of the NFS file lock of the target file is received; the target file is a file accessed by the client;
the first recovery module is used for sending notification information to the client when the NFS file lock fault is a first-class fault; the first type of fault is a fault caused by a server operation error;
the second recovery module is used for releasing the NFS file lock when the NFS file lock fault is a second type of fault; wherein the second type of failure is a failure caused by connection interruption with the client.
12. A user-mode network file system dual-stack access device, comprising a memory and a processor, wherein:
the memory is used for storing a computer program;
the processor, configured to execute the computer program to implement the dual stack access method of the user-mode network file system according to any one of claims 1 to 10.
13. A computer-readable storage medium for storing a computer program, wherein the computer program when executed by a processor implements the user-mode network file system dual stack access method of any of claims 1 to 10.
CN201911083371.XA 2019-11-07 2019-11-07 User mode network file system dual-stack access method, device and equipment Active CN111225020B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201911083371.XA CN111225020B (en) 2019-11-07 2019-11-07 User mode network file system dual-stack access method, device and equipment
PCT/CN2020/073116 WO2021088254A1 (en) 2019-11-07 2020-01-20 Dual-stack access method, apparatus and device for user-mode network file system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911083371.XA CN111225020B (en) 2019-11-07 2019-11-07 User mode network file system dual-stack access method, device and equipment

Publications (2)

Publication Number Publication Date
CN111225020A CN111225020A (en) 2020-06-02
CN111225020B true CN111225020B (en) 2021-06-29

Family

ID=70827606

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911083371.XA Active CN111225020B (en) 2019-11-07 2019-11-07 User mode network file system dual-stack access method, device and equipment

Country Status (2)

Country Link
CN (1) CN111225020B (en)
WO (1) WO2021088254A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114885042A (en) * 2021-01-21 2022-08-09 北京金山云网络技术有限公司 Network data transmission method, client, server and system
CN113098972B (en) * 2021-04-12 2023-01-31 京东科技信息技术有限公司 Method and device for connecting with equipment, electronic equipment and storage medium
CN113612811B (en) * 2021-06-20 2023-04-07 济南浪潮数据技术有限公司 Method, system, equipment and medium for client mounting in multiple channels
CN113505111B (en) * 2021-06-22 2024-03-12 新华三大数据技术有限公司 Shared directory mounting method and distributed network additional storage system
CN113709100B (en) * 2021-07-16 2022-12-27 苏州浪潮智能科技有限公司 Shared file access control method, device, equipment and readable storage medium
CN113672451B (en) * 2021-07-21 2023-12-22 济南浪潮数据技术有限公司 BMC service detection method, device, equipment and readable storage medium
CN116450058B (en) * 2023-06-19 2023-09-19 浪潮电子信息产业股份有限公司 Data transfer method, device, heterogeneous platform, equipment and medium
CN117033330B (en) * 2023-10-08 2023-12-08 南京翼辉信息技术有限公司 Multi-core file sharing system and control method thereof

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105790985A (en) * 2014-12-23 2016-07-20 中兴通讯股份有限公司 Data switching method, first device, second device and device
CN106777394A (en) * 2017-02-28 2017-05-31 郑州云海信息技术有限公司 A kind of cluster file system
CN108833190A (en) * 2018-07-27 2018-11-16 郑州云海信息技术有限公司 A kind of NFS service fault alarm method, device and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101692674B (en) * 2009-10-30 2012-10-17 杭州华三通信技术有限公司 Method and equipment for double stack access
CN101789981B (en) * 2010-03-18 2014-03-19 杭州华三通信技术有限公司 Method and equipment for dual-stack data transmission
CN103685281B (en) * 2013-12-18 2017-08-15 中国联合网络通信集团有限公司 The switching method and equipment of a kind of network address agreement
US9632892B1 (en) * 2015-03-30 2017-04-25 EMC IP Holding Company LLC NFS cluster failover
CN109040207B (en) * 2018-07-20 2021-06-29 广东浪潮大数据研究有限公司 Method, device and equipment for accessing user mode network file system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105790985A (en) * 2014-12-23 2016-07-20 中兴通讯股份有限公司 Data switching method, first device, second device and device
CN106777394A (en) * 2017-02-28 2017-05-31 郑州云海信息技术有限公司 A kind of cluster file system
CN108833190A (en) * 2018-07-27 2018-11-16 郑州云海信息技术有限公司 A kind of NFS service fault alarm method, device and storage medium

Also Published As

Publication number Publication date
CN111225020A (en) 2020-06-02
WO2021088254A1 (en) 2021-05-14

Similar Documents

Publication Publication Date Title
CN111225020B (en) User mode network file system dual-stack access method, device and equipment
US11922177B2 (en) Securely and reliably transferring startup script
US9501345B1 (en) Method and system for creating enriched log data
US20160366233A1 (en) Private Cloud as a service
CN113746887A (en) Cross-cluster data request processing method, device and storage medium
CN106790758B (en) Method and device for accessing network object in NAT network
EP1434144A2 (en) Peer-to-peer graphing interfaces and methods
US7356531B1 (en) Network file system record lock recovery in a highly available environment
EP1643408A2 (en) Isolating software deployment over a network from external malicious intrusion
US20070124435A1 (en) Database server discovery using a configuration file
US20160323138A1 (en) Scalable Event-Based Notifications
CN112422681B (en) Cross-platform distributed communication calling method and device
CN111045834A (en) Method, device and storage medium for accessing USB storage device under cloud desktop
CN113347037B (en) Data center access method and device
US20080222292A1 (en) Method for Allowing Multiple Authorized Applicants to Share the Same Port
US8489727B2 (en) Active storage area network discovery system and method
CN115150419A (en) Configuration and access method and system for hybrid cloud object storage
CN109150844B (en) Method, device and system for determining digital certificate
CN113038594A (en) Network management registration method and device for MESH extended equipment
CN111327680B (en) Authentication data synchronization method, device, system, computer equipment and storage medium
EP2180401A1 (en) A method at a gateway for selecting and managing a default disk
CN112751716B (en) Test method and system for controlling response of file server and electronic equipment
CN112367415B (en) Generation method and device of attribute information, electronic equipment and computer readable medium
CN112822305B (en) Method, device, router and storage medium for processing DNS query request
EP3989509A1 (en) Method for realizing network dynamics, system, terminal device and storage medium

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