Online service cluster migration method and device, equipment and storage medium
By migrating the backup cluster first and then the primary cluster, the service interruption problem during the migration of the online service cluster was solved, achieving a highly stable and low-impact migration process.
Patent Information
- Application Number
- CN202310761099.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-26
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2043-06-26
AI Technical Summary
During the migration of online service clusters, existing technologies are prone to causing service interruptions, affecting the stability and reliability of the cluster.
The method adopted is to migrate the standby cluster first and then migrate the primary cluster. The specific steps include: switching all services of the first cluster to the second cluster that is synchronized with it in real time, taking the management node offline and replacing its IP, performing the management node switchover and the data nodes to come back online, ensuring data configuration consistency and service normality, disabling the automatic switchover between primary and standby services, and performing data recovery.
This significantly reduces or avoids the risk of service interruption during online service cluster migration, and improves the stability and reliability of the migration process.
Smart Images

Figure CN116795820B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of big data technology, and in particular to an online service cluster migration method, apparatus, device, and storage medium. Background Art
[0002] Online service clusters built on open source databases can provide uninterrupted (24 / 7) online services, such as online query services, with low latency and millisecond-level response speeds. Sometimes, for various reasons, online service clusters need to be migrated. However, migrations can easily lead to risks such as service interruptions, which can affect the stability and reliability of the online service cluster. Therefore, how to reduce or avoid the risk of service interruptions during migration has become a pressing technical issue. Summary of the Invention
[0003] The purpose of the embodiments of this specification is to provide a method, apparatus, device, and storage medium for migrating an online service cluster to reduce or avoid the risk of service interruption during migration of the online service cluster.
[0004] To achieve the above objectives, on the one hand, an embodiment of this specification provides an online service cluster migration method, including:
[0005] Switch all services of the first cluster to the second cluster synchronized with it in real time; the first cluster is the backup cluster and the second cluster is the active cluster;
[0006] Decommission the original standby management node of the first cluster and replace its IP address with the new standby management node of the first cluster;
[0007] Switching the new standby management node of the first cluster to the new active management node of the first cluster;
[0008] Decommission the original active management node of the first cluster and replace its IP address with the new standby management node of the first cluster after the switchover;
[0009] Bringing all data nodes of the first cluster back online after migration;
[0010] Switching all services of the second cluster to the first cluster;
[0011] Decommission the original standby management node of the second cluster and replace its IP address with the new standby management node of the second cluster;
[0012] Switching the new standby management node of the second cluster to the new active management node of the second cluster;
[0013] Decommission the original active management node of the second cluster and replace its IP address with the new standby management node of the second cluster after the switchover.
[0014] Bring all data nodes of the second cluster back online after the migration.
[0015] In the online service cluster migration method of the embodiment of this specification, before switching all services of the first cluster to the second cluster synchronized with the first cluster in real time, the method further includes:
[0016] Obtaining installation and configuration information of the original master and backup management nodes of the first cluster and the second cluster;
[0017] Generate corresponding installation packages according to the installation and configuration information, and transmit the installation packages to the new primary and backup management nodes of the first cluster and the second cluster respectively;
[0018] A pre-installation script is called according to the installation package to perform pre-installation configuration and system partition mounting on the operating systems of the new primary and backup management nodes of the first cluster and the second cluster.
[0019] The online service cluster migration method of the embodiment of this specification further includes:
[0020] Before taking each original management node offline, check whether the data configuration of the original management node and its corresponding new management node are consistent;
[0021] If they are inconsistent, data configuration synchronization is performed on the two based on the original management node.
[0022] The online service cluster migration method of the embodiment of this specification further includes:
[0023] After each IP replacement, check whether the new management node after the IP replacement is serving normally.
[0024] If the service is not normal, the cluster migration will be interrupted and an error will be thrown.
[0025] The online service cluster migration method of the embodiment of this specification further includes:
[0026] During the migration process, automatic switching of the primary and backup services between the first cluster and the second cluster is disabled.
[0027] The online service cluster migration method of the embodiment of this specification further includes:
[0028] After each data node is brought back online, check whether there is any data loss on the data node.
[0029] If the data node that is brought back online has data loss, the metadata managed by the corresponding management node is used to restore the data.
[0030] In the online service cluster migration method of the embodiment of the present specification, after the original active management node of the first cluster is taken offline and its IP address is replaced with the new standby management node after the switchover of the first cluster, the method further includes: performing an active-standby switchover on the new standby management node and the new active management node of the first cluster to restore the active-standby state before the migration;
[0031] After taking the original active management node of the second cluster offline and replacing its IP with the new standby management node of the second cluster after the switchover, it also includes: performing active-standby switching on the new standby management node and the new active management node of the second cluster to restore to the active-standby state before migration.
[0032] On the other hand, an embodiment of this specification further provides an online service cluster migration device, including:
[0033] A first switching module is configured to switch all services of the first cluster to a second cluster synchronized with the first cluster in real time; the first cluster is a backup cluster, and the second cluster is an active cluster;
[0034] A first replacement module is used to take the original standby management node of the first cluster offline and replace its IP address with a new standby management node of the first cluster;
[0035] A first switching module, configured to switch the new standby management node of the first cluster to a new active management node of the first cluster;
[0036] A second replacement module is used to take the original active management node of the first cluster offline and replace its IP address with the new standby management node after the switchover of the first cluster;
[0037] A first online module, used to bring all data nodes of the first cluster back online after migration;
[0038] A second switching module, configured to switch all services of the second cluster to the first cluster;
[0039] A third replacement module is used to take the original standby management node of the second cluster offline and replace its IP address with a new standby management node of the second cluster;
[0040] A second switching module, configured to switch the new standby management node of the second cluster to a new active management node of the second cluster;
[0041] A fourth replacement module is used to take the original active management node of the second cluster offline and replace its IP address with the new standby management node of the second cluster after the switchover;
[0042] The second online module is used to bring all data nodes of the second cluster back online after migration.
[0043] On the other hand, an embodiment of this specification further provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the computer program executes instructions of the above method when executed by the processor.
[0044] On the other hand, an embodiment of this specification further provides a computer storage medium having a computer program stored thereon, wherein the computer program executes the instructions of the above method when executed by a processor of a computer device.
[0045] It can be seen from the technical solutions provided in the above embodiments of this specification that, in the embodiments of this specification, when migrating an online service cluster, the backup cluster is migrated first and then the active cluster; and when migrating both the backup cluster and the active cluster, the backup management node is migrated first, then the active management node, and finally the data node; this can greatly reduce the impact of the online service cluster migration on the big data online service, thereby greatly reducing or avoiding the risk of service interruption of the online service cluster during migration. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the following briefly introduces the drawings required for the embodiments or the description of the prior art. Obviously, the drawings described below are only some of the embodiments described in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without inventive work. In the drawings:
[0047] Figure 1 A schematic diagram of an application scenario of big data online service cluster migration in some embodiments of this specification is shown;
[0048] Figure 2 A flowchart of a big data online service cluster migration method in some embodiments of this specification is shown;
[0049] Figure 3 A schematic diagram of big data online service cluster migration in some embodiments of this specification is shown;
[0050] Figure 4 It shows a structural block diagram of a big data online service cluster migration device in some embodiments of this specification;
[0051] Figure 5 It shows a structural block diagram of a computer device in some embodiments of this specification.
[0052] [Description of Reference Numerals]
[0053] 10. Big data online service cluster;
[0054] 11. Cluster 1;
[0055] 12. Cluster 2;
[0056] 20. Migrate the control terminal;
[0057] 401, first switching module;
[0058] 402. First replacement module;
[0059] 403, first switching module;
[0060] 404, second replacement module;
[0061] 405, first online module;
[0062] 406, second switching module;
[0063] 407, third replacement module;
[0064] 408, second switching module;
[0065] 409, fourth replacement module;
[0066] 410, second online module;
[0067] 502. Computer equipment;
[0068] 504, processor;
[0069] 506. Memory;
[0070] 508, driving mechanism;
[0071] 510, input / output interface;
[0072] 512. Input devices;
[0073] 514. Output device;
[0074] 516. Presentation equipment;
[0075] 518. Graphical User Interface;
[0076] 520, network interface;
[0077] 522, communication link;
[0078] 524. Communication bus. DETAILED DESCRIPTION
[0079] To help those skilled in the art better understand the technical solutions in this specification, the following will provide a clear and complete description of the technical solutions in the embodiments of this specification, in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. All other embodiments derived by those skilled in the art based on the embodiments in this specification without creative effort shall fall within the scope of protection of this specification.
[0080] Figure 1 FIG2 shows a schematic diagram of an application scenario of a big data online service cluster migration in some embodiments of this specification. The application scenario includes a big data online service cluster 10 and a migration control terminal 20. The big data online service cluster 10 can provide big data online services to the outside world. Figure 1 In the embodiment shown, the big data online service cluster 10 may include a first cluster 11 and a second cluster 12 (a dual cluster is used as an example here; in other embodiments, more clusters may be provided as needed), with the first cluster 11 and the second cluster 12 serving as a primary and a backup (e.g., the first cluster 11 serves as a backup, and the second cluster 12 serves as the primary), and data can be synchronized between the two in real time. The migration control terminal 20 may control and manage the migration process of the big data online service cluster 10 to reduce or avoid the risk of service interruption of the big data online service cluster 10 during migration. It should be noted that migration in the embodiments of this specification generally refers to physical migration across computer rooms.
[0081] In some embodiments of the present specification, the big data online service cluster 10 can be constructed based on an open source database (such as an HBase database, etc.); the first cluster 11 and the second cluster 12 of the big data online service cluster 10 can both include multiple big data online service terminals, and these big data online service terminals can provide big data online services in parallel. Among them, the big data online service terminal can be an electronic device with computing and network interaction functions; it can also be software running in the electronic device to provide business logic for data processing and network interaction. The migration control terminal 20 can be an electronic device with computing and network interaction functions; it can also be software running in the electronic device to provide business logic for data processing and network interaction. In some embodiments of the present specification, the above-mentioned electronic device can be a computer device, such as a desktop computer, a laptop computer, a workstation or a server, etc.
[0082] This specification provides a method for migrating a large data online service cluster, which can be applied to the above-mentioned migration control terminal side. Figure 2 and Figure 3 As shown, in some embodiments, the big data online service cluster migration method may include the following steps:
[0083] Step 201: Switch all services of a first cluster to a second cluster synchronized with the first cluster in real time; the first cluster is a backup cluster, and the second cluster is an active cluster.
[0084] Step 202: The original standby management node of the first cluster is taken offline, and its IP address is replaced with the new standby management node of the first cluster.
[0085] Step 203: Switch the new standby management node of the first cluster to the new active management node of the first cluster.
[0086] Step 204: The original active management node of the first cluster is taken offline, and its IP address is replaced with the new standby management node of the first cluster after the switchover.
[0087] Step 205: Bring all data nodes of the first cluster back online after migration.
[0088] Step 206: Switch all services of the second cluster to the first cluster.
[0089] Step 207: The original standby management node of the second cluster is taken offline, and its IP address is replaced with the new standby management node of the second cluster.
[0090] Step 208: Switch the new standby management node of the second cluster to the new active management node of the second cluster.
[0091] Step 209: The original active management node of the second cluster is taken offline, and its IP address is replaced with the new standby management node of the second cluster after the switchover.
[0092] Step 210: Bring all data nodes of the second cluster back online after migration.
[0093] In the embodiments of the present specification, when migrating a big data online service cluster, the backup cluster is migrated first and then the active cluster; and when migrating both the backup cluster and the active cluster, the backup management node is migrated first, then the active management node, and finally the data node; this can greatly reduce the impact of the big data online service cluster migration on the big data online service, thereby greatly reducing or avoiding the risk of service interruption of the big data online service cluster during migration.
[0094] In the embodiments of this specification, switching refers to the active-standby switching of services between the first cluster and the second cluster; switching refers to the active-standby switching between the primary and standby management nodes; in order to distinguish it from the active-standby switching of services between clusters, it is called switching.
[0095] When the first cluster needs to be migrated, all of its services are switched to the second cluster, which is synchronized with it in real time. This ensures that the big data online service of the entire cluster can continue to function normally. In the embodiments of this specification, the big data online services vary depending on the application scenario. For example, in a bank's big data online service cluster, the big data online services may include query processing services, transaction processing services, and so on.
[0096] In the embodiments of this specification, a primary management node and a backup management node are provided in the first cluster and the second cluster; each primary management node and each backup management node are respectively deployed on two independent physical machine servers, where the primary management node will serve as a management and control service to manage the read and write services of HBase (here taking the cluster built by the HBase database as an example), and the backup management node will serve as a backup service ready to take over the cluster's management and control services at any time; for example, when the primary management node is detected to be down, the backup management node service will directly take over the cluster's management and control services.
[0097] The equipment requirements for cluster migration may include: the new node must be installed with the same version of the operating system as the replaced node, and the network card name, gateway, IP address, host name, time and time zone information configured on the new node must be consistent with the replaced node. Therefore, for each new management node (including the new active management node and the new standby management node), corresponding installation configuration and system partition mounting are required. Therefore, in some embodiments of this specification, before switching the full business of the first cluster to the second cluster synchronized with it in real time, the following steps may also be included:
[0098] (1) Obtain installation and configuration information of the original master and backup management nodes of the first cluster and the second cluster.
[0099] In some embodiments, the software installation management tool can automatically check: the installation and configuration information of the original active management node of the first cluster, the installation and configuration information of the original backup management node of the first cluster, the installation and configuration information of the original active management node of the second cluster, and the installation and configuration information of the original backup management node of the second cluster.
[0100] (2) Generate corresponding installation packages according to the installation and configuration information, and transmit the installation packages to the new primary and backup management nodes of the first cluster and the second cluster respectively.
[0101] In some embodiments, the installation and configuration information of the original active management node of the first cluster, the installation and configuration information of the original backup management node of the first cluster, the installation and configuration information of the original active management node of the second cluster, and the installation and configuration information of the original backup management node of the second cluster can be packaged into corresponding installation packages through a packaging tool, and provided to the new active management node of the first cluster, the new backup management node of the first cluster, the new active management node of the second cluster, and the new backup management node of the second cluster respectively. The installation and configuration information includes information such as which software (including system software and application software) is installed on the management node, the storage path corresponding to the software, and the configuration files corresponding to the software and devices.
[0102] (3) Calling a preinstallation script (preinstall) based on the installation package to preinstall and configure the operating systems of the new primary and backup management nodes of the first and second clusters and to mount the system partitions (i.e., mount the disk partitions of the management nodes). The preinstallation script may also be a functional module of a software installation management tool. Of course, before installation, the new management node may also be automatically logged in. In this way, through this automated installation, configuration, and deployment, the efficiency of cluster migration may be improved.
[0103] In the embodiments of this specification, automatic switching of active and standby services between the first cluster and the second cluster needs to be disabled in a timely manner during the migration process to prevent the node in the migration process from taking over the cluster service, thereby causing service interruption or processing failure.
[0104] Since the pre-installation configuration of the new backup management node of the first cluster has been completed, after the original backup management node of the first cluster is offline, its IP (i.e., network IP address) can be replaced with the new backup management node of the first cluster, thereby ensuring that the IP of the cluster management remains unchanged before and after the replacement. Moreover, during the process of taking the original backup management node of the first cluster offline, since the original active management node of the first cluster is online, it can still be responsible for the management and control services of the first cluster normally. In order to comply with the relevant requirements of having an active management node before a backup management node, the new backup management node of the first cluster can be switched to the new active management node of the first cluster. On this basis, the original active management node of the first cluster is offline again, and its IP is replaced with the new backup management node of the first cluster after the switch (i.e., the new active management node of the first cluster before the switch), thereby ensuring that the IP of the cluster management remains unchanged before and after the replacement. Moreover, during the process of taking the original active management node of the first cluster offline, since the original backup management node of the first cluster has completed the migration and is currently online as the new active management node of the first cluster, it can still be responsible for the management and control services of the first cluster normally. Among them, IP replacement refers to configuring the new management node with the same network IP address information as the original management node. For example, when the original standby management node of the first cluster is offline, the same IP address information as that of the original standby management node of the first cluster may be configured for the new standby management node of the first cluster.
[0105] In other embodiments, based on this, the new active management node and the new standby management node of the first cluster may be switched between active and standby states, so as to restore to the active and standby states before the migration after the migration.
[0106] In an embodiment of the present specification, upon completing the migration of the management node of the first cluster, all data nodes of the first cluster may be taken offline, migrated, and brought back online. This means that all data nodes of the first cluster are brought back online after the migration, thereby completing the migration of the first cluster. Because the management node is responsible for the overall service operation and metadata management of the first cluster, migrating the management node of the first cluster before migrating the data nodes of the first cluster not only helps maintain the operational stability of the cluster but also helps avoid the risk of data corruption or loss during data node migration.
[0107] After the migration of the first cluster is complete, all services of the second cluster can be switched to the first cluster. The second cluster will then be migrated, and the migrated first cluster will be responsible for providing big data online services. Since the migration of the second cluster is similar to the migration of the first cluster, the migration of the second cluster will not be described in detail. For details, please refer to the description of the migration process for the first cluster.
[0108] In other embodiments of the present specification, the big data online service cluster migration method may further include: before decommissioning each original management node, checking whether the data configuration of the original management node and its corresponding new management node are consistent; if inconsistent, performing data configuration synchronization between the two based on the original management node; if consistent, continuing subsequent migration operations. Data configuration consistency refers to consistency in database data and configuration files.
[0109] For example, taking the backup management node of the first cluster as an example, before taking the original backup management node of the first cluster offline, first check whether the data configuration of the original backup management node of the first cluster and the new backup management node of the first cluster are consistent; if they are consistent, the original backup management node of the first cluster can be taken offline, and its IP is replaced with the new backup management node of the first cluster; if they are inconsistent, data synchronization is performed based on the original backup management node of the first cluster, that is, the new backup management node of the first cluster obtains data from the original backup management node of the first cluster to synchronize the data of the two; this can help reduce the risk of data loss or failure to provide services normally after migration.
[0110] In other embodiments of the present specification, the method for migrating a big data online service cluster may further include: after completing each IP replacement, checking whether the new management node after the IP replacement is providing normal service; if the service is not normal, the cluster migration may be interrupted and an error may be thrown (i.e., an error alarm message is sent to relevant personnel to prompt relevant personnel to respond and handle it in a timely manner); if the service is normal, the subsequent migration operation may be continued. In this way, the risk of the cluster not being able to provide normal services after migration can be reduced. Among them, the indicators for judging whether the service is normal may include but are not limited to: the number of transactions processed per second (TPS) and its response time (RT).
[0111] In other embodiments of this specification, the big data online service cluster migration method may further include: after re-bringing each data node online, checking whether the re-bringing data node has data loss; if the re-bringing data node has data loss, recovering the data using metadata managed by the corresponding management node; if no data loss exists, continuing with subsequent migration operations. This further reduces the risk of data loss after migration.
[0112] In the embodiments of this specification, going offline may mean: stopping the node from working (i.e., stopping serving the cluster), disconnecting from the external connection, and turning off its power supply; correspondingly, going online means: turning on the node power supply, establishing an external connection, and starting work (i.e., starting to serve the cluster).
[0113] Although the process flows described above include multiple operations occurring in a particular order, it should be understood that these processes may include more or fewer operations, which may be performed sequentially or in parallel (eg, using parallel processors or a multi-threaded environment).
[0114] Corresponding to the above-mentioned big data online service cluster migration method, the embodiment of this specification also provides a big data online service cluster migration device, which can be configured on the above-mentioned migration control terminal, referring to Figure 4 As shown, in some embodiments, the big data online service cluster migration device may include:
[0115] A first switching module 401 is configured to switch all services of a first cluster to a second cluster synchronized with the first cluster in real time; the first cluster is a backup cluster, and the second cluster is an active cluster;
[0116] A first replacement module 402 is configured to take the original standby management node of the first cluster offline and replace its IP address with a new standby management node of the first cluster;
[0117] A first switching module 403 is configured to switch the new standby management node of the first cluster to the new active management node of the first cluster;
[0118] A second replacement module 404 is configured to take the original active management node of the first cluster offline and replace its IP address with the new standby management node of the first cluster after the switchover;
[0119] A first online module 405 is used to bring all data nodes of the first cluster back online after migration;
[0120] A second switching module 406 is configured to switch all services of the second cluster to the first cluster;
[0121] A third replacement module 407 is configured to take the original standby management node of the second cluster offline and replace its IP address with a new standby management node of the second cluster;
[0122] A second switching module 408 is configured to switch the new standby management node of the second cluster to the new active management node of the second cluster;
[0123] A fourth replacement module 409 is configured to take the original active management node of the second cluster offline and replace its IP address with the new standby management node of the second cluster after the switchover;
[0124] The second online module 410 is used to bring all data nodes of the second cluster back online after migration.
[0125] For the convenience of description, the above devices are described as being divided into various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0126] It should be noted that in the embodiments of this specification, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user and fully authorized by all parties.
[0127] The embodiment of this specification also provides a computer device. Figure 5 As shown, in some embodiments of this specification, the computer device 502 may include one or more processors 504, such as one or more central processing units (CPUs) or graphics processing units (GPUs), each of which may implement one or more hardware threads. The computer device 502 may also include any memory 506 for storing any type of information, such as code, settings, data, etc. In one specific embodiment, the memory 506 may contain a computer program executable on the processor 504. When executed by the processor 504, the computer program may execute instructions of the method for migrating a big data online service cluster described in any of the above embodiments. For example, and without limitation, the memory 506 may include any one or more combinations of the following: any type of RAM, any type of ROM, a flash memory device, a hard disk, an optical disk, etc. More generally, any memory may use any technology to store information. Furthermore, any memory may provide volatile or non-volatile retention of information. Furthermore, any memory may represent a fixed or removable component of the computer device 502. In one embodiment, when the processor 504 executes the associated instructions stored in any memory or combination of memories, the computer device 502 may perform any operation of the associated instructions. The computer device 502 also includes one or more drive mechanisms 508 for interacting with any storage, such as a hard disk drive mechanism, an optical disk drive mechanism, and the like.
[0128] The computer device 502 may also include an input / output interface 510 (I / O) for receiving various inputs (via input devices 512) and for providing various outputs (via output devices 514). A specific output mechanism may include a presentation device 516 and an associated graphical user interface 518 (GUI). In other embodiments, the input / output interface 510 (I / O), input devices 512, and output devices 514 may not be included, and the computer device 502 may simply be a computer device in a network. The computer device 502 may also include one or more network interfaces 520 for exchanging data with other devices via one or more communication links 522. One or more communication buses 524 couple the components described above together.
[0129] The communication link 522 can be implemented in any manner, for example, through a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The communication link 522 can include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc., governed by any protocol or combination of protocols.
[0130] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), computer-readable storage media, and computer program products of some embodiments of the present specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processor to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processor generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0131] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processor to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, the instruction device being implemented in the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0132] These computer program instructions can also be loaded onto a computer or other programmable data processor so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0133] In a typical configuration, a computer device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0134] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0135] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. The information can be computer-readable instructions, data structures, program modules 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 disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computer device. As defined in this specification, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0136] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, the embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0137] Embodiments of this specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. Embodiments of this specification may also be practiced in distributed computing environments where tasks are performed by remote processors connected via a communications network. In distributed computing environments, program modules may be located in local and remote computer storage media, including storage devices.
[0138] It should also be understood that in the embodiments of this specification, the term "and / or" is merely a description of the association relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. Furthermore, the character " / " in this document generally indicates that the associated objects are in an "or" relationship.
[0139] The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.
[0140] In the description of this specification, the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiments of this specification. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.
[0141] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. A method for migrating an online service cluster, characterized in that: include: Switch all services of the first cluster to the second cluster synchronized with it in real time; The first cluster is a standby cluster, and the second cluster is an active cluster; Decommission the original standby management node of the first cluster and replace its IP address with the new standby management node of the first cluster; Switching the new standby management node of the first cluster to the new active management node of the first cluster; Decommission the original active management node of the first cluster and replace its IP address with the new standby management node of the first cluster after the switchover; Bringing all data nodes of the first cluster back online after migration; Switching all services of the second cluster to the first cluster; Decommission the original standby management node of the second cluster and replace its IP address with the new standby management node of the second cluster; Switching the new standby management node of the second cluster to the new active management node of the second cluster; Decommission the original active management node of the second cluster and replace its IP address with the new standby management node of the second cluster after the switchover. Bring all data nodes of the second cluster back online after the migration.
2. The online service cluster migration method according to claim 1, wherein: Before switching all services of the first cluster to the second cluster synchronized with the first cluster in real time, the method further includes: Obtaining installation and configuration information of the original master and backup management nodes of the first cluster and the second cluster; Generate corresponding installation packages according to the installation and configuration information, and transmit the installation packages to the new primary and backup management nodes of the first cluster and the second cluster respectively; A pre-installation script is called according to the installation package to perform pre-installation configuration and system partition mounting on the operating systems of the new primary and backup management nodes of the first cluster and the second cluster.
3. The online service cluster migration method according to claim 1, wherein: Also includes: Before taking each original management node offline, check whether the data configuration of the original management node and its corresponding new management node are consistent; If they are inconsistent, data configuration synchronization is performed on the two based on the original management node.
4. The online service cluster migration method according to claim 1, wherein: Also includes: After each IP replacement, check whether the new management node after the IP replacement is serving normally. If the service is not normal, the cluster migration will be interrupted and an error will be thrown.
5. The online service cluster migration method according to claim 1, wherein: Also includes: During the migration process, automatic switching of the primary and backup services between the first cluster and the second cluster is disabled.
6. The online service cluster migration method according to claim 1, wherein: Also includes: After each data node is brought back online, check whether there is any data loss on the data node. If the data node that is brought back online has data loss, the metadata managed by the corresponding management node is used to restore the data.
7. The online service cluster migration method according to claim 1, wherein: After the original active management node of the first cluster is offline and its IP address is replaced with the new standby management node of the first cluster after the switchover, the method further includes: performing an active-standby switchover on the new standby management node and the new active management node of the first cluster to restore the active-standby state before the migration; After taking the original active management node of the second cluster offline and replacing its IP with the new standby management node of the second cluster after the switchover, it also includes: performing active-standby switching on the new standby management node and the new active management node of the second cluster to restore to the active-standby state before migration.
8. An online service cluster migration device, characterized in that: include: A first switching module is used to switch all services of the first cluster to the second cluster synchronized with it in real time; The first cluster is a standby cluster, and the second cluster is an active cluster; A first replacement module is used to take the original standby management node of the first cluster offline and replace its IP address with a new standby management node of the first cluster; A first switching module, configured to switch the new standby management node of the first cluster to the new active management node of the first cluster; A second replacement module is used to take the original active management node of the first cluster offline and replace its IP address with the new standby management node after the switchover of the first cluster; A first online module, used to bring all data nodes of the first cluster back online after migration; A second switching module, configured to switch all services of the second cluster to the first cluster; A third replacement module is used to take the original standby management node of the second cluster offline and replace its IP address with a new standby management node of the second cluster; A second switching module, configured to switch the new standby management node of the second cluster to the new active management node of the second cluster; A fourth replacement module is used to take the original active management node of the second cluster offline and replace its IP address with the new standby management node of the second cluster after the switchover; The second online module is used to bring all data nodes of the second cluster back online after migration.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory, characterized in that: When the computer program is executed by the processor, the computer program executes the instructions of the method according to any one of claims 1 to 7.
10. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor of a computer device, the computer program executes the instructions of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
File migration method and device and computer readable storage medium
CN107704550A
Cross-region cluster migration method and device based on user page view and electronic equipment
CN112565431A