CN116150121A - Network attached storage replacement method and related device - Google Patents

Network attached storage replacement method and related device Download PDF

Info

Publication number
CN116150121A
CN116150121A CN202211425726.0A CN202211425726A CN116150121A CN 116150121 A CN116150121 A CN 116150121A CN 202211425726 A CN202211425726 A CN 202211425726A CN 116150121 A CN116150121 A CN 116150121A
Authority
CN
China
Prior art keywords
network attached
attached storage
storage nas
checking
nas
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211425726.0A
Other languages
Chinese (zh)
Inventor
吴湘
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
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 China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202211425726.0A priority Critical patent/CN116150121A/en
Publication of CN116150121A publication Critical patent/CN116150121A/en
Pending legal-status Critical Current

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/182Distributed file systems
    • G06F16/1824Distributed file systems implemented using Network-attached Storage [NAS] architecture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database

Abstract

The invention discloses a network attached storage replacement method and a related device, which can be used for sending a preset acquisition script to an old network attached storage to be unloaded so as to acquire information of the old network attached storage through the acquisition script; if the information is successfully acquired, performing a first pre-check on the old network attached storage; performing a second pre-verification check on the new network attached storage to be mounted; and if the old network attached storage passes the first pre-check and the new network attached storage passes the second pre-check, unloading the old network attached storage and mounting the new network attached storage. The invention can automatically identify the replacement scene of the network auxiliary storage, and automatically replace the old network auxiliary storage with the new network auxiliary storage without manual participation, thereby having higher efficiency.

Description

