CN110807018A - Method, device, equipment and storage medium for migrating master-slave architecture of business data to cluster architecture - Google Patents

Method, device, equipment and storage medium for migrating master-slave architecture of business data to cluster architecture Download PDF

Info

Publication number
CN110807018A
CN110807018A CN201910992754.2A CN201910992754A CN110807018A CN 110807018 A CN110807018 A CN 110807018A CN 201910992754 A CN201910992754 A CN 201910992754A CN 110807018 A CN110807018 A CN 110807018A
Authority
CN
China
Prior art keywords
machine room
cluster
configuration
master
old
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN201910992754.2A
Other languages
Chinese (zh)
Inventor
武林志
吴峰
郭伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Yidianshikong Network Co Ltd
Original Assignee
Shanghai Yidianshikong Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Yidianshikong Network Co Ltd filed Critical Shanghai Yidianshikong Network Co Ltd
Priority to CN201910992754.2A priority Critical patent/CN110807018A/en
Publication of CN110807018A publication Critical patent/CN110807018A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/214Database migration support
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a method, a device, equipment and a storage medium for migrating a master-slave architecture of business data to a cluster architecture. After intranet communication is kept between a new machine room and an old machine room, cluster configuration and authentication configuration are added after configuration of a master library is modified on a service master-slave framework of the old machine room; adding a database instance in the new machine room, and keeping the cluster configuration and the authentication configuration of the configuration item consistent with the old machine room main library; after the master library of the old machine room is restarted, logging in the master library of the old machine room to initialize the cluster, and simultaneously adding a newly added database instance of the new machine room into the cluster; and after the service data of the new machine room and the old machine room are synchronized, the cluster service data are migrated. The method and the device solve the technical problems that cross-machine room service data migration is not achieved and a data architecture solution is not modified. By the method and the device, data can be migrated to a new machine room without loss, and influence on business is minimized.

Description

