Cluster migration method, device and storage medium
By sending specific instructions to the user side and server during the cluster migration process, the automated management of cluster permissions is solved, and the problems of complex operation and maintenance, high stability risks and message loss in the existing technology are solved, and the automation and non-perception migration of cluster migration are realized.
Patent Information
- Application Number
- CN202011064011.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-30
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2040-09-30
AI Technical Summary
Existing cluster migration solutions require more manual operation and maintenance operations, which increases stability risks, and obvious business interruptions during low peak periods, and network instability during data synchronization may lead to messages loss.
By sending specific instructions to the user side and server, the automated management of cluster permissions is achieved, ensuring that producers and consumers switch to the new cluster without perception during the migration process, avoiding the stability risks brought by manual operations and reducing the need for data synchronization.
The cluster migration is automated, the cost of manual operation and maintenance is reduced, stability risks are avoided, and the migration process is basically unaware of the business, avoiding message loss.
Smart Images

Figure CN112286904B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of cluster migration, and in particular to a cluster migration method, device and storage medium. Background Art
[0002] The cluster may be migrated due to certain business needs. For example, the cluster that originally used the Alibaba data center now needs to be migrated to the cluster in the Tencent data center. The current solution is to first create a new cluster, then use data synchronization tools such as mirror to synchronize the data in the original cluster to the new cluster, and then cut traffic during off-peak hours. However, the above solution requires more manual operation and maintenance operations, which increases the stability risks that may be caused by manual operations, and users who use the business during off-peak hours will clearly perceive the brief interruption of the business. At the same time, when using mirror to synchronize data, if the network is unstable, messages may be lost. Summary of the invention
[0003] In order to solve the above problems, embodiments of the present application provide a cluster migration method, device and storage medium.
[0004] In a first aspect, an embodiment of the present application provides a cluster migration method, comprising the following steps:
[0005] Sending a first instruction to a user terminal, where the first instruction is used to instruct the user to read messages of a first cluster and a second cluster at the same time; the second cluster is a cluster created based on the first cluster;
[0006] Based on the configuration information of the second cluster, changing the permission of the second cluster from not readable and writable to readable and writable;
[0007] A second instruction is sent to the server, where the second instruction is used to instruct the server to stop writing messages to the first cluster and start writing messages to the second cluster.
[0008] Optionally, after sending a second instruction to the server, wherein the second instruction is used to instruct the server to stop writing messages to the first cluster and start writing messages to the second cluster, the method further includes:
[0009] A second permission modification instruction is sent to the first cluster, where the second permission modification instruction is used to instruct the first cluster to change the permission from readable and writable to read-only.
[0010] Optionally, after sending a second permission modification instruction to the first cluster, wherein the second permission modification instruction is used to instruct the first cluster to change the permission from readable and writable to read-only, the method further includes:
[0011] After the user terminal has read all the messages of the first cluster, a third permission modification instruction is sent to the first cluster, where the third permission modification instruction is used to instruct the first cluster to change the permission from read-only to non-readable and non-writable.
[0012] Optionally, after the user terminal has read all messages of the first cluster, sending a third permission modification instruction to the first cluster, wherein the third permission modification instruction is used to instruct the first cluster to change the permission from read-only to non-readable and non-writable, further includes:
[0013] A third instruction is sent to the user terminal, where the third instruction is used to instruct the user terminal to stop reading messages from the first cluster.
[0014] Optionally, after sending a third instruction to the user terminal, where the third instruction is used to instruct the user terminal to stop reading messages from the first cluster, the method further includes:
[0015] Generate migration completion reminder information, and send the migration completion reminder information to a preset user terminal of the administrator.
[0016] Optionally, after creating the second cluster based on the first cluster and before sending the first instruction to the user terminal, the method further includes:
[0017] Create a second cluster and obtain configuration information of the first cluster;
[0018] The configuration information of the first cluster is created in the second cluster.
[0019] Optionally, the changing the permission of the second cluster from not readable and writable to readable and writable based on the configuration information of the second cluster includes:
[0020] A first permission modification instruction is sent to the second cluster, where the first permission modification instruction is used to instruct the second cluster to change the permission from non-readable and writable to readable and writable.
[0021] In a second aspect, an embodiment of the present application provides a cluster migration device, including:
[0022] A first instruction sending module, configured to send a first instruction to a user terminal after creating a second cluster based on the first cluster, wherein the first instruction is used to instruct the user terminal to read messages of the first cluster and the second cluster at the same time;
[0023] A first permission modification module, configured to change the permission of the second cluster from non-readable and writable to readable and writable based on the configuration information of the second cluster;
[0024] The second instruction sending module is used to send a second instruction to the server, where the second instruction is used to instruct the server to stop writing messages to the first cluster and start writing messages to the second cluster.
[0025] In a third aspect, an embodiment of the present application provides a cluster migration device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above methods when executing the computer program.
[0026] In a fourth aspect, an embodiment of the present application provides a storage medium having a computer program stored thereon, wherein the computer program implements the steps of any of the above methods when executed by a processor.
[0027] In one or more embodiments of the present application, a second cluster is created based on a first cluster, configuration information of the first cluster is obtained, and the configuration information is created in the second cluster; a first instruction is sent to a consumer, wherein the first instruction is used to instruct the consumer to read messages of the first cluster and the second cluster at the same time; based on the configuration information, the permission of the second cluster is changed from non-readable and writable to readable and writable; a second instruction is sent to a producer, wherein the second instruction is used to instruct the producer to stop writing messages to the first cluster and start writing messages to the second cluster; after the producer stops writing messages to the first cluster and starts writing messages to the second cluster, based on the configuration information, the permission of the first cluster is changed from readable and writable to read-only. In the above cluster migration solution, the management platform first creates and configures a second cluster with the same configuration as the first cluster, then allows consumers to subscribe to the first cluster and the second cluster at the same time, and changes the permissions of the second cluster to read and write, so that consumers can read messages from the second cluster in addition to the first cluster. After the producer changes from the first cluster to writing messages to the second cluster, the permissions of the first cluster are changed to read-only. This realizes configuration automation, greatly reduces the cost of manual operation and maintenance, and avoids the stability risks that may be caused by manual operations. In addition, the message migration process is basically unaware of the business, and there is no need to synchronize data. There will be no loss of messages due to data migration from the original cluster to the target cluster. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0029] Figure 1 A schematic diagram of the architecture of a cluster migration system provided in an embodiment of the present application;
[0030] Figure 2 A schematic diagram of a cluster migration method provided in an embodiment of the present application;
[0031] Figure 3 A flowchart of another cluster migration method provided in an embodiment of the present application;
[0032] Figure 4 A schematic diagram of the structure of a cluster migration device provided in an embodiment of the present application;
[0033] Figure 5 A schematic diagram of the structure of a cluster migration device involved in an embodiment of the present application. DETAILED DESCRIPTION
[0034] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0035] In the following introduction, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance. The following introduction provides multiple embodiments of the present application, and different embodiments can be replaced or combined, so the present application can also be considered to include all possible combinations of the same and / or different embodiments recorded. Therefore, if one embodiment includes features A, B, and C, and another embodiment includes features B and D, then the present application should also be considered to include embodiments containing one or more of all other possible combinations of A, B, C, and D, although the embodiment may not be clearly recorded in the following text.
[0036] The following description provides examples and does not limit the scope, applicability or examples set forth in the claims. Changes may be made to the functions and arrangements of the elements described without departing from the scope of the present application. Various processes or components may be appropriately omitted, substituted or added to each example. For example, the described method may be performed in an order different from the order described, and various steps may be added, omitted or combined. In addition, features described in some examples may be combined in other examples.
[0037] It should be noted that Kafka is a message system based on publishing and subscription. It is generally referred to as a "distributed commit log" or a "distributed streaming platform". Its characteristic is that it can provide high throughput for both distribution and subscription. Kafka can produce about 250,000 messages (50MB) per second and process 550,000 messages (110MB) per second. Kafka generally consists of three parts: a Kafka producer (producer, i.e., the generator of messages), a Kafka cluster, and a Kafka consumer (consumer, i.e., the consumer of messages). The Kafka producer is responsible for writing messages to the Kafka cluster. The Kafka cluster contains one or more brokers (i.e., cache agents, one or more servers in the Kafka cluster are collectively referred to as borkers). The Kafka consumer is responsible for reading the messages written in the Kafka cluster and consuming the messages. The embodiment of the present application will be explained using Kafka as an example.
[0038] See also Figure 1 , Figure 1 It is a schematic diagram of the architecture of a cluster migration system provided in an embodiment of the present application.
[0039] like Figure 1 As shown, the cluster migration system may include a management platform 101 , a producer 102 , a consumer 103 , a first cluster 104 , and a second cluster 105 .
[0040] A cluster may have multiple servers, and a server may be considered as a broker, that is, the first cluster 104 and the second cluster 105 may be server groups integrating multiple servers. The topic-related configuration and permissions of the cluster can only be changed after receiving instructions sent by the management platform 101.
[0041] Producer 102 is a message producer, a client that sends messages to brokers in the cluster, and can be a server equipped with a producer client. Producer 102 can send messages to the associated cluster, but producer 102 can only change its associated objects after receiving instructions from management platform 101.
[0042] Consumer 103 is a message consumer, a client that gets messages from the broker in the cluster, and can be a user terminal equipped with a consumer client. Consumer 103 can receive messages from the subscribed cluster, but consumer 103 can only change its subscribed object after receiving an instruction sent by the management platform 101.
[0043] For example, when a teacher wants to send red envelopes to students in a class group, the terminal used by the teacher to send the red envelopes is producer 102, and the red envelope message is sent to the corresponding cluster with a red envelope theme. The terminal used by the students to receive the red envelopes is consumer 103. Consumer 103 can obtain the red envelope message sent by the teacher from the cluster with a red envelope theme and complete the collection of the red envelope.
[0044] The management platform 101 is a management system responsible for the entire cluster migration workflow. It can send instructions to the producer 102, the consumer 103, the first cluster 104 and the second cluster 105 respectively through the communication link, so as to implement functions such as changes to the message object sent by the producer 102, the message object subscribed by the consumer 103, and the modification of topic permissions in the cluster. The management platform 101 can specifically be a server equipped with management system software.
[0045] It should be noted that the producer 102 and the consumer 103 may be provided with one or more. Figure 1 The number of producers 102 and consumers 103 in the cluster migration system shown is only an example. In a specific implementation, the cluster migration system may include any number of producers 102 and consumers 103, and this application does not limit this.
[0046] See also Figure 2 , Figure 2 : is a flow chart of a cluster migration method provided in an embodiment of the present application. In the embodiment of the present application, the method includes:
[0047] S201. Send a first instruction to a user terminal, where the first instruction is used to instruct the user to read messages of a first cluster and a second cluster at the same time, where the second cluster is a cluster created based on the first cluster.
[0048] In the embodiment of the present application, after the second cluster is created and configured, it is not associated with any producer or consumer at this moment, that is, no producer writes messages to the second cluster, and no consumer reads and writes messages to the second cluster. The management platform will send a first instruction to the consumer, and after receiving the first instruction, the consumer will subscribe to the second cluster. Since the consumer has previously subscribed to the first cluster, the consumer can subscribe to messages of the first cluster and the second cluster at the same time after receiving the first instruction.
[0049] S202: Based on the configuration information of the second cluster, change the permission of the second cluster from non-readable and non-writable to readable and writable.
[0050] In the embodiment of the present application, the topic permission of the second cluster previously created by the management platform is in a non-readable and non-writable state in the initial state. Under this permission, even if the consumer subscribes to the second cluster, the consumer cannot read the messages in the second cluster. Therefore, the management platform will change the topic permission of the second cluster from non-readable and non-writable to readable and writable based on the topic configuration information configured by the second cluster.
[0051] In one possible implementation, step S202 specifically includes:
[0052] A first permission modification instruction is sent to the second cluster, where the first permission modification instruction is used to instruct the second cluster to change the permission from non-readable and writable to readable and writable.
[0053] In an embodiment of the present application, the management platform will send a first permission modification instruction to the second cluster. After receiving the first permission modification instruction, the second cluster will change its topic permission from an initial non-readable and non-writable state to a readable and writable state, so that the second cluster can be written by producers and read by consumers.
[0054] S203: Send a second instruction to the server, where the second instruction is used to instruct the server to stop writing messages to the first cluster and start writing messages to the second cluster.
[0055] In an embodiment of the present application, in order to migrate the cluster, under the premise that the above steps ensure that the topic configuration of the second cluster is the same as the topic configuration of the first cluster, the consumer has subscribed to the second cluster, and the second cluster is in a readable and writable state, the management platform will send a second instruction to the producer. After receiving the second instruction, the producer will stop writing messages to the first cluster and start writing messages to the second cluster, thereby realizing the transformation of the producer's message writing object.
[0056] In one possible implementation, after step S203, the method further includes:
[0057] After the producer stops writing messages to the first cluster and starts writing messages to the second cluster, the permission of the first cluster is changed from readable and writable to read-only based on the configuration information.
[0058] In an embodiment of the present application, when the producer's message writing object is changed to the second cluster, no new messages will be written to the first cluster. At this time, the management platform will change the topic permission of the first cluster from readable and writable to read-only, so that the first cluster can only allow consumers to continue to read unread messages in the first cluster.
[0059] Through the above process, the new messages generated by the producer will be written to the second cluster and then continued to be read by the consumer, completing the cluster migration. The remaining messages in the first cluster that have not been read will still be read by the consumer. The messages in the first cluster will not be lost due to the migration of the first cluster to the second cluster, realizing configuration automation and avoiding the stability risks that may be caused by manual operation and maintenance.
[0060] See also Figure 3 , Figure 3 is a flow chart of another cluster migration method provided in an embodiment of the present application, such as Figure 3 As shown, in the embodiment of the present application, the method may further include:
[0061] S301: Create a second cluster, obtain configuration information of the first cluster, and create the configuration information of the first cluster in the second cluster.
[0062] In an embodiment of the present application, when cluster migration is required, the management platform will create a second cluster based on the original cluster, i.e., the first cluster, and the number of brokers in the created second cluster is the same as the number of brokers in the first cluster. The created second cluster is not configured in its initial state. The management platform will obtain the topic configuration information of the first cluster and create topic configuration information in the second cluster that is exactly the same as the content of the topic configuration information. Topic is a different classification of the message source of the processing resource, which can be understood as a subject. Each producer can publish some messages to a topic. The second cluster can only write messages of the same category as those in the first cluster after creating the same topic configuration as the first cluster.
[0063] S302: Send a first instruction to a user terminal, where the first instruction is used to instruct the user to read messages of the first cluster and the second cluster at the same time.
[0064] The specific process is shown in step S201 and will not be repeated here.
[0065] S303: Based on the configuration information of the second cluster, change the permission of the second cluster from non-readable and non-writable to readable and writable.
[0066] The specific process is shown in step S202 and will not be repeated here.
[0067] S304: Send a second instruction to the server, where the second instruction is used to instruct the server to stop writing messages to the first cluster and start writing messages to the second cluster.
[0068] The specific process is shown in step S203 and will not be repeated here.
[0069] S305: Send a second permission modification instruction to the first cluster, where the second permission modification instruction is used to instruct the first cluster to change the permission from readable and writable to read-only.
[0070] In an embodiment of the present application, when the producer's message writing object is changed to the second cluster, no new messages will be written to the first cluster. At this time, the management platform will change the topic permission of the first cluster from readable and writable to read-only, so that the first cluster can only allow consumers to continue to read unread messages in the first cluster.
[0071] S306: After the user terminal has read all messages of the first cluster, the user terminal sends a third permission modification instruction to the first cluster, where the third permission modification instruction is used to instruct the first cluster to change the permission from read-only to non-readable and non-writable.
[0072] In the embodiment of the present application, since the consumer subscribes to the first cluster and the second cluster at the same time, the consumer reads the remaining unread messages in the first cluster while reading new messages from the second cluster. When the consumer has read all the messages in the first cluster, since no more messages will be written to the first cluster, that is, there will be no new messages in the first cluster that need to be read by the consumer, the management platform will change the topic permissions of the first cluster from read-only to non-readable and non-writable. The specific way for the management platform to modify the topic permissions of the first cluster is that the management platform sends a third permission modification instruction to the first cluster, and the first cluster will change its topic permissions to non-readable and non-writable after receiving the third permission modification instruction.
[0073] S307: Send a third instruction to the user terminal, where the third instruction is used to instruct the user terminal to stop reading messages from the first cluster.
[0074] In the embodiment of the present application, after the topic permission of the first cluster is modified to be non-readable and non-writable, since the first cluster cannot be read and written and there is no new message that needs to be read in the first cluster, the consumer does not need to subscribe to the first cluster. The management platform will send a third instruction to the consumer, and after receiving the third instruction, the consumer will stop reading messages from the first cluster.
[0075] S308: Generate migration completion reminder information, and send the migration completion reminder information to a preset user terminal of the administrator.
[0076] In the embodiment of the present application, since cluster migration is configured automatically through the communication between the management platform and the first cluster, the second cluster, the producer, and the consumer respectively, the management platform will generate a migration completion reminder message after the cluster migration is completed. The management platform can manually store in advance the user terminal ID corresponding to the manager who needs to send the migration completion reminder message after the migration is completed. When the migration completion reminder message is to be sent, the management platform can directly obtain the user terminal ID and send the migration completion reminder message to the user terminal corresponding to the user terminal ID. The migration completion reminder message can be a piece of text, voice or picture, for example, it can be a text message containing the words "The cluster has completed migration".
[0077] Through the above process, after all the remaining messages in the first cluster are read, the permissions of the first cluster are modified and the association between the first cluster and the consumer is disconnected, so that the first cluster is separated from the entire after migration, which is convenient for the management personnel to perform subsequent maintenance and other work on the first cluster.
[0078] The following will be combined with the attached Figure 4 , the cluster migration device provided in the embodiment of the present application is introduced in detail. It should be noted that the attached Figure 4 The cluster migration device shown is used to execute the application Figure 2-Figure 3 For the convenience of explanation, only the part related to the embodiment of the present application is shown. For the specific technical details not disclosed, please refer to the present application. Figure 2-Figure 3 The embodiment shown.
[0079] See also Figure 4 , Figure 4 is a schematic diagram of the structure of a cluster migration device provided in an embodiment of the present application, such as Figure 4 As shown, the cluster migration device includes:
[0080] A first sending module 401 is used to send a first instruction to a user terminal, where the first instruction is used to instruct the user to read messages of a first cluster and a second cluster at the same time; the second cluster is a cluster created based on the first cluster;
[0081] A first permission changing module 402, configured to change the permission of the second cluster from non-readable and writable to readable and writable based on the configuration information of the second cluster;
[0082] The second sending module 403 is used to send a second instruction to the server, where the second instruction is used to instruct the server to stop writing messages to the first cluster and start writing messages to the second cluster.
[0083] In one possible implementation, the first permission changing module 402 is specifically used for:
[0084] A first permission modification instruction is sent to the second cluster, where the first permission modification instruction is used to instruct the second cluster to change the permission from non-readable and writable to readable and writable.
[0085] In one possible implementation, the device further comprises:
[0086] The second permission changing module is used to send a second permission changing instruction to the first cluster, where the second permission changing instruction is used to instruct the first cluster to change the permission from readable and writable to read-only.
[0087] In one possible implementation, the second permission changing module includes:
[0088] The sending unit is used to send a third permission modification instruction to the first cluster after the user terminal has read all the messages of the first cluster, wherein the third permission modification instruction is used to instruct the first cluster to change the permission from read-only to non-readable and non-writable.
[0089] In one possible implementation, the sending unit includes:
[0090] The sending component is used to send a third instruction to the user terminal, where the third instruction is used to instruct the user terminal to stop reading messages from the first cluster.
[0091] In one possible implementation, the sending element is specifically used for:
[0092] Generate migration completion reminder information, and send the migration completion reminder information to a preset user terminal of the administrator.
[0093] In one possible implementation, the device further comprises:
[0094] A creation module, used to create a second cluster and obtain configuration information of the first cluster;
[0095] A configuration module is used to create the configuration information of the first cluster in the second cluster.
[0096] Those skilled in the art can clearly understand that the technical solutions of the embodiments of the present application can be implemented with the help of software and / or hardware. The "unit" and "module" in this specification refer to software and / or hardware that can independently complete or cooperate with other components to complete specific functions, where the hardware can be, for example, a field programmable gate array (Field-Programmable Gate Array, FPGA), an integrated circuit (Integrated Circuit, IC), etc.
[0097] Each processing unit and / or module of the embodiments of the present application may be implemented by an analog circuit that implements the functions described in the embodiments of the present application, or may be implemented by software that executes the functions described in the embodiments of the present application.
[0098] See also Figure 5 , which shows a schematic diagram of the structure of a cluster migration device involved in an embodiment of the present application, and the cluster migration device can be used to implement the cluster migration method in the above embodiment. Figure 5 As shown, the cluster migration device 500 may include: at least one central processor 501 , at least one network interface 504 , a user interface 503 , a memory 505 , and at least one communication bus 502 .
[0099] The communication bus 502 is used to realize the connection and communication between these components.
[0100] The user interface 503 may include a display screen (Display) and a camera (Camera), and the optional user interface 503 may also include a standard wired interface and a wireless interface.
[0101] The network interface 504 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0102] Among them, the central processing unit 501 may include one or more processing cores. The central processing unit 501 uses various interfaces and lines to connect various parts in the entire terminal 500, and executes various functions and processes data of the terminal 500 by running or executing instructions, programs, code sets or instruction sets stored in the memory 505, and calling data stored in the memory 505. Optionally, the central processing unit 501 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The central processing unit 501 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the central processing unit 501, and can be implemented separately through a chip.
[0103] Among them, the memory 505 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 505 includes a non-transitory computer-readable storage medium. The memory 505 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 505 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory 505 may optionally be at least one storage device located away from the aforementioned central processor 501. As Figure 5 As shown, the memory 505 as a computer storage medium may include an operating system, a network communication module, a user interface module, and program instructions.
[0104] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the above method are implemented. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a micro drive, and a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), or any type of medium or device suitable for storing instructions and / or data.
[0105] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0106] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0107] In the several embodiments provided in the present application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0108] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0109] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0110] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk and other media that can store program code.
[0111] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by entering a program to instruct the relevant hardware. The program may be stored in a computer-readable memory, and the memory may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0112] The above is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure cannot be limited thereto. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the specification and practicing the disclosure here, those skilled in the art will easily think of the implementation scheme of the present disclosure. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field not recorded in the present disclosure. The description and examples are regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.
Claims
1. A cluster migration method, characterized in that: include: Create a second cluster and obtain configuration information of the first cluster; wherein the permissions of the second cluster are in a non-readable and non-writable state; the number of cache proxies in the second cluster is the same as the number of cache proxies in the first cluster; the configuration information includes topic configuration information; Creating the configuration information of the first cluster in the second cluster so that the second cluster can write messages of the same category as those in the first cluster; Sending a first instruction to a user terminal, where the first instruction is used to instruct the user terminal to read messages of the first cluster and the second cluster at the same time; the second cluster is a cluster created based on the first cluster; Sending a first permission modification instruction to the second cluster, wherein the first permission modification instruction is used to instruct the permission of the second cluster to be changed from the non-readable and writable to the readable and writable; based on the configuration information of the second cluster, changing the permission of the second cluster from the non-readable and writable to the readable and writable; After the permission of the second cluster is changed to the read-write permission, a second instruction is sent to the server, wherein the second instruction is used to instruct the server to stop writing messages to the first cluster and start writing messages to the second cluster; wherein the remaining messages in the first cluster that have not been read can continue to be read by the user end; After the user terminal has finished reading all messages of the first cluster, a third instruction is sent to the user terminal, where the third instruction is used to instruct the user terminal to stop reading messages from the first cluster.
2. The method according to claim 1, characterized in that After sending a second instruction to the server, wherein the second instruction is used to instruct the server to stop writing messages to the first cluster and start writing messages to the second cluster, the method further includes: A second permission modification instruction is sent to the first cluster, where the second permission modification instruction is used to instruct the first cluster to change the permission from readable and writable to read-only.
3. The method according to claim 2, characterized in that After the user terminal has read all the messages of the first cluster, before sending the third instruction to the user terminal, the method further includes: A third permission modification instruction is sent to the first cluster, where the third permission modification instruction is used to instruct the first cluster to change the permission from read-only to non-readable and non-writable.
4. The method according to claim 1, characterized in that: After sending a third instruction to the user terminal, where the third instruction is used to instruct the user terminal to stop reading messages from the first cluster, the method further includes: Generate migration completion reminder information, and send the migration completion reminder information to a preset user terminal of the administrator.
5. A cluster migration device, characterized in that: include: A creation module, used to create a second cluster and obtain configuration information of the first cluster; wherein the permission of the second cluster is in a non-readable and non-writable state; the number of cache proxies in the second cluster is the same as the number of cache proxies in the first cluster; the configuration information includes topic configuration information; a configuration module, configured to create the configuration information of the first cluster in the second cluster, so that the second cluster can write messages of the same category as those in the first cluster; A first instruction sending module, configured to send a first instruction to a user terminal after creating the second cluster based on the first cluster, wherein the first instruction is used to instruct the user terminal to read messages of the first cluster and the second cluster at the same time; A first permission modification module, configured to change the permission of the second cluster from non-readable and writable to readable and writable based on the configuration information of the second cluster; A second instruction sending module, configured to send a second instruction to the server after the permission of the second cluster is changed to read-write, wherein the second instruction is used to instruct the server to stop writing messages to the first cluster and start writing messages to the second cluster; wherein the remaining messages in the first cluster that have not been read can be continuously read by the user end; The third instruction sending module is used to send a third instruction to the user terminal after the user terminal has read all the messages of the first cluster, and the third instruction is used to instruct the user terminal to stop reading messages from the first cluster.
6. A cluster migration device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Method, apparatus and system for migrating data of physical machine to cloud end
CN106997306A
Data migration method, system and device
CN111078127A
Distributed message system
CN111224819A