CN107368486B - Service migration method and device - Google Patents

Service migration method and device Download PDF

Info

Publication number
CN107368486B
CN107368486B CN201610312829.4A CN201610312829A CN107368486B CN 107368486 B CN107368486 B CN 107368486B CN 201610312829 A CN201610312829 A CN 201610312829A CN 107368486 B CN107368486 B CN 107368486B
Authority
CN
China
Prior art keywords
storage system
task
file
target storage
source storage
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
CN201610312829.4A
Other languages
Chinese (zh)
Other versions
CN107368486A (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.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201610312829.4A priority Critical patent/CN107368486B/en
Publication of CN107368486A publication Critical patent/CN107368486A/en
Application granted granted Critical
Publication of CN107368486B publication Critical patent/CN107368486B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • 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/11File system administration, e.g. details of archiving or snapshots
    • G06F16/119Details of migration of file systems

Abstract

The application discloses a service migration method and a device, wherein the method comprises the following steps: after a file of a source storage system is migrated to a target storage system, when a first task of the source storage system is created for the migrated file, a second task of the target storage system is created, wherein the second task corresponds to the first task; executing the first task and the second task; comparing the first task execution result with the second task execution result; and after the comparison result is determined to be consistent, migrating the service provided by the source storage system to the target storage system.

Description

Service migration method and device
Technical Field
The present application relates to the field of information technologies, and in particular, to a service migration method and apparatus.
Background
With the rapid development of information technology and internet technology, mass information is generated on the internet every day, and in order to be recycled, a lot of generated information is stored in a file form. Common file Storage modes include a Network Attached Storage (NAS) mode, an Object-Based Storage (OS) mode, and the like.
In the prior art, a storage system based on a certain file storage manner is usually adopted to provide file storage related services for users, and the related services can perform operations such as the following by using the users: reading files stored in the storage system, uploading files to the storage system, downloading files to the storage system, and so forth. When the user performs these operations, the storage system creates a corresponding task and executes the generated task, for example, for an operation of uploading a file to the storage system, the correspondingly created task is a task of generating the file in the storage system.
Due to the changing file storage requirements, changes may need to be made to the currently used file storage. Specifically, various files in a storage system based on a certain file storage method (referred to as a source storage system) and services provided by the source storage system need to be migrated to a storage system based on another file storage method.
However, in practical applications, the file types of the files in the source storage system are generally multiple, the inheritance relationships among the multiple file types are complex, and file migration needs to change the basic classes related to the file types, so that the stability of the target storage system after the file migration is difficult to guarantee, and therefore, the risk of service migration is high.
Disclosure of Invention
The embodiment of the application provides a service migration method and device, which are used for solving the problem that in the prior art, service migration risks among file storage systems are high.
The embodiment of the application provides another service migration method and device.
The embodiment of the application adopts the following technical scheme:
the service migration method provided by the embodiment of the application comprises the following steps:
after a file of a source storage system is migrated to a target storage system, when a first task of the source storage system is created for the migrated file, a second task of the target storage system is created, wherein the second task corresponds to the first task;
executing the first task and the second task;
comparing the first task execution result with the second task execution result;
and after the comparison result is determined to be consistent, migrating the service provided by the source storage system to the target storage system.
An embodiment of the present application provides a service migration apparatus, including:
the file task module is used for creating a second task of the target storage system when a first task of the source storage system is created aiming at the migrated file after the file of the source storage system is migrated to the target storage system, wherein the second task corresponds to the first task;
an execution module to execute the first task and the second task;
the comparison module is used for comparing the first task execution result with the second task execution result;
and the service migration module is used for migrating the service provided by the source storage system to the target storage system after the comparison result is determined to be consistent.
Another service migration method provided in an embodiment of the present application includes:
after a file of a source storage system is migrated to a target storage system, when a first task of the source storage system is created aiming at the migrated file, a second task of the target storage system is created, wherein the second task corresponds to the first task, and a file storage mode adopted by the source storage system is different from a file storage mode adopted by the target storage system;
executing the first task and the second task;
comparing the first task execution result with the second task execution result;
and after the comparison result is determined to be consistent, migrating the service provided by the source storage system to the target storage system.
Another service migration apparatus provided in an embodiment of the present application includes:
the file task module is used for creating a second task of the target storage system when a first task of the source storage system is created aiming at the migrated file after the file of the source storage system is migrated to the target storage system, wherein the second task corresponds to the first task, and the file storage mode adopted by the source storage system is different from the file storage mode adopted by the target storage system;
an execution module to execute the first task and the second task;
the comparison module is used for comparing the first task execution result with the second task execution result;
and the service migration module is used for migrating the service provided by the source storage system to the target storage system after the comparison result is determined to be consistent.
The embodiment of the application adopts at least one technical scheme which can achieve the following beneficial effects: for a migrated file, the source storage system and the target storage system may be operated in parallel by executing tasks related to the file in the source storage system and the target storage system, respectively, and whether to perform service migration may be determined according to a parallel operation condition.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a process of a service migration method according to an embodiment of the present application;
fig. 2 is a schematic diagram of phase division of a migration process in an actual application scenario according to an embodiment of the present application;
fig. 3 is a process of another service migration method provided in the embodiment of the present application;
fig. 4 is a schematic structural diagram of a service migration apparatus corresponding to fig. 1 according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a service migration apparatus corresponding to fig. 3 according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, 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 application.
In the embodiment of the present application, the source storage system and the target storage system may use different file storage manners, for example, the source storage system may use an NAS manner, and the target storage system may use an OS manner, and the like; the source storage system and the target storage system may also use the same file storage method. The following examples are mainly explained based on the former case.
The purpose of migration from a source storage system to a target storage system may be: such that services provided by the source storage system prior to migration are changed to be provided by the target storage system after migration. Superficially, the migration may refer to migration of a file in the source storage system, and in essence, the migration may refer to migration of some or all of the traffic involving the migrated file. For example, before migration, a user uploads and downloads a file to a source storage system, and after migration, the user may not upload and download the file to the source storage system, but upload and download the file to a target storage system.
For file migration between a source storage system and a target storage system which adopt different file storage modes, the method may include: and according to the file type of the file in the source storage system, modifying the target storage system which does not support the file type originally so that the target storage system can support the file type after modification, and then migrating the file in the source storage system to the target storage system.
For file migration between a source storage system and a target storage system which adopt the same file storage mode, the method may include: and directly migrating the data in the source storage system to the target storage system without modifying the target storage system.
The core idea of the scheme of the application is as follows: the process related to the service migration can be divided into a plurality of stages to realize stable migration, in some stages, the source storage system and the target storage system can run in parallel, and the stability of the target storage system before and after the service migration can be presumed according to the parallel running condition to determine whether the service migration is performed or not. The scheme of the application is beneficial to reducing the risk of service migration.
The following describes the scheme of the present application.
Fig. 1 is a process of a service migration method according to an embodiment of the present application. The executing body of the process can be a device in which the source storage system is located, and/or a device in which the target storage system is located, and/or other devices related to the source storage system and the target storage system, and the like. These devices may be in particular: personal computers, large and medium sized computers, computer clusters, mobile phones, tablet computers, smart watches, vehicle-mounted mobile stations, and the like. The specific types of devices listed above are exemplary only and should not be construed as limiting the application.
The process in fig. 1 may include the following steps:
s101: after a file of a source storage system is migrated to a target storage system, when a first task of the source storage system is created for the migrated file, a second task of the target storage system is created, wherein the second task corresponds to the first task.
In the embodiment of the application, the files of the source storage system can be migrated to the target storage system in batches, or the files of the source storage system can be migrated to the target storage system integrally. In general, the advantages of the former approach are: only a part of files are migrated each time, the processing load of the system is relatively small, and the overall influence and risk on the system are relatively small; the advantages of the latter approach are: file migration and service migration can be accomplished relatively quickly.
In this embodiment of the present application, for file types corresponding to various files in a source storage system, in order to support these file types, it may be necessary to modify relevant codes of a target storage system and other peripheral systems according to a difference between file storage manners adopted by the source storage system and the target storage system, so that the modified codes are adapted to the file storage manner adopted by the target storage system. For example, the codes may be interface, file type, business logic related codes, and the like.
Before the code modification, only the source storage system and the target storage system can be operated to provide services for the outside, and the target storage system is not started temporarily. That is, tasks may be created and performed only by the source storage system, which may be tasks that may be performed by the file storage system.
In this embodiment of the application, after the code modification is started, for a file that has been migrated, the running condition of the target storage system before and after the file that has been migrated in step S102 is detected in a manner that the source storage system and the target storage system run in parallel, so as to determine whether the target storage system is stable.
In the embodiment of the present application, in order to prevent the target storage system from being unstable and further affecting the service after the file is migrated, the source storage system may still provide the actual service temporarily, and the target storage system may adopt a simulation form to provide the service in a simulation manner, that is, when the second task is executed, the service may not be substantially affected to the outside, which has the advantages that: the method and the system can not only prevent the target storage system from influencing the service when being unstable, but also prevent the source storage system and the target storage system from repeatedly providing the same service, thereby possibly not ensuring the idempotent of the service.
Specifically, the second task may not include the target storage system and the external actual business operation, or only include the target storage system and a part of the actual business operation external to the target storage system. It is thus possible to realize that the target storage system may not have a substantial influence on the outside when the second task is executed. The first task may include the source storage system and the external actual business operation, so that the source storage system may have a substantial influence on the external when the first task is executed. For convenience of description, the first task may be referred to as: an active task; and the second task may be referred to as: and (5) assisting the task.
The external portion may be external to the target storage system, or external to both the source storage system and the target storage system as a whole.
S102: executing the first task and the second task.
In the embodiment of the present application, the first task and the second task may be executed simultaneously, or may be executed according to a certain sequence.
S103: and comparing the first task execution result with the second task execution result.
In the embodiment of the present application, the second task does not have a substantial influence on the outside, but may still have a substantial influence on the target storage system, for example, the second task may be executed to generate a file (specifically, an export file, etc.) and parse a file (specifically, an import file) for the target storage system.
For convenience of description, this stage of steps S101 to S102 may be referred to as: the source storage system runs in parallel with the target storage system, with the source storage system as the dominant phase. In this stage, files and parsed files and the like may be generated based on both the source storage system and the target storage system, and further, for the outside, the outside may read files and upload files and the like from the source storage system, and may not read files and upload files from the target storage system for a while, because the target storage system may not yet be stable.
S104: and after the comparison result is determined to be consistent, migrating the service provided by the source storage system to the target storage system.
In the embodiment of the present application, it has been mentioned above that the stability of the target storage system before and after migration can be inferred according to the parallel operation condition, and step S103 can be taken as a specific implementation of the inference. Generally, for an effective task and an auxiliary task, if the corresponding files have been successfully migrated and the source target storage system and the target storage system are normally and stably running, the comparison result is consistent when comparing the task execution results of the effective task and the auxiliary task, and otherwise, the comparison result is inconsistent.
For ease of understanding, the "aligned results" are explained. In step S103, if it is determined through comparison that the content of the file (e.g., the generated file) related to the first task execution result is the same as the content of the file related to the second task execution result, it may be determined that the comparison results are consistent, and conversely, it may be determined that the comparison results are not consistent. If a problem occurs in migration or the source storage system or the target storage system is unstable, the comparison result may be inconsistent. In practical applications, the identity may refer to that the files are identical or that the files are not identical, but the substantial contents of the files are identical. For a file, there may be some additional content that can be used to additionally explain the substance content, in addition to the substance content.
In the embodiment of the application, after the comparison result is determined to be consistent, it may be considered that after the file type of the source storage system is migrated to the target storage system, the target storage system may operate normally and stably, and may replace the source storage system to provide a service, and then may migrate the service provided by the source storage system to the target storage system, so that the service migration process may be completed. Thereafter, the user or system that originally acquired the service from the source storage system may acquire the service from the target storage system.
In the embodiment of the present application, as for step S101, if only part of the files of the source storage system are migrated to the target storage system, not all of the files are migrated. Accordingly, for step S104, after the comparison result is determined to be consistent, only the services provided by the source storage system and corresponding to the migrated files may be migrated to the target storage system, and the services corresponding to the files that have not yet been migrated may still be provided by the source storage system and not yet be migrated to the target storage system. Alternatively, in step S104, after the comparison result is determined to be consistent, the service migration may not be performed temporarily, but the service migration may be performed after all the files in the source storage system have been migrated.
It should be noted that the executing subjects of the steps in fig. 1 may be the same device, or different devices may be used as the executing subjects of the method. For example, the execution subject of step S101 and step S102 may be device 1, and the execution subject of step S103 and step S104 may be device 2; for another example, the execution subject of step S101 may be device 1, and the execution subjects of steps S102 to S104 may be device 2; and so on.
Through the method in fig. 1, for a migrated file, a source storage system and a target storage system may run in parallel by executing tasks related to the file in the source storage system and the target storage system, respectively, and whether to perform service migration may be determined according to a parallel running condition, so that, compared with the prior art, the scheme of the present application may reduce a risk of service migration, and therefore, problems in the prior art may be partially or completely solved.
Based on the above method, the examples of the present application also provide some specific embodiments and extensions of the above method, which are described below.
In the embodiment of the present application, before the stability of the target storage system is not ensured, the file generated by the target storage system may be unreliable, and in order to reduce the influence and risk on the related service, a file transmission channel from the target storage system to the outside may be temporarily blocked, so that during the blocking period, the file in the target storage system may not flow to the outside, and thus, the related service may not be influenced.
The external may read the file only from the source storage system and not from the target storage system.
Based on such consideration, for step S102, before executing the first task and the second task, the following steps may be further executed: the method includes maintaining an open state of a file transfer channel from the source storage system to outside the source storage system, and maintaining a closed state of a file transfer channel from the target storage system to outside the target storage system. The specific manner of controlling the file transmission channel to be opened or closed is not limited in the present application, and generally, a software switch or a hardware switch may be used for controlling.
In this embodiment of the application, if it is determined that the comparison results are consistent in step S103, the target storage system may be considered to be relatively stable, and the service provided by the source storage system may be migrated to the target storage system. In practical applications, under the condition that the file storage modes adopted by the source storage system and the target storage system are different, in order to implement file migration and service migration, file access modification may need to be performed on the periphery of the target storage system according to the file storage mode adopted by the target storage system, so that after modification, an external part can normally access files in the target storage system. In the stage of file access modification, the stability of the target storage system and the reliability of accessing the file in the target storage system can be further detected.
Specifically, in the process of modifying file access, the target storage system may be used as a master, and the source storage system may be used as an auxiliary to perform parallel operation, for convenience of description, this stage may be referred to as "this stage", which is a stage in which the source storage system and the target storage system operate in parallel and the target storage system is used as a master (steps S101 to S102 are stages in which the source storage system is used as a master), for a first task and a second task created in the stage in which the source storage system is used as a master, the first task may include actual business operations outside the source storage system and the source storage system, and the second task may not include actual business operations outside the target storage system and the target storage system. In this phase, however, the process may be reversed from the phase in which the source storage system is dominant, as will be described below.
For step S104, before migrating the service provided by the source storage system to the target storage system, the following steps may also be performed:
when a third task of a source storage system is created for the migrated file, a fourth task of a target storage system is created, the fourth task corresponding to the third task;
executing the third task and the fourth task;
and comparing the third task execution result with the fourth task execution result, and determining that the comparison results are consistent.
The third task may not include the actual business operation between the source storage system and the outside of the source storage system, or only include a part of the actual business operation between the source storage system and the outside of the source storage system, so that when the task is executed, the source storage system may not generate substantial influence on the outside; the fourth task may include the target storage system operating with an actual business external to the target storage system.
It can be seen that this phase is similar to the one that the source storage system is the dominant, with the difference that: in this stage, the task of the source storage system (third task) is regarded as the auxiliary task, and the task of the target storage system (fourth task) is regarded as the effective task. In this stage, the peripheral may select and read the file in the source storage system or the target storage system according to the time of the system file access modification.
Further, at this stage, before the third task and the fourth task are executed, the following steps may be further executed: the method includes maintaining a closed state of a file transfer channel from the source storage system to outside the source storage system, and maintaining an open state of a file transfer channel from the target storage system to outside the target storage system. Thus, files in the target storage system can flow to the outside.
In the embodiment of the present application, when the first task and the second task are executed, or when the third task and the fourth task are executed, in consideration of the influence of the system performance, the third task and the fourth task may not be executed at the same time, and the third task and the fourth task may not be executed at the same time, but may be executed at different times, which is advantageous to reduce the instantaneous pressure of the system.
For example, for step S102, executing the first task and the second task may specifically include: the first task is executed, and after a predetermined length of time has elapsed, the second task is executed. Of course, in practical applications, it is also possible to perform the second first.
For another example, executing the third task and the fourth task may specifically include: executing the fourth task, and after a predetermined length of time has elapsed, executing the third task.
In the embodiment of the application, at the stage where the source storage system is taken as the leading stage or the present stage, the auxiliary task can skip the actual business operation compared with the corresponding effective task, and the auxiliary task can generally only record the calling parameters and the like and write the parameters into the result file for subsequent comparison.
In practical applications, the target storage system generally pays attention to the performance of the target storage system in addition to whether the target storage system is stable, and if the performance cannot meet a predetermined requirement, after the service provided by the source storage system is migrated to the target storage system, a serious influence may be caused on the related service. In this regard, the stage where the source storage system is dominant and the present stage may detect the performance of the target storage system in addition to the comparison task execution result.
Specifically, in the stage of taking the source storage system as the master and/or the present stage, the following steps may be further performed: determining whether the performance of the target storage system in executing the second task and/or the fourth task meets a preset requirement; if so, the service migration can be subsequently performed, otherwise, the service migration can be temporarily not performed, the target storage system is processed according to the found performance problem, and the service migration is performed after the performance problem is solved, so that the service migration risk can be reduced.
In the embodiment of the application, after the stage taking the source storage system as the leading stage and/or the stage, and after the comparison result is determined to be consistent and the performance is not problematic, the service migration can be performed. Specifically, only the task of the target storage system may be created, and the task of the source storage system is no longer created, and the target storage system may provide services such as file reading, file uploading and downloading, and the like to the outside instead of the source storage system.
As can be seen from the above description, in the embodiment of the present application, the whole service migration process may be divided into multiple stages to achieve steady migration. Based on such premises, in order to further improve the beneficial effect of the scheme of the present application, batch migration may be performed in each stage according to the file type dimension, for example, batch migration may be performed on all files in the source storage system according to the file types, and after all the file types in the source storage system are already in the stage corresponding to steps S101 to S103, the next stage (which may be the present stage) is continuously batch-advanced, and accordingly, service migration is performed in batches (or service migration may be performed after all the files are migrated completely). The advantages of this are: the influence range of the current migration can be limited in a plurality of migrated files as much as possible, and the overall complexity is reduced.
Based on the above-mentioned concept of batch migration, the embodiment of the present application provides a specific implementation process of the process in fig. 1. The specific implementation process can comprise the following steps:
according to the file types of the files in the source storage system, sequentially executing the following steps aiming at each file type:
after the file of the file type is migrated to the target storage system, when a first task of the source storage system is created for the file of the file type, a second task of the target storage system is created, wherein the second task corresponds to the first task; executing the first task and the second task; comparing the first task execution result with the second task execution result;
and after the comparison results corresponding to each file type are determined to be consistent, migrating the service provided by the source storage system to the target storage system.
It should be noted that batch migration according to the file type dimension is only an example, and in practical applications, batch migration may also be performed according to other dimensions (e.g., a time dimension, a business dimension, etc.), and may also be performed in combination with multiple dimensions.
The service migration method provided in the embodiment of the present application is described above, and for convenience of understanding, the embodiment of the present application further provides an implementation of the migration method in an actual application scenario.
In this practical application scenario, the file storage method adopted by the source storage system may be an NAS method, the file storage method adopted by the target storage system may be an OS method, and the external portion may refer to another predetermined file storage system.
It should be noted that, the present application does not limit specific names of the source storage system and the target storage system in practical applications. For convenience of description, it is assumed that in the actual application scenario, the name of the target Storage system is a Network Attached Storage (NAS) file system, which is hereinafter referred to as "NAS" file system: NAS; the name of the target storage system is: an Object Storage Service (OSS) file system, hereinafter referred to as OSS. The first task and the third task may be NAS tasks, and the second task and the fourth task may be OSS tasks.
In this scenario, the migration process from NAS to OSS may be divided into 4 stages, and migration may be performed in batches according to file type dimensions during migration. The divided 4 phases are respectively called NAS phase, NAS _ OSS phase, OSS _ NAS phase, OSS phase, as shown in fig. 2. The following is a detailed description of these 4 stages.
An NAS stage: this phase may be assumed before the code has not been OSS rebuilt. At this stage, only the tasks of the NAS may be created, and not the tasks of the OSS.
NAS _ OSS phase: this stage may be a stage corresponding to steps S101 to S103 described above. For the file migrated at this stage, the file can be generated and parsed based on both NAS and OSS. The task of the NAS is an active task and the task of the OSS is an auxiliary task. The periphery takes the NAS file as a standard, and the periphery can not be subjected to file access transformation at this time, and the file can be read from the NAS and uploaded according to a preset strategy. In practical applications, the NAS or OSS may be externally serviced through a peripheral.
Specifically, when creating a task, two tasks can be created at the same time for the same taskholder, one being a task of processing an NAS file, and the other being a task of processing an OSS file. Further, the trigger times for triggering the task of the NAS and the task of the OSS to execute may be staggered. For example, the NAS task may be triggered at the current time, and the OSS task may be pushed backward by 4 hours at the current time, and in order to prevent the execution time of the tasks from being over the day, the OSS task after 19:00 may not be pushed backward, and it should be noted that 4 hours is an example of the above predetermined time period, and is not a limitation to the predetermined time period.
At this stage, in order to guarantee the idempotency in the traffic, it is necessary to ensure that all traffic operations (such as calling interfaces, sending messages, etc.) must be performed only by the active task (the task that is NAS), while the auxiliary task needs to skip the actual traffic operations (i.e., not including the actual traffic operations with the outside). The auxiliary task may only record the call parameters and the like, and write the parameters into the result file for subsequent comparison.
At this stage, the switch that notifies file exchange to upload OSS files to the predetermined file storage system is closed (i.e., the above-described switch maintains the file transfer path from the source storage system to the outside of the source storage system in a closed state) to ensure that the predetermined file storage system only takes the export files generated by the active task.
Further, the NAS file at this stage may be compared with the corresponding OSS file, and if the comparison determines that the file contents are the same, and it is determined that the OSS file processing operation is stable and the time is within the service acceptable range, the next stage may be entered. In practical application, the operation of comparing the files can be generally executed by the supervision system or other systems with similar functions to the supervision system.
OSS _ NAS phase: at this stage, the OSS file generation may be the standard and the periphery may be notified to perform OSS file access modification.
This phase may still generate files based on both NAS and OSS. The difference from the previous stage is that the OSS task is an effective task, the NAS task is an auxiliary task, accordingly, the trigger time of the NAS task can be pushed back according to the normal trigger time, and the periphery can selectively read the OSS file or the NAS file according to the system reconstruction time of the periphery.
At this stage, in order to guarantee idempotency in business, it is necessary to ensure that all business operations (such as calling an interface, sending a message, etc.) must be performed only by the active task (the task that is the OSS), while the auxiliary tasks need to skip the actual business operations. The auxiliary task may only record the call parameters and the like, and write the parameters into the result file for subsequent comparison.
At this stage, the switch that notifies the file exchange to upload the OSS file to the predetermined file storage system is to be opened and the switch that notifies the file exchange to upload the NAS file to the predetermined file storage system is to be closed to ensure that the predetermined file storage system only takes the export file generated by the active task.
And an OSS stage:
after the NAS and the OSS are subjected to the parallel operation period (namely, the NAS _ OSS stage and the OSS _ NAS stage), the comparison result is verified to be consistent (the NAS file related to the task is not different from the OSS file), the OSS performance meets the preset requirement, and after the OSS access transformation is completed on the periphery, only the task generation file of the OSS can be created, the task generation file of the NAS is not created any more, so that the service provided by the NAS can be migrated to the OSS. If all files complete these four phases, the entire migration process may be considered to be complete.
In the practical application scenario, the migration process is divided into a plurality of stages, task execution results of the NAS and OSS parallel operation stages are compared by the back supervising system to compare the stability of the system before and after migration, and whether a service is performed or not can be determined according to the comparison results, so that the risk of service migration can be greatly reduced.
In practical application, compared with the case that the file storage modes adopted by the source storage system and the target storage system are the same, in the case that the file storage modes adopted by the source storage system and the target storage system are different, the case that the target storage system is unstable after file migration is more likely to occur, because in the latter case, the target storage system needs to be modified so that the modified target storage system supports the file types supported by the source storage system.
Based on the same idea as that of the method in fig. 1, an embodiment of the present application further provides another service migration method, as shown in fig. 3.
Fig. 3 is a process of another service migration method provided in the embodiment of the present application, where the process may include the following steps:
s301: after a file of a source storage system is migrated to a target storage system, when a first task of the source storage system is created for the migrated file, a second task of the target storage system is created, wherein the second task corresponds to the first task, and a file storage mode adopted by the source storage system is different from a file storage mode adopted by the target storage system.
S302: executing the first task and the second task.
S303: and comparing the first task execution result with the second task execution result.
S304: and after the comparison result is determined to be consistent, migrating the service provided by the source storage system to the target storage system.
Through the method in fig. 3, for a migrated file, a source storage system and a target storage system may run in parallel by executing tasks related to the file in the source storage system and the target storage system, respectively, and whether to perform service migration may be determined according to a parallel running condition, so that, compared with the prior art, the scheme of the present application may reduce a risk of service migration, and therefore, problems in the prior art may be partially or completely solved.
Based on the same idea, the service migration method provided in the embodiment of the present application further provides a corresponding service migration apparatus, as shown in fig. 4 and 5.
Fig. 4 is a schematic structural diagram of a service migration apparatus corresponding to fig. 1 according to an embodiment of the present application, where the apparatus includes:
the file task module 401 is configured to, after a file of a source storage system is migrated to a target storage system, create a second task of the target storage system when a first task of the source storage system is created for the migrated file, where the second task corresponds to the first task;
an execution module 402 for executing the first task and the second task;
a comparing module 403, configured to compare the first task execution result with the second task execution result;
and a service migration module 404, configured to migrate the service provided by the source storage system to the target storage system after determining that the comparison result is consistent.
Optionally, the apparatus further comprises:
a switch module 405, configured to keep the file transfer channel from the source storage system to the outside of the source storage system in an open state and keep the file transfer channel from the target storage system to the outside of the target storage system in a closed state before the execution module 402 executes the first task and the second task.
Optionally, the first task includes the source storage system and an actual business operation outside the source storage system, and the second task does not include the target storage system and an actual business operation outside the target storage system;
before the service migration module 404 migrates the service provided by the source storage system for outside of the source storage system to the target storage system,
the file task module 401 is further configured to: when a third task of a source storage system is created for a migrated file, a fourth task of a target storage system is created, wherein the fourth task corresponds to the third task, the third task does not include actual business operations outside the source storage system and the source storage system, and the fourth task includes actual business operations outside the target storage system and the target storage system;
the execution module 402 is further configured to: executing the third task and the fourth task;
the alignment module 403 is further configured to: and comparing the third task execution result with the fourth task execution result, and determining that the comparison results are consistent.
Optionally, the switch module 404 is further configured to keep the file transfer channel from the source storage system to the outside of the source storage system in a closed state and keep the file transfer channel from the target storage system to the outside of the target storage system in an open state before the execution module 402 executes the third task and the fourth task.
Optionally, the apparatus is specifically configured to:
according to the file types of the files in the source storage system, sequentially executing the following steps aiming at each file type:
after the file of the file type is migrated to the target storage system, when a first task of the source storage system is created for the file of the file type, a second task of the target storage system is created, wherein the second task corresponds to the first task; executing the first task and the second task; comparing the first task execution result with the second task execution result;
and after the comparison results corresponding to each file type are determined to be consistent, migrating the service provided by the source storage system to the target storage system.
Optionally, the execution module 402 is specifically configured to: the first task is executed, and after a predetermined length of time has elapsed, the second task is executed.
Optionally, the apparatus further comprises:
the performance detection module 405 is configured to determine that performance of the second task meets a predetermined requirement before the service migration module 404 migrates the service provided by the source storage system to the target storage system.
Optionally, the source storage system uses a different file storage method than the target storage system.
Optionally, the file storage mode adopted by the source storage system may be a network attached storage NAS mode, and the file storage mode adopted by the target storage system may be an object storage OS mode.
The apparatus in fig. 4 may be specifically located on a device where the source storage system is located, and/or a device where the target storage system is located, and/or other devices related to the source storage system and the target storage system.
Fig. 5 is a schematic structural diagram of a service migration apparatus corresponding to fig. 3 according to an embodiment of the present application, where the apparatus includes:
the file task module 501 is configured to, after a file of a source storage system is migrated to a target storage system, create a second task of the target storage system when creating a first task of the source storage system for the migrated file, where the second task corresponds to the first task, and a file storage manner adopted by the source storage system is different from a file storage manner adopted by the target storage system;
an execution module 502, configured to execute the first task and the second task;
a comparing module 503, configured to compare the first task execution result with the second task execution result;
and the service migration module 504 is configured to migrate the service provided by the source storage system to the target storage system after determining that the comparison result is consistent.
The device provided by the application is in one-to-one correspondence with the method provided by the application, so the device also has the beneficial technical effects similar to the method, and the beneficial technical effects of the method are explained in detail above, so the beneficial technical effects of the device are not described again.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (16)

1. A method for service migration, comprising:
after a file of a source storage system is migrated to a target storage system, when a first task of the source storage system is created for the migrated file, a second task of the target storage system is created, wherein the second task corresponds to the first task;
executing the first task and the second task;
comparing the first task execution result with the second task execution result;
after the comparison result is determined to be consistent, migrating the service provided by the source storage system to the target storage system;
the first task comprises the source storage system and actual business operation outside the source storage system, and the second task does not comprise the target storage system and actual business operation outside the target storage system;
before migrating the service provided by the source storage system to the target storage system, the method further includes:
when a third task of a source storage system is created for a migrated file, a fourth task of a target storage system is created, wherein the fourth task corresponds to the third task, the third task does not include actual business operations outside the source storage system and the source storage system, and the fourth task includes actual business operations outside the target storage system and the target storage system;
executing the third task and the fourth task;
and comparing the third task execution result with the fourth task execution result, and determining that the comparison results are consistent.
2. The method of claim 1, wherein prior to executing the first task and the second task, the method further comprises:
the method includes maintaining an open state of a file transfer channel from the source storage system to outside the source storage system, and maintaining a closed state of a file transfer channel from the target storage system to outside the target storage system.
3. The method of claim 1, wherein prior to performing the third task and the fourth task, the method further comprises:
the method includes maintaining a closed state of a file transfer channel from the source storage system to outside the source storage system, and maintaining an open state of a file transfer channel from the target storage system to outside the target storage system.
4. The method according to claim 1, characterized in that it comprises in particular:
according to the file types of the files in the source storage system, sequentially executing the following steps aiming at each file type:
after the file of the file type is migrated to the target storage system, when a first task of the source storage system is created for the file of the file type, a second task of the target storage system is created, wherein the second task corresponds to the first task; executing the first task and the second task; comparing the first task execution result with the second task execution result;
and after the comparison results corresponding to each file type are determined to be consistent, migrating the service provided by the source storage system to the target storage system.
5. The method of claim 1, wherein executing the first task and the second task specifically comprises:
the first task is executed, and after a predetermined length of time has elapsed, the second task is executed.
6. The method of claim 1, wherein before migrating the services provided by the source storage system to the target storage system, the method further comprises:
determining that the performance of the second task meets a predetermined requirement.
7. The method according to any one of claims 1 to 6, wherein the source storage system uses a different file storage method than the target storage system.
8. The method according to any one of claims 1 to 6, wherein the file storage mode adopted by the source storage system is a Network Attached Storage (NAS) mode, and the file storage mode adopted by the target storage system is an Object Storage (OS) mode.
9. A service migration apparatus, comprising:
the file task module is used for creating a second task of the target storage system when a first task of the source storage system is created aiming at the migrated file after the file of the source storage system is migrated to the target storage system, wherein the second task corresponds to the first task;
an execution module to execute the first task and the second task;
the comparison module is used for comparing the first task execution result with the second task execution result;
the service migration module is used for migrating the service provided by the source storage system to the target storage system after the comparison result is determined to be consistent;
the first task comprises the source storage system and actual business operation outside the source storage system, and the second task does not comprise the target storage system and actual business operation outside the target storage system;
before the service migration module migrates the service provided by the source storage system for the outside of the source storage system to the target storage system,
the file task module is further configured to: when a third task of a source storage system is created for a migrated file, a fourth task of a target storage system is created, wherein the fourth task corresponds to the third task, the third task does not include actual business operations outside the source storage system and the source storage system, and the fourth task includes actual business operations outside the target storage system and the target storage system;
the execution module is further to: executing the third task and the fourth task;
the alignment module is further configured to: and comparing the third task execution result with the fourth task execution result, and determining that the comparison results are consistent.
10. The apparatus of claim 9, wherein the apparatus further comprises:
and the switch module is used for keeping the file transmission channel from the source storage system to the outside of the source storage system in an open state and keeping the file transmission channel from the target storage system to the outside of the target storage system in a closed state before the execution module executes the first task and the second task.
11. The apparatus of claim 9, wherein the apparatus further comprises:
and the switch module is used for keeping a file transmission channel from the source storage system to the outside of the source storage system in a closed state and keeping a file transmission channel from the target storage system to the outside of the target storage system in an open state before the execution module executes the third task and the fourth task.
12. The apparatus of claim 9, wherein the apparatus is specifically configured to:
according to the file types of the files in the source storage system, sequentially executing the following steps aiming at each file type:
after the file of the file type is migrated to the target storage system, when a first task of the source storage system is created for the file of the file type, a second task of the target storage system is created, wherein the second task corresponds to the first task; executing the first task and the second task; comparing the first task execution result with the second task execution result;
and after the comparison results corresponding to each file type are determined to be consistent, migrating the service provided by the source storage system to the target storage system.
13. The apparatus of claim 9, wherein the execution module is specifically configured to: the first task is executed, and after a predetermined length of time has elapsed, the second task is executed.
14. The apparatus of claim 9, wherein the apparatus further comprises:
and the performance detection module is used for determining that the performance meets the preset requirement when the second task is executed before the service provided by the source storage system is migrated to the target storage system by the service migration module.
15. The apparatus according to any one of claims 9 to 14, wherein the source storage system uses a different file storage method than the target storage system.
16. The apparatus according to any one of claims 9 to 14, wherein the file storage system of the source storage system is a network attached storage NAS system, and the file storage system of the target storage system is an object storage OS system.
CN201610312829.4A 2016-05-12 2016-05-12 Service migration method and device Active CN107368486B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610312829.4A CN107368486B (en) 2016-05-12 2016-05-12 Service migration method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610312829.4A CN107368486B (en) 2016-05-12 2016-05-12 Service migration method and device

Publications (2)

Publication Number Publication Date
CN107368486A CN107368486A (en) 2017-11-21
CN107368486B true CN107368486B (en) 2020-06-09

Family

ID=60303437

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610312829.4A Active CN107368486B (en) 2016-05-12 2016-05-12 Service migration method and device

Country Status (1)

Country Link
CN (1) CN107368486B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109284278B (en) * 2018-08-13 2023-10-31 中国平安人寿保险股份有限公司 Calculation logic migration method based on data analysis technology and terminal equipment
CN113051245A (en) * 2019-12-26 2021-06-29 云丁网络技术(北京)有限公司 Method, device and system for migrating data

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102611745A (en) * 2011-12-31 2012-07-25 成都市华为赛门铁克科技有限公司 On-line file moving method, device and system
CN104036029A (en) * 2014-06-27 2014-09-10 深圳市腾讯计算机系统有限公司 Big data consistency comparison method and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030177146A1 (en) * 2002-03-18 2003-09-18 International Business Machines Corporation Method, system, and program product for migrating data from one data base management system to another data base management system
US10102210B2 (en) * 2014-04-18 2018-10-16 Oracle International Corporation Systems and methods for multi-threaded shadow migration

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102611745A (en) * 2011-12-31 2012-07-25 成都市华为赛门铁克科技有限公司 On-line file moving method, device and system
CN104036029A (en) * 2014-06-27 2014-09-10 深圳市腾讯计算机系统有限公司 Big data consistency comparison method and system

Also Published As

Publication number Publication date
CN107368486A (en) 2017-11-21

Similar Documents

Publication Publication Date Title
CN107450979B (en) Block chain consensus method and device
CN108628688B (en) Message processing method, device and equipment
CN111131352B (en) Theme switching method and device
CN111967849A (en) Task processing flow arrangement method and device and electronic equipment
CN109857516B (en) Cluster migration method and device based on container
CN104239156A (en) External service call method and system
CN105094878A (en) System library file integration method and apparatus
CN107368486B (en) Service migration method and device
CN111768303A (en) Transaction processing method, device, equipment and system
CN110782253A (en) Transaction processing method, device and equipment based on block chain
WO2020135129A1 (en) Method and device for loading plug-in of application, and terminal
CN111190692A (en) Monitoring method and system based on Roc processor and readable medium
CN107402749B (en) Method and device for realizing picture loading library
CN107291439B (en) Target incremental data construction method and device
CN113938527B (en) Extension processing method of API gateway, computing device and storage medium
CN114996134A (en) Containerized deployment method, electronic equipment and storage medium
CN114791884A (en) Test environment construction method and device, storage medium and electronic equipment
CN114238934A (en) Equipment information acquisition method, device, equipment and medium
CN113094047B (en) Method and device for processing webpage buttons, storage medium and processor
CN111158940A (en) Method and device for docking and dynamically loading different devices in field of Internet of things
CN111241068B (en) Information processing method, device and equipment and computer readable storage medium
CN110968552B (en) Application information storage method and device
CN109428915B (en) Data acquisition method and device
CN117435269A (en) Interface-based custom query export expansion method, device and medium
CN113821325A (en) Application program calling method, device, equipment and 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
TR01 Transfer of patent right

Effective date of registration: 20201014

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20201014

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Patentee before: Alibaba Group Holding Ltd.

TR01 Transfer of patent right