Method, device, equipment and storage medium for migrating master-slave architecture of business data to cluster architecture
Technical Field
The present application relates to the field of communications, and in particular, to a method, an apparatus, a device, and a storage medium for migrating a master-slave architecture of service data to a cluster architecture.
Background
Due to the business needs, business data needs to be migrated from the old machine room to the new machine room.
The disadvantages are that: most of the migration adopts a mode of stopping machine and guiding data and cannot automatically execute the migration across the machine room and synchronously modify the data architecture.
Aiming at the problem that cross-machine room service data migration and data architecture modification solutions are not realized in the related technology, an effective solution is not provided at present.
Disclosure of Invention
The present application mainly aims to provide a method, an apparatus, a device, and a storage medium for migrating a master-slave architecture of service data to a cluster architecture, so as to solve the problem that a solution for migrating cross-machine-room service data and modifying a data architecture is not implemented.
To achieve the above object, according to one aspect of the present application, a method for migration of a master-slave architecture of traffic data to a cluster architecture is provided.
The method for migrating the master-slave architecture of the business data to the cluster architecture comprises the following steps: after intranet communication is kept between a new machine room and an old machine room, the configuration of a master library is modified on a service master-slave framework of the old machine room, and then cluster configuration and authentication configuration are added; adding a database instance in the new machine room, and keeping the cluster configuration and the authentication configuration of the configuration item consistent with the old machine room main library; after the master library of the old machine room is restarted, logging in the master library of the old machine room to initialize the cluster, and simultaneously adding a newly added database instance of the new machine room into the cluster; and after the service data of the new machine room and the old machine room are synchronized, the cluster service data are migrated.
Further, adding a new database instance in the new machine room, and keeping the cluster configuration and the authentication configuration of the configuration item consistent with the old machine room master library comprises:
and adding at least two servers in the new machine room for configuring database instances for distributed file storage, wherein the cluster name parameter configuration and the authentication KEY configuration of the configuration items are consistent with those of the old machine room master library.
Further, logging in the old machine room master library initialization cluster after restarting the old machine room master library, and adding the newly added database instance of the new machine room into the cluster includes:
and after the master library of the old machine room is restarted in a preset time period, logging in the master library of the database stored by the distributed files of the old machine room to carry out cluster initialization, and simultaneously, after the master library of the old machine room is restarted in a preset time period, adding the newly added database instance stored by the distributed files of the new machine room into a cluster.
Further, after the intranet communication is maintained between the new machine room and the old machine room, adding cluster configuration and authentication configuration after modifying the configuration of the master library on the service master-slave architecture of the old machine room includes:
after intranet communication is kept between the new machine room and the old machine room, cluster configuration and KEY authentication configuration for annotating master-slave configuration parameters are added after configuration modification of the master library is carried out based on the master-slave framework of the old machine room, and the master library of the old machine room is not restarted.
To achieve the above object, according to another aspect of the present application, there is provided an apparatus for migrating a master-slave architecture of traffic data to a cluster architecture.
The device for migrating the master-slave architecture of the business data to the cluster architecture comprises the following steps: the method comprises the following steps: the configuration modification module is used for modifying the configuration of the master library on a service master-slave framework of an old machine room and then adding cluster configuration and authentication configuration after intranet communication is kept between a new machine room and the old machine room; an instance adding module, configured to add a database instance in the new machine room, and the cluster configuration and the authentication configuration of the configuration item are consistent with the old machine room master library; the restarting module is used for logging in the old machine room master library initialization cluster after restarting the old machine room master library and adding a newly added database instance of the new machine room into the cluster; and the migration module is used for completing the migration of the cluster service data after the service data of the new machine room and the old machine room are synchronized.
Further, the instance adding module is used for
And adding at least two servers in the new machine room for configuring database instances for distributed file storage, wherein the cluster name parameter configuration and the authentication KEY configuration of the configuration items are consistent with those of the old machine room master library.
Further, the restart module is used for
And after the master library of the old machine room is restarted in a preset time period, logging in the master library of the database stored by the distributed files of the old machine room to carry out cluster initialization, and simultaneously, after the master library of the old machine room is restarted in a preset time period, adding the newly added database instance stored by the distributed files of the new machine room into a cluster.
Further, the configuration modification module is used for
After intranet communication is kept between the new machine room and the old machine room, cluster configuration and KEY authentication configuration for annotating master-slave configuration parameters are added after configuration modification of the master library is carried out based on the master-slave framework of the old machine room, and the master library of the old machine room is not restarted.
In order to achieve the above object, according to another aspect of the present application, there is provided an electronic device including a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the method for migrating a master-slave architecture of business data to a cluster architecture.
To achieve the above object, according to yet another aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps of the method for migrating a master-slave architecture of traffic data to a cluster architecture.
In the method, the device, the equipment and the storage medium for migrating the master-slave architecture of the service data to the cluster architecture in the embodiment of the application, after intranet communication is kept between a new machine room and an old machine room, the configuration of a master library is modified on the master-slave architecture of the service of the old machine room, then cluster configuration and authentication configuration are added, a database instance is newly added in the new machine room, the cluster configuration and the authentication configuration of a configuration item are kept consistent with the master library of the old machine room, the master library of the old machine room is restarted and then the master library of the old machine room is logged in to initialize a cluster, and meanwhile, the newly added database instance of the new machine room is added into the cluster, so that the aim of completing migration of cluster service data after the service data of the new machine room and the old machine room are synchronized is achieved, and the technical effect of migrating the mongodb service architecture of the old machine room to the cluster architecture of the new machine room is realized, and further, the technical problems that cross-machine room service data migration is not achieved and a data architecture solution is not modified are solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, serve to provide a further understanding of the application and to enable other features, objects, and advantages of the application to be more apparent. The drawings and their description illustrate the embodiments of the invention and do not limit it. In the drawings:
fig. 1 is a flowchart illustrating a method for migrating a master-slave architecture of business data to a cluster architecture according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of an apparatus for migrating a master-slave architecture of business data to a cluster architecture according to an embodiment of the present application;
FIG. 3 is a schematic diagram of an apparatus according to an embodiment of the present application;
FIG. 4 is a schematic diagram of an operating principle according to an embodiment of the present application;
fig. 5 is a schematic flow chart of a modified logic architecture according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be used. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In this application, the terms "upper", "lower", "left", "right", "front", "rear", "top", "bottom", "inner", "outer", "middle", "vertical", "horizontal", "lateral", "longitudinal", and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings. These terms are used primarily to better describe the present application and its embodiments, and are not used to limit the indicated devices, elements or components to a particular orientation or to be constructed and operated in a particular orientation.
Moreover, some of the above terms may be used to indicate other meanings besides the orientation or positional relationship, for example, the term "on" may also be used to indicate some kind of attachment or connection relationship in some cases. The specific meaning of these terms in this application will be understood by those of ordinary skill in the art as appropriate.
Furthermore, the terms "mounted," "disposed," "provided," "connected," and "sleeved" are to be construed broadly. For example, it may be a fixed connection, a removable connection, or a unitary construction; can be a mechanical connection, or an electrical connection; may be directly connected, or indirectly connected through intervening media, or may be in internal communication between two devices, elements or components. The specific meaning of the above terms in the present application can be understood by those of ordinary skill in the art as appropriate.
Technical terms in the present application are explained as follows:
mongodb, a database based on distributed file storage. Written in the C + + language. It is intended to provide an extensible high performance data storage solution for WEB applications.
relpSet, is the cluster name parameter.
Keyfile, an authenticated key, is configured to allow only clustered machines configured with the same key to connect in.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
As shown in fig. 1, the method includes steps S101 to S104 as follows:
step S101, after intranet communication is kept between a new machine room and an old machine room, cluster configuration and authentication configuration are added after configuration of a master library is modified on a service master-slave framework of the old machine room;
specifically, new and old machine rooms need to be communicated through optical fibers, and intranet communication is well performed. And after the intranet communication is kept between the new machine room and the old machine room, modifying the configuration of a master library on a service master-slave framework of the old machine room, and then adding cluster configuration and authentication configuration.
Alternatively, the mongodb master library configuration may be modified and the corresponding configuration added.
Specifically, the cluster configuration replSet and the keyfile authentication configuration are added, the original master-slave configuration parameters are annotated, and the Mongdb master library is saved and quitted but not restarted.
Step S102, adding a database instance in the new machine room, and keeping the cluster configuration and the authentication configuration of the configuration item consistent with the old machine room master library;
by adding a new database instance in the new machine room, the cluster configuration and the authentication configuration of the configuration item in the new machine room are kept consistent with those in the old machine room host library.
Specifically, 2 or 3 mongodb instances can be configured in the new machine room, and the replSet and keyfile of the configuration items need to be consistent with the old machine room master library, and are configured and started.
Step S103, after the master library of the old machine room is restarted, logging in the master library of the old machine room to initialize a cluster, and simultaneously adding a newly added database instance of the new machine room into the cluster;
and after the master library of the old machine room is restarted, automatically logging in the original cluster of the master library of the old machine room by a program, and adding the newly added database instance of the new machine room into the cluster while initializing the cluster.
And step S104, after the service data of the new machine room and the old machine room are synchronized, the cluster service data are migrated.
And after the service data of the new machine room and the old machine room are synchronized, the data migration is considered to be completed.
Specifically, after the data is synchronized through the optical fibers crossing the machine rooms, the master library of the old machine room is shut down, and at the moment, the service is not influenced. After the machine halt is successful, the main library of the cluster can be automatically switched to a new machine room, and the machine room is also migrated.
From the above description, it can be seen that the following technical effects are achieved by the present application:
in the embodiment of the application, after intranet communication is kept between a new machine room and an old machine room, cluster configuration and authentication configuration are added after the configuration of a master library is modified on a service master-slave framework of the old machine room, and by adding a database instance in the new machine room, and the cluster configuration and the authentication configuration of the configuration item are consistent with the old machine room master library, the old machine room master library is logged in to initialize the cluster after the master library of the old machine room is restarted, meanwhile, the newly added database instance of the new machine room is added into the cluster, so that the aim of completing the migration of the cluster service data after the service data of the new machine room and the old machine room are synchronized is fulfilled, thereby realizing the technical effect of transferring the mongodb service master-slave architecture of the old machine room to the cluster architecture of the new machine room, and further, the technical problems that cross-machine room service data migration is not achieved and a data architecture solution is not modified are solved.
According to the embodiment of the present application, as an optimal preference in the embodiment, adding a new database instance in the new machine room, and keeping the cluster configuration and the authentication configuration of the configuration item consistent with the old machine room master library includes: and adding at least two servers in the new machine room for configuring database instances for distributed file storage, wherein the cluster name parameter configuration and the authentication KEY configuration of the configuration items are consistent with those of the old machine room master library.
Specifically, the new machine room is configured with 2 or 3 mongodb instances, and the replSet and keyfile of the configuration items need to be consistent with the old machine room master library, and the new machine room is configured and started.
Due to the fact that the mongodb data structure is migrated to a high-availability clustering mode, and the authentication mechanism of keyfile is added, data and architecture are safer and higher in availability.
According to the embodiment of the present application, as an optimization in the embodiment, logging in the old machine room master library initialization cluster after restarting the old machine room master library, and adding the newly added database instance of the new machine room into the cluster includes: and after the master library of the old machine room is restarted in a preset time period, logging in the master library of the database stored by the distributed files of the old machine room to carry out cluster initialization, and simultaneously, after the master library of the old machine room is restarted in a preset time period, adding the newly added database instance stored by the distributed files of the new machine room into a cluster.
Specifically, the old machine room master library is informed of the service in advance, and selects a low peak period to restart the old machine room for a short time, the service configuration is changed into a cluster configuration mode, and 2 instances of the new machine room are added. Logging in the mongdb master library of the old machine room to perform cluster initialization, and providing service after cluster initialization (rs.initial) is completed because the initial logging cannot provide service because the original master-slave architecture is adopted. And after the initialization is successful, the reconstruction of the cluster is completed.
According to the embodiment of the present application, as a preferred embodiment in the present embodiment, after the intranet communication is maintained between the new machine room and the old machine room, adding the cluster configuration and the authentication configuration after modifying the configuration of the master library on the service master-slave architecture of the old machine room includes:
after intranet communication is kept between the new machine room and the old machine room, cluster configuration and KEY authentication configuration for annotating master-slave configuration parameters are added after configuration modification of the master library is carried out based on the master-slave framework of the old machine room, and the master library of the old machine room is not restarted.
Specifically, on a master-slave architecture of an old machine room, configuration modification of a master library is carried out, cluster configuration replSet and keyfile authentication configuration are added, original master-slave configuration parameters are annotated, and the Mongdb master library is saved and quitted but not restarted.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
According to an embodiment of the present application, there is also provided an apparatus for migrating a master-slave architecture for business data to a cluster architecture, where the apparatus is configured to implement the foregoing method, and as shown in fig. 2, the apparatus includes: the configuration modification module 10 is configured to, after intranet communication is maintained between a new machine room and an old machine room, modify the configuration of a master library on a service master-slave architecture of the old machine room and then add cluster configuration and authentication configuration; an instance adding module 11, configured to add a database instance in the new computer room, where the cluster configuration and the authentication configuration of the configuration item are consistent with the old computer room master library; the restarting module 12 is configured to log in the old machine room master library initialization cluster after restarting the old machine room master library, and add a newly added database instance of the new machine room into the cluster; and the migration module 13 is configured to complete migration of the cluster service data after the service data of the new machine room and the service data of the old machine room are synchronized.
In the configuration modification module 10 according to the embodiment of the present application, it is specifically necessary to communicate the new machine room and the old machine room by using optical fibers, and perform intranet communication. And after the intranet communication is kept between the new machine room and the old machine room, modifying the configuration of a master library on a service master-slave framework of the old machine room, and then adding cluster configuration and authentication configuration.
Alternatively, the mongodb master library configuration may be modified and the corresponding configuration added.
Specifically, the cluster configuration replSet and the keyfile authentication configuration are added, the original master-slave configuration parameters are annotated, and the Mongdb master library is saved and quitted but not restarted.
In the instance adding module 11 of the embodiment of the present application, the new database instance is added to the new machine room, and then the cluster configuration and the authentication configuration of the new machine room configuration item are kept consistent with the old machine room master library.
Specifically, 2 or 3 mongodb instances can be configured in the new machine room, and the replSet and keyfile of the configuration items need to be consistent with the old machine room master library, and are configured and started.
In the restart module 12 of the embodiment of the present application, the program automatically logs in the old machine room master library initialization cluster after restarting the old machine room master library, and adds the newly added database instance of the new machine room into the cluster while initializing the cluster.
In the migration module 13 in the embodiment of the present application, after the service data of the new machine room and the old machine room are synchronized, it is considered that the data migration is completed.
Specifically, after the data is synchronized through the optical fibers crossing the machine rooms, the master library of the old machine room is shut down, and at the moment, the service is not influenced. After the machine halt is successful, the main library of the cluster can be automatically switched to a new machine room, and the machine room is also migrated.
According to the embodiment of the present application, as a preferred embodiment in the embodiment, the instance adding module 11 is configured to add at least two servers in the new computer room for configuring the database instance for storing the distributed file, and the cluster name parameter configuration of the configuration item and the authentication KEY configuration are consistent with the old computer room master library.
In the newly added module 11 of the instance, specifically, the new machine room configures 2 or 3 mongodb instances, and the replSet and keyfile of the configuration item need to be consistent with the old machine room master library, and the newly added module is configured and started.
Due to the fact that the mongodb data structure is migrated to a high-availability clustering mode, and the authentication mechanism of keyfile is added, data and architecture are safer and higher in availability.
According to the embodiment of the present application, as a preferred option in this embodiment, the restart module 12 is configured to log in the database master library stored in the distributed file of the old machine room to perform cluster initialization after the master library of the old machine room is restarted in a preset time period, and add the database instance stored in the distributed file newly added to the new machine room into the cluster after the master library of the old machine room is restarted in the preset time period.
Specifically, in the restart module 12 of the example, the old machine room master library is notified with the service in advance, and selects a low peak period to restart for a short time, the service configuration is changed to a cluster configuration mode, and 2 examples of the new machine room are added. Logging in the mongdb master library of the old machine room to perform cluster initialization, and providing service after cluster initialization (rs.initial) is completed because the initial logging cannot provide service because the original master-slave architecture is adopted. And after the initialization is successful, the reconstruction of the cluster is completed.
According to the embodiment of the present application, as a preferred embodiment in the present embodiment, the configuration modification module 10 is configured to, after intranet communication is maintained between a new machine room and an old machine room, add cluster configuration and KEY authentication configuration for annotating master-slave configuration parameters after configuration modification of a master library is performed based on a master-slave architecture of the old machine room, and not restart the master library of the old machine room.
Specifically, the configuration modification module 10 in the embodiment of the present application performs configuration modification of the master library on the master-slave architecture of the old machine room, adds replSet and keyfile authentication configuration for cluster configuration, annotates the original master-slave configuration parameters, and saves and exits without restarting the mongodb master library.
It will be apparent to those skilled in the art that the modules or steps of the present application described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and they may alternatively be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, or fabricated separately as individual integrated circuit modules, or fabricated as a single integrated circuit module from multiple modules or steps. Thus, the present application is not limited to any specific combination of hardware and software.
The embodiment of the application also provides computer equipment. As shown in fig. 3, the computer device 30 may include: the at least one processor 301, e.g., CPU, the at least one network interface 304, the user interface 303, the memory 305, the at least one communication bus 302, and optionally, a display screen 306. Wherein a communication bus 302 is used to enable the connection communication between these components. The user interface 303 may include a touch screen, a keyboard or a mouse, among others. The network interface 304 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), and a communication connection may be established with the server via the network interface 304. The memory 305 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory, and the memory 305 includes a flash in the embodiment of the present invention. The memory 305 may alternatively be at least one memory system located remotely from the processor 301. As shown in fig. 3, memory 305, which is a type of computer storage medium, may include an operating system, a network communication module, a user interface module, and program instructions.
It should be noted that the network interface 304 may be connected to a receiver, a transmitter or other communication module, and the other communication module may include, but is not limited to, a WiFi module, a bluetooth module, etc., and it is understood that the computer device in the embodiment of the present invention may also include a receiver, a transmitter, other communication module, etc.
Processor 301 may be configured to call program instructions stored in memory 305 and cause computer device 30 to:
after intranet communication is kept between a new machine room and an old machine room, the configuration of a master library is modified on a service master-slave framework of the old machine room, and then cluster configuration and authentication configuration are added;
adding a database instance in the new machine room, and keeping the cluster configuration and the authentication configuration of the configuration item consistent with the old machine room main library;
after the master library of the old machine room is restarted, logging in the master library of the old machine room to initialize the cluster, and simultaneously adding a newly added database instance of the new machine room into the cluster;
and after the service data of the new machine room and the old machine room are synchronized, the cluster service data are migrated.
Referring to fig. 4 and 5, the implementation principle of the present application is as follows:
step S1, the old host mongodb master library configuration is modified, and the replSet and the keyfile authentication configuration are added. And the new machine room and the old machine room are communicated by adopting optical fibers, and intranet communication is well performed.
And on the master-slave architecture of the old machine room, modifying the configuration of the master library, adding the replSet and keyfile authentication configuration of cluster configuration, annotating the original master-slave configuration parameters, saving and exiting, but not restarting the mongodb master library.
And step S2, adding 2 mongodb libraries in the new machine room, and setting the replSet configuration and the keyfile configuration to be consistent with the old machine room master library.
The new machine room is configured with 2 or 3 mongodb instances, and the replSet and the keyfile of the configuration items need to be consistent with the old machine room master library, and the new machine room is configured and started.
And the old machine room master library is informed of the service in advance, the short restart is carried out in a low peak period, the service configuration is changed into a cluster configuration mode, and 2 instances of the new machine room are added.
Step S3, restart the old machine room master library mongoddb (for a short time).
And step S4, initializing the cluster after the old machine room master library is logged in, and adding 2 libraries of the new machine room into the cluster.
Logging in the mongdb master library of the old machine room to perform cluster initialization, and providing service after cluster initialization (rs.initial) is completed because the initial logging cannot provide service because the original master-slave architecture is adopted. And after the initialization is successful, the reconstruction of the cluster is completed.
And step S5, after the data synchronization of the new machine room and the old machine room is completed, stopping the old master library, and automatically migrating the cluster to the new machine room.
After the data are synchronously completed through the optical fibers crossing the machine rooms, the main library of the old machine room is stopped, and at the moment, the service cannot be influenced. After the machine halt is successful, the main library of the cluster can be automatically switched to a new machine room, and the machine room is also migrated.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A method for migration of a master-slave architecture of business data to a cluster architecture, comprising:
after intranet communication is kept between a new machine room and an old machine room, the configuration of a master library is modified on a service master-slave framework of the old machine room, and then cluster configuration and authentication configuration are added;
adding a database instance in the new machine room, and keeping the cluster configuration and the authentication configuration of the configuration item consistent with the old machine room main library;
after the master library of the old machine room is restarted, logging in the master library of the old machine room to initialize the cluster, and simultaneously adding a newly added database instance of the new machine room into the cluster;
and after the service data of the new machine room and the old machine room are synchronized, the cluster service data are migrated.
2. The method of claim 1, wherein adding a new database instance in the new machine room and keeping the cluster configuration and the authentication configuration of the configuration item consistent with the old machine room master room comprises:
and adding at least two servers in the new machine room for configuring database instances for distributed file storage, wherein the cluster name parameter configuration and the authentication KEY configuration of the configuration items are consistent with those of the old machine room master library.
3. The method according to claim 1, wherein the logging into the old machine room master library initialization cluster after restarting the old machine room master library and adding the newly added database instance of the new machine room into the cluster comprises:
and after the master library of the old machine room is restarted in a preset time period, logging in the master library of the database stored by the distributed files of the old machine room to carry out cluster initialization, and simultaneously, after the master library of the old machine room is restarted in a preset time period, adding the newly added database instance stored by the distributed files of the new machine room into a cluster.
4. The method of claim 1, wherein after intranet communication is maintained between a new machine room and an old machine room, adding cluster configuration and authentication configuration after the configuration of the master library is modified on the service master-slave architecture of the old machine room comprises:
after intranet communication is kept between the new machine room and the old machine room, cluster configuration and KEY authentication configuration for annotating master-slave configuration parameters are added after configuration modification of the master library is carried out based on the master-slave framework of the old machine room, and the master library of the old machine room is not restarted.
5. An apparatus for migration of a master-slave architecture of business data to a cluster architecture, comprising:
the configuration modification module is used for modifying the configuration of the master library on a service master-slave framework of an old machine room and then adding cluster configuration and authentication configuration after intranet communication is kept between a new machine room and the old machine room;
an instance adding module, configured to add a database instance in the new machine room, and the cluster configuration and the authentication configuration of the configuration item are consistent with the old machine room master library;
the restarting module is used for logging in the old machine room master library initialization cluster after restarting the old machine room master library and adding a newly added database instance of the new machine room into the cluster;
and the migration module is used for completing the migration of the cluster service data after the service data of the new machine room and the old machine room are synchronized.
6. The apparatus for migration of a master-slave architecture to a cluster architecture for business data of claim 5, wherein said instance adding module is configured to add an instance to a cluster architecture
And adding at least two servers in the new machine room for configuring database instances for distributed file storage, wherein the cluster name parameter configuration and the authentication KEY configuration of the configuration items are consistent with those of the old machine room master library.
7. The apparatus for migrating a master-slave architecture of business data to a cluster architecture of claim 5, wherein the restart module is configured to restart the cluster architecture after the cluster architecture is migrated to the master-slave architecture
And after the master library of the old machine room is restarted in a preset time period, logging in the master library of the database stored by the distributed files of the old machine room to carry out cluster initialization, and simultaneously, after the master library of the old machine room is restarted in a preset time period, adding the newly added database instance stored by the distributed files of the new machine room into a cluster.
8. The apparatus for migrating a master-slave architecture of business data to a cluster architecture of claim 5, wherein the configuration modification module is configured to modify the configuration of the cluster architecture
After intranet communication is kept between the new machine room and the old machine room, cluster configuration and KEY authentication configuration for annotating master-slave configuration parameters are added after configuration modification of the master library is carried out based on the master-slave framework of the old machine room, and the master library of the old machine room is not restarted.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program implements the steps of the method for migration of a master-slave architecture for business data to a cluster architecture of any one of claims 1 to 4.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for migration of a master-slave architecture for business data to a cluster architecture according to any one of claims 1 to 4.
CN201910992754.2A 2019-10-17 2019-10-17 Method, device, equipment and storage medium for migrating master-slave architecture of business data to cluster architecture Withdrawn CN110807018A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910992754.2A CN110807018A (en) 2019-10-17 2019-10-17 Method, device, equipment and storage medium for migrating master-slave architecture of business data to cluster architecture

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910992754.2A CN110807018A (en) 2019-10-17 2019-10-17 Method, device, equipment and storage medium for migrating master-slave architecture of business data to cluster architecture