Network attached storage replacement method and related device
Technical Field
The present invention relates to the field of computers, and in particular, to a method and an apparatus for replacing a network attached storage.
Background
In the existing operation and maintenance work, an operation and maintenance scene of changing the NAS of the network attached storage is frequently encountered, for example, the NAS equipment is expired, and a new NAS equipment needs to be changed; or the NAS device may need to be migrated. Such as the operation and maintenance scenes are more and more, and often, the operation and maintenance scenes involve the change of a large number of devices, and in the actual scenes, the related change operation needs to be performed on tens of thousands of devices within a specified time, so that the workload is very high.
The existing common method is to manually execute the command to perform related change operation, and the efficiency is low.
Disclosure of Invention
In view of the foregoing, the present invention provides a network attached storage replacement method and related apparatus that overcomes or at least partially solves the foregoing problems.
In a first aspect, a network attached storage replacement method includes:
issuing a preset acquisition script to an old network attached storage NAS to be unloaded so as to acquire the information of the old network attached storage NAS through the acquisition script;
if the information is successfully acquired, performing a first pre-check on the old network attached storage NAS, wherein the first pre-check comprises checking the state of the old network attached storage NAS and checking a mounting point catalog of the old network attached storage NAS;
performing a second pre-verification check on a new network attached storage NAS to be mounted, wherein the second pre-verification check comprises checking authority setting, user information, genus information, soft link state and production IP state of the new network attached storage NAS;
and if the old network attached storage NAS passes the first pre-check and the new network attached storage NAS passes the second pre-check, unloading the old network attached storage NAS and mounting the new network attached storage NAS.
With reference to the first aspect, in certain optional embodiments, the performing a first pre-check on the old network attached storage NAS includes:
checking whether the state of the old network attached storage NAS is a mounting error state or a non-mounting state through a mount command of an operating system;
checking whether a subdirectory exists under a mounting point of the old network attached storage NAS or not in a file system catalog of the old network attached storage NAS through a cd command of an operating system;
if the state of the old network attached storage NAS is not the mounting error state and is not the un-mounted state, and the mounting point of the old network attached storage NAS does not have a subdirectory, determining that the old network attached storage NAS passes the first pre-check inspection, otherwise, determining that the old network attached storage NAS does not pass the first pre-check inspection.
With reference to the first aspect, in some optional embodiments, the performing a second pre-verification check on the new network attached storage NAS to be mounted includes:
checking whether the authority setting of the file system of the new network attached storage NAS is within a preset authority range;
checking whether the user information of the new network attached storage NAS exists;
checking whether the group information corresponding to the group to which the user of the new network attached storage NAS belongs exists or not;
checking whether said production IP of the new network attached storage NAS responsible for traffic is authorized;
if the authority setting is within the preset authority range, the user information exists, the genus group information exists, and the production IP is authorized, determining that the new network attached storage NAS passes the second pre-verification check, otherwise determining that the new network attached storage NAS fails the second pre-verification check.
With reference to the first aspect, in some optional embodiments, the performing a second pre-verification check on the new network attached storage NAS to be mounted includes:
checking whether the authority setting of the file system of the new network attached storage NAS is within a preset authority range;
checking whether the user information of the new network attached storage NAS exists;
checking whether the group information corresponding to the group to which the user of the new network attached storage NAS belongs exists or not;
checking whether said production IP of the new network attached storage NAS responsible for traffic is authorized;
checking whether the soft link is set on the file attribute of the new network attached storage NAS through an ls-l command;
and if the authority setting is in the preset authority range, the user information exists, the genus group information exists, the soft link is set on the file attribute, and the production IP is authorized, determining that the new network attached storage NAS passes the second pre-verification check, otherwise, determining that the new network attached storage NAS does not pass the second pre-verification check.
With reference to the first aspect, in certain optional embodiments, the unloading the old network attached storage NAS and mounting the new network attached storage NAS includes:
unloading the old network attached storage NAS;
deleting information in a file corresponding to the preset path;
and mounting the new network attached storage NAS, and adding corresponding information in the file corresponding to the preset path.
In a second aspect, a network attached storage replacement device comprises: the system comprises an information acquisition unit, a first checking unit, a second checking unit and a storage unloading unit;
the information acquisition unit is used for issuing a preset acquisition script to an old network attached storage NAS to be unloaded so as to acquire the information of the old network attached storage NAS through the acquisition script;
the first checking unit is configured to perform a first pre-checking check on the old network attached storage NAS if the information is successfully acquired, where the first pre-checking check includes checking a state of the old network attached storage NAS and checking a mount point directory of the old network attached storage NAS;
the second checking unit is configured to perform a second pre-checking check on a new network attached storage NAS to be mounted, where the second pre-checking check includes checking authority setting, user information, genus information, a soft link state, and a production IP state of the new network attached storage NAS;
the storage unloading unit is configured to unload the old network attached storage NAS and mount the new network attached storage NAS if the old network attached storage NAS passes the first pre-verification check and the new network attached storage NAS passes the second pre-verification check.
With reference to the second aspect, in certain optional embodiments, the first inspection unit includes: a status checking subunit, a catalog viewing subunit, and a first determining subunit;
the state checking subunit is configured to check, through a mount command of the operating system, whether the state of the old network attached storage NAS is a mount error state or an unmounted state;
the catalog checking subunit is configured to check, through a cd command of an operating system, whether a subdirectory exists under a mount point of the old network attached storage NAS in a file system catalog of the old network attached storage NAS;
the first determining subunit is configured to determine that the old network attached storage NAS passes the first pre-verification check if the state of the old network attached storage NAS is not the mount error state and is not the mount non-state, and the mount point of the old network attached storage NAS does not have a subdirectory, and otherwise determine that the old network attached storage NAS does not pass the first pre-verification check.
With reference to the second aspect, in certain optional embodiments, the second inspection unit includes: a first authority checking subunit, a first user checking subunit, a first genus group checking subunit, a first authorization checking subunit, and a second determining subunit;
the first authority checking subunit is configured to check whether the authority setting of the file system of the new network attached storage NAS is located within a preset authority range;
the first user checking subunit is configured to check whether the user information of the new network attached storage NAS exists;
the first genus group checking subunit is configured to check whether the genus group information corresponding to the group to which the user of the new network attached storage NAS belongs exists;
the first authorization checking subunit is configured to check whether the production IP of the responsible service of the new network attached storage NAS is authorized;
the second determining subunit is configured to determine that the new network attached storage NAS passes the second pre-verification check if the permission setting is within the preset permission range, the user information exists, the group information exists, and the production IP is authorized, and otherwise determine that the new network attached storage NAS does not pass the second pre-verification check.
In a third aspect, a computer readable storage medium has stored thereon a program which, when executed by a processor, implements the network attached storage replacement method of any of the above.
In a fourth aspect, an electronic device includes at least one processor, at least one memory coupled to the processor, and a bus; the processor and the memory complete communication with each other through the bus; the processor is configured to invoke the program instructions in the memory to perform the network attached storage replacement method of any of the above.
By means of the technical scheme, the network attached storage replacement method and the related device can be used for acquiring information of the old network attached storage NAS through the acquisition script by issuing the preset acquisition script to the old network attached storage NAS to be unloaded; if the information is successfully acquired, performing a first pre-check on the old network attached storage NAS, wherein the first pre-check comprises checking the state of the old network attached storage NAS and checking a mounting point catalog of the old network attached storage NAS; performing a second pre-verification check on a new network attached storage NAS to be mounted, wherein the second pre-verification check comprises checking authority setting, user information, genus information, soft link state and production IP state of the new network attached storage NAS; and if the old network attached storage NAS passes the first pre-check and the new network attached storage NAS passes the second pre-check, unloading the old network attached storage NAS and mounting the new network attached storage NAS. The invention can automatically identify the replacement scene of the network attached storage, and automatically replace the old network attached storage NAS with the new network attached storage NAS without manual participation, thereby having higher efficiency.
The foregoing description is only an overview of the present invention, and is intended to be implemented in accordance with the teachings of the present invention in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present invention more readily apparent.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
FIG. 1 is a flow chart illustrating a network attached storage replacement method provided by the present invention;
FIG. 2 is a schematic diagram of a network attached storage replacement device according to the present invention;
fig. 3 shows a schematic structural diagram of an electronic device provided by the invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
As shown in fig. 1, the present invention provides a network attached storage replacement method, which includes: s100, S200, S300, and S400;
s100, issuing a preset acquisition script to an old network attached storage NAS to be unloaded so as to acquire information of the old network attached storage NAS through the acquisition script;
if the information is successfully acquired, executing S200;
if the information is not acquired, the invention can wait for a period of time to acquire again until the information is acquired for a plurality of times, and can send out a replacement instruction so as to replace the old network attached storage NAS with the new network attached storage NAS.
Alternatively, the old network attached storage NAS may be understood as the network attached storage to be offloaded, and the new network attached storage NAS may be understood as the network attached storage to be mounted. The invention can issue the acquisition script to the old network attached storage NAS for execution, and can acquire the information of the old network attached storage NAS after the acquisition script is executed. It should be noted that: the information of the old network attached storage NAS may include information of NAS volume, mount point, NAS size, NAS usage, NAS type, and NAS parameters, which the present invention is not limited to.
Optionally, after the information of the NAS is collected, the information can be displayed, so that the operation of inquiring by a login system is omitted, and the method is convenient and quick.
S200, performing a first pre-check on the old network attached storage NAS;
wherein the first pre-verification check includes checking a state of the old network attached storage NAS and checking a mount point directory of the old network attached storage NAS;
alternatively, the present invention is not limited to the specific process involved in the first pre-verification check. For example, in connection with the embodiment shown in fig. 1, in some alternative embodiments, the S200 includes: step 1.1, step 1.2, step 1.3 and step 1.4;
step 1.1, checking whether the state of the old network attached storage NAS is a mounting error state or an un-mounting state through a mount command of an operating system;
alternatively, the mount command belongs to a well-known concept in the art, and the present invention will not be described in detail herein, particularly with reference to the related description in the art. It should be noted that: the abnormal state of the old network attached storage NAS can be judged through the mount command, and whether the old network attached storage NAS is not mounted or not and whether the old network attached storage NAS is mounted with errors or not can be judged according to the returned result.
Step 1.2, checking whether a subdirectory exists under a mounting point of the old network attached storage NAS or not in a file system catalog of the old network attached storage NAS through a cd command of an operating system;
if the state of the old network attached storage NAS is not the mounting error state and is not the un-mounted state, and the sub-directory does not exist at the mounting point of the old network attached storage NAS, executing the step 1.3, otherwise executing the step 1.4;
alternatively, the cd command belongs to a well-known concept in the art, and the present invention will not be described in detail herein, particularly with reference to the related description in the art. It should be noted that: through the cd command, it is possible to check whether there are subdirectories under the relevant file system directory of the old network attached storage NAS.
Alternatively, the invention can automatically judge the version of the operating system and select the corresponding command to execute according to the version of the operating system, which is not limited by the invention.
Step 1.3, determining that the old network attached storage NAS passes the first pre-verification check;
step 1.4, determining that the old network attached storage NAS fails the first pre-verification check.
S300, performing second pre-verification check on a new network attached storage NAS to be mounted;
wherein the second pre-verification check includes checking authority settings, user information, genus information, soft link status, and production IP status of the new network attached storage NAS;
if the old network attached storage NAS passes the first pre-check and the new network attached storage NAS passes the second pre-check, then executing S400;
if the old network attached storage NAS fails the first pre-check or the new network attached storage NAS fails the second pre-check, it indicates that the condition of replacing the network attached storage is not provided at this time, and the corresponding investigation can be performed.
Optionally, there is no necessary sequence of execution between S200 and S300, S200 may be executed first, S300 may be executed first, and S200 and S300 may be executed in parallel.
Alternatively, the present invention is not limited to the specific process involved in the second pre-verification check. For example, in connection with the embodiment shown in fig. 1, in some alternative embodiments, the S300 includes: step 2.1, step 2.2, step 2.3, step 2.4, step 2.5 and step 2.6;
step 2.1, checking whether the authority setting of the file system of the new network attached storage NAS is within a preset authority range;
alternatively, the present invention may check the operating rights settings of the NAS file system, for example, if the correct range is 000 to 777, then see if the set rights are within the above range, and if not, then may report an error hint. It should be noted that: the correct range is generally set in advance, so it can be understood as a preset authority range.
Step 2.2, checking whether the user information of the new network attached storage NAS exists or not;
optionally, the invention can check whether the related file of the new network attached storage NAS has the affiliated user, namely whether the related file has corresponding user information.
Step 2.3, checking whether the group information corresponding to the group to which the user of the new network attached storage NAS belongs exists or not;
optionally, the group refers to a group where the file owner (i.e., user) is located, which the present invention is not limited to.
Step 2.4, checking whether the production IP of the new network attached storage NAS responsible for traffic is authorized.
Optionally, the production IP refers to an IP address responsible for traffic, which is responsible for forwarding traffic data, and the network access address of the new network attached storage NAS is configured with the relevant access rights through this IP address.
If the authority setting is within the preset authority range, the user information exists, the genus group information exists, and the production IP is authorized, executing step 2.5, otherwise executing step 2.6;
step 2.5, determining that the new network attached storage NAS passes the second pre-verification check;
step 2.6, determining that the new network attached storage NAS fails the second pre-verification check.
For another example, in connection with the embodiment shown in fig. 1, in some alternative embodiments, the S300 includes: step 3.1, step 3.2, step 3.3, step 3.4, step 3.5, step 3.6 and step 3.7;
step 3.1, checking whether the authority setting of the file system of the new network attached storage NAS is within a preset authority range;
optionally, for the explanation of step 3.1, please refer to step 2.1, which is not described in detail in the present invention.
Step 3.2, checking whether the user information of the new network attached storage NAS exists or not;
optionally, for the explanation of step 3.2, please refer to step 2.2, which is not described in detail in the present invention.
Step 3.3, checking whether the group information corresponding to the group to which the user of the new network attached storage NAS belongs exists or not;
optionally, for the explanation of step 3.3, please refer to step 2.3, which is not described in detail in the present invention.
Step 3.4, checking whether the production IP of the new network attached storage NAS responsible for service is authorized;
optionally, for the explanation of step 3.4, please refer to step 2.4, which is not described in detail in the present invention.
Step 3.5, checking whether the soft link is set on the file attribute of the new network attached storage NAS through an ls-l command;
alternatively, a soft link is a quick access path to the file creation, similar to a shortcut to windows. The operating system sets the soft link through the ls-l command, checks whether the soft link is set on the file attribute through the ls-l command, and if the file attribute has a corresponding identifier, the file is indicated to be set with the soft link and is already used.
If the authority setting is within the preset authority range, the user information exists, the genus group information exists, the soft link is set on the file attribute, and the production IP is authorized, executing step 3.6, otherwise executing step 3.7;
step 3.6, determining that the new network attached storage NAS passes the second pre-verification check;
step 3.7, determining that the new network attached storage NAS fails the second pre-verification check.
S400, unloading the old network attached storage NAS and mounting the new network attached storage NAS.
Alternatively, different operating systems may be implemented differently for off-loading and on-loading network attached storage, as the invention is not limited in this regard.
For example, for offloading the old network attached storage NAS, the implementation of the present invention is as follows: 1. AIX is unloaded by using rmnfsmnt mode; 2. linux and HPUX then use the umount command and use regular expressions to process the "/etc/fstab" file. Where "/etc/fstab" is a file used to store static information about the file system, when the system is started, the system automatically reads information from this file and automatically mounts the file system specified in this file to the specified directory. Unloading a certain file system must process the "/etc/fstab" file, i.e. delete the information of the file system in the file, and the deletion will not be carried out at system start-up.
That is, in connection with the embodiment shown in fig. 1, in some alternative embodiments, the S400 includes: step 4.1, step 4.2 and step 4.3;
step 4.1, unloading the old network attached storage NAS;
step 4.2, deleting information in the file corresponding to the preset path;
optionally, after unloading the old network attached storage NAS, the present invention may first confirm with the system environment whether the new network attached storage NAS is mountable. That is, the present invention can confirm with engineers responsible for hardware and network maintenance whether the new network attached storage NAS is mountable, and of course, the network attached storage is a dedicated data storage server, belonging to hardware devices. The invention can also confirm whether a new network attached storage NAS can be mounted by first confirming whether the network attached storage has been allocated at the hardware level and then pinging the network attached storage for connectivity of the network IP address.
And 4.3, mounting the new network attached storage NAS, and adding corresponding information into the file corresponding to the preset path.
For another example, different operating systems are different in implementation manners for mounting and unloading network attached storage, and the main implementation manners are as follows: 1. AIX uses mknfsmnt mode to mount default parameters, and for data pump and heartbeat disk related type parameters, adopts modification "/etc/filesystems" file to implement; 2. linux and HPUX then use mount commands to modify the "/etc/fstab" file to implement default parameters, data pump parameters, and heartbeat disk parameters.
Optionally, after the replacement of the network attached storage is completed, the specific result after the change can be displayed on the page, so as to confirm whether the replacement is successfully completed.
As shown in fig. 2, the present invention provides a network attached storage replacement device, comprising: an information acquisition unit 100, a first inspection unit 200, a second inspection unit 300, and a storage unloading unit 400;
the information acquisition unit 100 is configured to issue a preset acquisition script to an old network attached storage NAS to be offloaded, so as to acquire information of the old network attached storage NAS through the acquisition script;
if the information is successfully acquired, triggering the first checking unit 200;
the first checking unit 200 is configured to perform a first pre-checking check on the old network attached storage NAS, where the first pre-checking check includes checking a state of the old network attached storage NAS and checking a mount point directory of the old network attached storage NAS;
the second checking unit 300 is configured to perform a second pre-checking check on a new network attached storage NAS to be mounted, where the second pre-checking check includes checking authority setting, user information, genus information, soft link state and production IP state of the new network attached storage NAS;
triggering the storage offload unit 400 if the old network attached storage NAS passes the first pre-check and the new network attached storage NAS passes the second pre-check;
the storage uninstalling unit 400 is configured to uninstall the old network attached storage NAS and mount the new network attached storage NAS.
In connection with the embodiment shown in fig. 2, in some alternative embodiments, the first inspection unit 200 includes: a status checking subunit, a catalog viewing subunit, and a first determining subunit;
the state checking subunit is configured to check, through a mount command of the operating system, whether the state of the old network attached storage NAS is a mount error state or an unmounted state;
the catalog checking subunit is configured to check, through a cd command of an operating system, whether a subdirectory exists under a mount point of the old network attached storage NAS in a file system catalog of the old network attached storage NAS;
the first determining subunit is configured to determine that the old network attached storage NAS passes the first pre-verification check if the state of the old network attached storage NAS is not the mount error state and is not the mount non-state, and the mount point of the old network attached storage NAS does not have a subdirectory, and otherwise determine that the old network attached storage NAS does not pass the first pre-verification check.
In connection with the embodiment shown in fig. 2, in some alternative embodiments, the second inspection unit 300 includes: a first authority checking subunit, a first user checking subunit, a first genus group checking subunit, a first authorization checking subunit, and a second determining subunit;
the first authority checking subunit is configured to check whether the authority setting of the file system of the new network attached storage NAS is located within a preset authority range;
the first user checking subunit is configured to check whether the user information of the new network attached storage NAS exists;
the first genus group checking subunit is configured to check whether the genus group information corresponding to the group to which the user of the new network attached storage NAS belongs exists;
the first authorization checking subunit is configured to check whether the production IP of the responsible service of the new network attached storage NAS is authorized;
the second determining subunit is configured to determine that the new network attached storage NAS passes the second pre-verification check if the permission setting is within the preset permission range, the user information exists, the group information exists, and the production IP is authorized, and otherwise determine that the new network attached storage NAS does not pass the second pre-verification check.
In connection with the embodiment shown in fig. 2, in some alternative embodiments, the second inspection unit 300 includes: a second authority checking subunit, a second user checking subunit, a second genus checking subunit, a second authorization checking subunit, a link checking subunit, and a third determining subunit;
the second authority checking subunit is configured to check whether the authority setting of the file system of the new network attached storage NAS is located within a preset authority range;
the second user checking subunit is configured to check whether the user information of the new network attached storage NAS exists;
the second genus group checking subunit is configured to check whether the genus group information corresponding to the group to which the user of the new network attached storage NAS belongs exists;
the second authorization checking subunit is configured to check whether the production IP of the responsible service of the new network attached storage NAS is authorized;
the link checking subunit is configured to check, through an ls-l command, whether the soft link is set on a file attribute of the new network attached storage NAS;
the third determining subunit is configured to determine that the new network attached storage NAS passes the second pre-verification check if the permission setting is within the preset permission range, the user information exists, the group information exists, the soft link is set on the file attribute, and the production IP is authorized, otherwise determine that the new network attached storage NAS does not pass the second pre-verification check.
In connection with the embodiment shown in fig. 2, in some alternative embodiments, the storage and offloading unit 400 includes: unloading the subunit, deleting the subunit and mounting the subunit;
the unloading subunit is configured to unload the old network attached storage NAS;
the deleting subunit is used for deleting the information in the file corresponding to the preset path;
the mounting subunit is configured to mount the new network attached storage NAS, and add corresponding information to a file corresponding to the preset path.
The present invention provides a computer-readable storage medium having stored thereon a program which, when executed by a processor, implements the network attached storage replacement method of any of the above.
As shown in fig. 3, the present invention provides an electronic device 70, said electronic device 70 comprising at least one processor 701, and at least one memory 702, bus 703 connected to said processor 701; wherein, the processor 701 and the memory 702 complete communication with each other through the bus 703; the processor 701 is configured to invoke program instructions in the memory 702 to perform the network attached storage replacement method of any of the above.
In the present invention, 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. Moreover, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (10)

