Background
In a TCP/IP network, a client may download or load files on a File server through a File Transfer Protocol (FTP) to implement resource sharing, and a user may connect his PC to all servers running the FTP Protocol around the world through the client to access a large amount of programs and information on the servers. FTP Server has become an important resource on the internet.
The traditional FTP Server scheme utilizes a single Server to provide services for the FTP client, and meanwhile, the management of a user and the authority configuration of a user sharing directory are also arranged on the single Server, so that the FTP Server cannot provide the services once the machine is abnormal.
Therefore, the existing technical scheme of providing the file access service for the FTP client by using a single FTP Server does not have the disaster recovery function.
Disclosure of Invention
In view of this, the main objective of the present invention is to provide an access method for a cloud storage network file system, which can enable a file access service provided by an FTP Server device to have a disaster recovery function.
In order to achieve the purpose, the technical scheme provided by the invention is as follows:
an access method of a cloud storage network file system comprises the following steps:
the FTP master control server stores the user information of the system and the access authority configuration information of the shared file in a database in advance; the user information includes: the method comprises the following steps that an FTP user name, a file access user identifier uid, an access password, a user group identifier gid to which a user belongs and a shared file root directory accessible by an FTP client side are obtained;
when an FTP client needs to access the network file system, triggering the FTP master control server to distribute FTP server nodes providing file access service for the FTP master control server;
the FTP client logs in the FTP server node, and the FTP server node triggers a process of carrying out user identity authentication on the FTP client according to the prestored user information; when the verification is successful, returning a shared file root directory which can be accessed by the FTP client to the FTP client;
and when the FTP client enters the shared file root directory and submits a file access request, the FTP server node triggers a processing process of executing or refusing to execute the requested file access operation according to the user information and the access authority configuration information.
In summary, the access method for the cloud storage network file system provided by the invention provides the file access service for the FTP client by using the FTP main control Server and the FTP Server node, so that the file access service provided by the FTP Server has the disaster recovery function.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
The core idea of the invention is as follows: the FTP Server cluster technology is introduced to provide the FTP client with the network file access management service, so that the file access service provided by the FTP Server has the disaster tolerance function.
Fig. 1 is a schematic flow diagram of a method according to an embodiment of the present invention, and as shown in fig. 1, an access method of a cloud storage network file system implemented by the embodiment mainly includes:
step 101, the FTP master control server stores user information of a system and access authority configuration information of a shared file in a database in advance; the user information includes: the file management system comprises an FTP user name, a file access user identifier uid, an access password, a user group identifier gid of a user and a shared file root directory accessible by an FTP client.
In this step, the FTP master server needs to store the user information of the cloud storage network file system and the access authority configuration information of the shared file in the database in advance, so that the FTP master server can perform unified management on the users of the cloud storage network file system and unified setting on the access authority according to the information.
In this case, the user information and the access authority configuration information of the shared file are stored in the database in a unified manner, rather than in the FTP server nodes that specifically provide the file access service, so that when a certain FTP server node fails, the file access service can still be provided by other available FTP server nodes, and thus the file access service with the disaster tolerance function can be provided for the FTP client.
And 102, when the FTP client needs to access the network file system, triggering the FTP master control server to distribute FTP server nodes for providing file access service.
In this step, when the FTP client needs to access the network file system, the FTP master server is triggered to select one FTP server node from the available FTP server nodes and allocate the selected FTP server node to the FTP client, so as to provide a file access service for the FTP client.
Preferably, the following method may be adopted to trigger the FTP master server to allocate the FTP server node thereto:
the FTP client is connected with the FTP master control server through a domain name of a cloud storage network file system, the FTP master control server selects an FTP server node providing service for the FTP client from currently available FTP server nodes according to a preset load balancing strategy, and the IP address of the selected FTP server node is notified to the FTP client.
It should be noted that, in practical application, the IP address of each FTP server node is pre-stored in the database by the FTP master server, and in the process of allocating the FTP server nodes, the FTP master server may take out the selected IP address of the FTP server node from the database and notify the selected IP address of the FTP server node to the FTP client.
In the distribution method, the load balance of each FTP server node can be ensured by selecting the FTP server node by adopting a load balance strategy. Specifically, the load balancing policy may be set by a person skilled in the art according to actual needs, for example, for convenience of implementation, the load balancing policy may be: and selecting the FTP server node with the minimum current load.
103, the FTP client logs in the FTP server node, and the FTP server node triggers a process of carrying out user identity authentication on the FTP client according to the pre-stored user information; and when the verification is successful, returning a shared file root directory which can be accessed by the FTP client in the cloud storage network file system to the FTP client.
In this step, when the FTP server node logs in at the FTP client, the user information of the system is obtained through the FTP master server, and then the user identity of the FTP client is verified accordingly, and only after the user identity passes the verification, the FTP client can be allowed to enter the accessible shared file root directory. In this way, the FTP client can further perform file access operations within the scope of its accessible rights.
Preferably, the FTP server node may be logged in by:
and the FTP client is connected with the FTP server node, and after the connection is successful, the FTP client submits login information input by a user to the FTP server node, wherein the login information comprises an FTP user name and an access password.
Preferably, the triggering of the process of performing user identity authentication on the FTP client according to the pre-stored user information may be implemented by the following steps:
and the FTP server node acquires the user information corresponding to the FTP user name from the FTP master control server, and judges whether the login information is matched with the acquired user information or not, if so, the verification is successful, otherwise, the verification fails.
In the method, the FTP server node verifies the user identity, in practical application, the FTP server node can also send the login information of the user to the FTP main control server, and the FTP main control server verifies the identity according to the pre-stored user information, which is not described herein again.
And step 104, when the FTP client enters the shared file root directory and submits a file access request, the FTP server node triggers a processing process of executing or refusing to execute the requested file access operation according to the user information and the access authority configuration information.
In this step, when the FTP client enters the shared file root directory and submits a file access request, the FTP server node will trigger to determine whether to allow execution of the requested file access operation according to the user information and access permission configuration information of the file system pre-stored by the FTP master server. Therefore, the file access control to the user in the preset access authority range can be realized.
Preferably, the triggering is implemented by executing or refusing to execute the requested file access operation according to the user information and the access right configuration information, and the triggering may be implemented by the following method:
the FTP server node generates a corresponding file access message according to the file access request, wherein the file access message comprises a file access user identifier uid, a user group identifier gid to which the user belongs, an operation instruction and a file name;
the FTP server node sends the file access message to the FTP master control server;
and the FTP master control server judges whether the file access operation indicated by the file access message is legal or not according to the prestored user information and the access authority configuration information of the shared file, if so, the file access operation is triggered to be executed, and if not, the file access operation is refused to be executed.
In the above method, the FTP master server determines whether to allow the requested file access operation, and in practical applications, the FTP server node may also determine whether to allow the requested file access operation according to the user information and the access right configuration information of the shared file obtained from the FTP master server, which is not described herein again.
In practical application, when an FTP server node connected to an FTP client is abnormal, the FTP master server may be retriggered to allocate a new FTP server node for the FTP server, and then the newly allocated FTP server node continues to provide a file access service for the FTP server, specifically, the following method may be adopted to achieve this purpose:
when the FTP client monitors that the FTP server node connected currently is abnormal, the FTP master control server is triggered again to distribute a new FTP server node for the FTP master control server, and the new FTP server node is used for accessing the cloud storage network file system.
Preferably, in order to further improve the disaster tolerance of the file access service, an FTP backup control server may be configured for the FTP master server of the cloud storage network file system, after the FTP master server is enabled, the FTP backup control server keeps data synchronization with the FTP master server, and when the FTP master server fails, the FTP backup control server may be used as the current FTP master server.
Through the embodiment, the FTP Server cluster technology is introduced into the cloud storage network file system, and the FTP Server cluster consisting of the FTP master Server and a plurality of FTP Server nodes is utilized, so that the file access service with the disaster recovery function can be provided for the FTP client.
In summary, the above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. 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.