Publications (1)

Publication Number Publication Date
CN110807018A true CN110807018A (en) 2020-02-18

Family

ID=69488561

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910992754.2A Withdrawn CN110807018A (en) 2019-10-17 2019-10-17 Method, device, equipment and storage medium for migrating master-slave architecture of business data to cluster architecture

Country Status (1)

Country Link
CN (1) CN110807018A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114168221A (en) * 2021-11-30 2022-03-11 紫光云(南京)数字技术有限公司 Method for restarting mongodb cluster on cloud management platform

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070174661A1 (en) * 2005-11-15 2007-07-26 Bea Systems, Inc. System and method for providing singleton services in a cluster
CN106341454A (en) * 2016-08-23 2017-01-18 世纪龙信息网络有限责任公司 Across-room multiple-active distributed database management system and across-room multiple-active distributed database management method
CN107465767A (en) * 2017-09-29 2017-12-12 网宿科技股份有限公司 A kind of method and system of data syn-chronization
CN108256002A (en) * 2017-12-31 2018-07-06 广东欧珀移动通信有限公司 Across computer room method of data synchronization, device, system and server
CN109726046A (en) * 2018-11-23 2019-05-07 网联清算有限公司 Computer room switching method and switching device
CN110334077A (en) * 2019-06-11 2019-10-15 无线生活(杭州)信息科技有限公司 The method and device of database cross computer room migration

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070174661A1 (en) * 2005-11-15 2007-07-26 Bea Systems, Inc. System and method for providing singleton services in a cluster
CN106341454A (en) * 2016-08-23 2017-01-18 世纪龙信息网络有限责任公司 Across-room multiple-active distributed database management system and across-room multiple-active distributed database management method
CN107465767A (en) * 2017-09-29 2017-12-12 网宿科技股份有限公司 A kind of method and system of data syn-chronization
CN108256002A (en) * 2017-12-31 2018-07-06 广东欧珀移动通信有限公司 Across computer room method of data synchronization, device, system and server
CN109726046A (en) * 2018-11-23 2019-05-07 网联清算有限公司 Computer room switching method and switching device
CN110334077A (en) * 2019-06-11 2019-10-15 无线生活(杭州)信息科技有限公司 The method and device of database cross computer room migration

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
KEITH003: "mongodb配置复制集replset", 《CSDN:HTTPS://BLOG.CSDN.NET/KEITH003/ARTICLE/DETAILS/80791285》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114168221A (en) * 2021-11-30 2022-03-11 紫光云(南京)数字技术有限公司 Method for restarting mongodb cluster on cloud management platform