1. A method of replacing a network attached storage, comprising:
issuing a preset acquisition script to an old network attached storage NAS to be unloaded so as to acquire the information of the old network attached storage NAS through the acquisition script;
if the information is successfully acquired, performing a first pre-check on the old network attached storage NAS, wherein the first pre-check comprises checking the state of the old network attached storage NAS and checking a mounting point catalog of the old network attached storage NAS;
performing a second pre-verification check on a new network attached storage NAS to be mounted, wherein the second pre-verification check comprises checking authority setting, user information, genus information, soft link state and production IP state of the new network attached storage NAS;
and if the old network attached storage NAS passes the first pre-check and the new network attached storage NAS passes the second pre-check, unloading the old network attached storage NAS and mounting the new network attached storage NAS.
2. The method of claim 1, wherein the performing a first pre-check on the old network attached storage NAS comprises:
checking whether the state of the old network attached storage NAS is a mounting error state or a non-mounting state through a mount command of an operating system;
checking whether a subdirectory exists under a mounting point of the old network attached storage NAS or not in a file system catalog of the old network attached storage NAS through a cd command of an operating system;
if the state of the old network attached storage NAS is not the mounting error state and is not the un-mounted state, and the mounting point of the old network attached storage NAS does not have a subdirectory, determining that the old network attached storage NAS passes the first pre-check inspection, otherwise, determining that the old network attached storage NAS does not pass the first pre-check inspection.
3. The method of claim 1, wherein the second pre-verification check of the new network attached storage NAS to be mounted comprises:
checking whether the authority setting of the file system of the new network attached storage NAS is within a preset authority range;
checking whether the user information of the new network attached storage NAS exists;
checking whether the group information corresponding to the group to which the user of the new network attached storage NAS belongs exists or not;
checking whether said production IP of the new network attached storage NAS responsible for traffic is authorized;
if the authority setting is within the preset authority range, the user information exists, the genus group information exists, and the production IP is authorized, determining that the new network attached storage NAS passes the second pre-verification check, otherwise determining that the new network attached storage NAS fails the second pre-verification check.
4. The method of claim 1, wherein the second pre-verification check of the new network attached storage NAS to be mounted comprises:
checking whether the authority setting of the file system of the new network attached storage NAS is within a preset authority range;
checking whether the user information of the new network attached storage NAS exists;
checking whether the group information corresponding to the group to which the user of the new network attached storage NAS belongs exists or not;
checking whether said production IP of the new network attached storage NAS responsible for traffic is authorized;
checking whether the soft link is set on the file attribute of the new network attached storage NAS through an ls-l command;
and if the authority setting is in the preset authority range, the user information exists, the genus group information exists, the soft link is set on the file attribute, and the production IP is authorized, determining that the new network attached storage NAS passes the second pre-verification check, otherwise, determining that the new network attached storage NAS does not pass the second pre-verification check.
5. The method of claim 1, wherein said offloading the old network attached storage NAS and mounting the new network attached storage NAS comprises:
unloading the old network attached storage NAS;
deleting information in a file corresponding to the preset path;
and mounting the new network attached storage NAS, and adding corresponding information in the file corresponding to the preset path.
6. A network attached storage replacement device, comprising: the system comprises an information acquisition unit, a first checking unit, a second checking unit and a storage unloading unit;
the information acquisition unit is used for issuing a preset acquisition script to an old network attached storage NAS to be unloaded so as to acquire the information of the old network attached storage NAS through the acquisition script;
the first checking unit is configured to perform a first pre-checking check on the old network attached storage NAS if the information is successfully acquired, where the first pre-checking check includes checking a state of the old network attached storage NAS and checking a mount point directory of the old network attached storage NAS;
the second checking unit is configured to perform a second pre-checking check on a new network attached storage NAS to be mounted, where the second pre-checking check includes checking authority setting, user information, genus information, a soft link state, and a production IP state of the new network attached storage NAS;
the storage unloading unit is configured to unload the old network attached storage NAS and mount the new network attached storage NAS if the old network attached storage NAS passes the first pre-verification check and the new network attached storage NAS passes the second pre-verification check.
7. The apparatus of claim 6, wherein the first inspection unit comprises: a status checking subunit, a catalog viewing subunit, and a first determining subunit;
the state checking subunit is configured to check, through a mount command of the operating system, whether the state of the old network attached storage NAS is a mount error state or an unmounted state;
the catalog checking subunit is configured to check, through a cd command of an operating system, whether a subdirectory exists under a mount point of the old network attached storage NAS in a file system catalog of the old network attached storage NAS;
the first determining subunit is configured to determine that the old network attached storage NAS passes the first pre-verification check if the state of the old network attached storage NAS is not the mount error state and is not the mount non-state, and the mount point of the old network attached storage NAS does not have a subdirectory, and otherwise determine that the old network attached storage NAS does not pass the first pre-verification check.
8. The apparatus of claim 6, wherein the second inspection unit comprises: a first authority checking subunit, a first user checking subunit, a first genus group checking subunit, a first authorization checking subunit, and a second determining subunit;
the first authority checking subunit is configured to check whether the authority setting of the file system of the new network attached storage NAS is located within a preset authority range;
the first user checking subunit is configured to check whether the user information of the new network attached storage NAS exists;
the first genus group checking subunit is configured to check whether the genus group information corresponding to the group to which the user of the new network attached storage NAS belongs exists;
the first authorization checking subunit is configured to check whether the production IP of the responsible service of the new network attached storage NAS is authorized;
the second determining subunit is configured to determine that the new network attached storage NAS passes the second pre-verification check if the permission setting is within the preset permission range, the user information exists, the group information exists, and the production IP is authorized, and otherwise determine that the new network attached storage NAS does not pass the second pre-verification check.
9. A computer readable storage medium having a program stored thereon, wherein the program when executed by a processor implements the network attached storage replacement method of any one of claims 1 to 5.
10. An electronic device comprising at least one processor, and at least one memory, bus coupled to the processor; the processor and the memory complete communication with each other through the bus; the processor is configured to invoke program instructions in the memory to perform the network attached storage replacement method of any of claims 1 to 5.
CN202211425726.0A 2022-11-15 2022-11-15 Network attached storage replacement method and related device Pending CN116150121A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211425726.0A CN116150121A (en) 2022-11-15 2022-11-15 Network attached storage replacement method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211425726.0A CN116150121A (en) 2022-11-15 2022-11-15 Network attached storage replacement method and related device