Similar Documents

Publication Publication Date Title
CN109831500B (en) Synchronization method for configuration file and Pod in Kubernetes cluster
US11294699B2 (en) Dynamically scaled hyperconverged system establishing minimum supported interoperable communication protocol between clusters in a cluster group
CN112214330A (en) Method and device for deploying master nodes in cluster and computer-readable storage medium
US8799453B2 (en) Managing networks and machines for an online service
US8386501B2 (en) Dynamically splitting multi-tenant databases
US9043370B2 (en) Online database availability during upgrade
US8296267B2 (en) Upgrade of highly available farm server groups
US9503310B1 (en) Methods and systems of dynamic management of resources in a virtualized environment
CN109284184A (en) A kind of building method of the distributed machines learning platform based on containerization technique
CN103441867B (en) A kind of method updating virtual machine internal Network resource allocation
CN102541606B (en) Collocation method and the device of BIOS is remotely managed based on UEFI
CN111930521A (en) Method and device for deploying application, electronic equipment and readable storage medium
SG189389A1 (en) Web service patterns for globally distributed service fabric
US20140297834A1 (en) Management of a plurality of system control networks
CN114079615B (en) Application synchronization method, system, medium and electronic equipment in multi-cluster environment
SG189899A1 (en) Machine manager service fabric
CN107947981B (en) Network equipment management method and device
WO2024077885A1 (en) Management method, apparatus and device for container cluster, and non-volatile readable storage medium
US20120102484A1 (en) Installing software remotely using a high privilege process
CN106972970A (en) A kind of method for avoiding oVirt cloud platform management node Single Point of Faliures
US9098334B2 (en) Special values in oracle clusterware resource profiles
CN110807018A (en) Method, device, equipment and storage medium for migrating master-slave architecture of business data to cluster architecture
CN112291081B (en) Method, system and storage medium for auditing controller cluster data by cloud management platform
CN115268951A (en) Installation method, device, equipment and storage medium of operating system
CN113711570B (en) Method and system for enabling a computing device to communicate with a cloud network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication

Application publication date: 20200218

WW01 Invention patent application withdrawn after publication