Publications (1)

Publication Number Publication Date
CN116150121A true CN116150121A (en) 2023-05-23

Family

ID=86339704

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211425726.0A Pending CN116150121A (en) 2022-11-15 2022-11-15 Network attached storage replacement method and related device

Country Status (1)

Country Link
CN (1) CN116150121A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117056150A (en) * 2023-10-10 2023-11-14 宁波银行股份有限公司 Network attached storage detection method, device, equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117056150A (en) * 2023-10-10 2023-11-14 宁波银行股份有限公司 Network attached storage detection method, device, equipment and storage medium
CN117056150B (en) * 2023-10-10 2024-01-26 宁波银行股份有限公司 Network attached storage detection method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US9075680B2 (en) Firmware upgrade for thin clients using one or more servers
CN100399267C (en) Method of managing software installation and unloading
CN104699423B (en) The method and apparatus that drive is bound in linux system
JP2010152704A (en) System and method for operational management of computer system
CN108885671A (en) A kind of directory delete method, apparatus and storage server
TW201709081A (en) Automatic image recovery method and server system
WO2018173164A1 (en) Data processing system
WO2011036707A1 (en) Computer system for controlling backups using wide area network
CN112328366B (en) Efficient cloud platform host protection method and system
CN110941393A (en) Logical volume management-based LV supply method, device, equipment and medium
CN116150121A (en) Network attached storage replacement method and related device
EP3662362A1 (en) Systems and methods for customized operating system conversion
US20180113792A1 (en) Information processing system and updating method
US20140109089A1 (en) System to rebuild difference virtual hard disk for updating operation system and method thereof
CN112148678A (en) File access method, system, device and medium
CN110968478A (en) Log collection method, server and computer storage medium
CN104239091A (en) File cleaning method and device and terminal
US9176974B1 (en) Low priority, multi-pass, server file discovery and management
CN110096226B (en) Disk array deployment method and device
CN108595292B (en) System optimization method, mobile terminal and computer storage medium
CN108984356A (en) A kind of IT product test method and device
EP1160666A2 (en) Switching versions of software in a system background
CN109992215A (en) A kind of upgrade method, upgrade-system and the relevant apparatus of ICFS system
CN116483468B (en) Operating system installation method and device, computer equipment and storage medium
US20230403324A1 (en) Data sharing system, data sharing method and non-transitory computer-readable recording medium for data sharing program

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