Capacity expansion method, program product, device and storage medium
By performing cluster backup processing on the slave cluster devices in the Ceph storage system, establishing associations rather than data synchronization, the risks brought about by data migration after expansion are solved, and the sensing-free level of device expansion and simplified management are achieved.
Patent Information
- Application Number
- CN202410903392.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-05
- Publication Date
- 2024-11-01
AI Technical Summary
After the Ceph storage system is expanded, various risks such as increased latency, disk failure, data loss and data inconsistency caused by data migration, affecting the normal operation of the system and increasing management complexity.
By performing cluster backup processing on slave cluster devices, an association relationship between slave cluster devices and primary cluster devices is established, without data synchronization, so that the slave cluster device is determined as the expansion device of the primary cluster device to avoid data migration.
It realizes the expansion of equipment without data migration, reduces the risk after capacity expansion, simplifies the management process, and avoids the problems of delay and data consistency caused by data migration.
Smart Images

Figure CN118890278A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a capacity expansion method, program product, device and storage medium. Background Art
[0002] Ceph is a distributed storage system that can provide file storage, block storage, and object storage at the same time. It has high performance, high reliability, and high scalability. It can meet diverse needs and is a relatively popular storage solution.
[0003] With the rapid growth of data volume and storage requirements, Ceph needs to be expanded. When Ceph is expanded, it is usually achieved by adding nodes or storage devices internally. After the expansion is completed, a large amount of data will be migrated to maintain the storage pressure of each device in Ceph. However, a large amount of data migration will lead to multiple risks such as increased latency and disk failure. Summary of the invention
[0004] The present application provides a capacity expansion method, program product, device and storage medium, which are used to solve the technical problems of various risks caused by large-scale data migration after capacity expansion.
[0005] In order to achieve the above objectives, this application adopts the following technical solutions:
[0006] In a first aspect, a capacity expansion method is provided, including: performing cluster backup processing on a slave cluster device, establishing an association relationship between the slave cluster device and a master cluster device, wherein the cluster backup processing does not include: data synchronization; and determining the slave cluster device as an expansion device for the master cluster device.
[0007] Optionally, the method also includes: obtaining a first request message, the first request message is used to request processing of the data to be processed; if the location information of the data to be processed exists in the historical location information, determining the cluster device corresponding to the data to be processed based on the historical location information; the historical location information is cached data; sending a first indication message to the cluster device corresponding to the data to be processed, the first indication information is used to instruct the cluster device corresponding to the data to be processed to process the data to be processed.
[0008] Optionally, the method also includes: if the location information of the data to be processed does not exist in the historical location information, sending a first request message to the first device, so that the first device determines the cluster device corresponding to the data to be processed based on the target location information, and processes the data to be processed in the cluster device corresponding to the data to be processed; wherein the target location information includes the location information of the data in the master cluster device and the location information of the data in the slave cluster device, and the first device is the master cluster device or the slave cluster device.
[0009] Optionally, the data to be processed includes data to be written and / or data to be read; the method further includes: when the data to be processed is data to be written and there is an association between the data to be processed and the historical data, writing the data to be processed into the master cluster device; or, when the data to be processed is data to be written and there is no association between the data to be processed and the historical data, writing the data to be processed into the slave cluster device.
[0010] Optionally, the method further includes: acquiring a second request message, where the second request message is used to request the creation of a bucket; and sending the second request message to the slave cluster device, so that the slave cluster device creates the bucket based on the second request message.
[0011] Optionally, the method also includes: obtaining a third request message, the third request message is used to trigger a change in metadata of the first device, the first device is a master cluster device or a slave cluster device; sending the third request message to the first device, so that the first device synchronizes the changed metadata to the second device, the second device is a device other than the first device among the master cluster device and the slave cluster device.
[0012] In a second aspect, a capacity expansion device is provided, including: a processing unit and a determination unit; the processing unit is used to perform cluster backup processing on the slave cluster device, establish an association relationship between the slave cluster device and the master cluster device, and the cluster backup processing does not include: data synchronization; the determination unit is used to determine the slave cluster device as an expansion device for the master cluster device.
[0013] Optionally, the device also includes: an acquisition unit and a sending unit; the acquisition unit is used to acquire a first request message, the first request message is used to request processing of the data to be processed; the determination unit is also used to determine the cluster device corresponding to the data to be processed based on the historical location information if there is location information of the data to be processed in the historical location information; the historical location information is cached data; the sending unit is used to send a first indication message to the cluster device corresponding to the data to be processed, the first indication information is used to instruct the cluster device corresponding to the data to be processed to process the data to be processed.
[0014] Optionally, the sending unit is also used to send a first request message to the first device if the location information of the data to be processed does not exist in the historical location information, so that the first device determines the cluster device corresponding to the data to be processed based on the target location information, and processes the data to be processed in the cluster device corresponding to the data to be processed; wherein the target location information includes the location information of the data in the master cluster device and the location information of the data in the slave cluster device, and the first device is the master cluster device or the slave cluster device.
[0015] Optionally, the processing unit is further used to write the data to be processed into the master cluster device when the data to be processed is data to be written and there is an association between the data to be processed and the historical data; or, the processing unit is further used to write the data to be processed into the slave cluster device when the data to be processed is data to be written and there is no association between the data to be processed and the historical data.
[0016] Optionally, the acquiring unit is further configured to acquire a second request message, where the second request message is used to request the creation of a bucket; and the sending unit is further configured to send the second request message to the slave cluster device, so that the slave cluster device creates the bucket based on the second request message.
[0017] Optionally, the acquisition unit is also used to obtain a third request message, where the third request message is used to trigger a change in the metadata of the first device, where the first device is a master cluster device or a slave cluster device; the sending unit is also used to send the third request message to the first device, so that the first device synchronizes the changed metadata to the second device, where the second device is a device other than the first device, among the master cluster device and the slave cluster device.
[0018] In a third aspect, an expansion device is provided, comprising a memory and a processor; the memory is used to store computer execution instructions, and the processor is connected to the memory through a bus; when the communication device is running, the processor executes the computer execution instructions stored in the memory, so that the expansion device executes the communication method described in the first aspect.
[0019] The expansion device may be a network device, or a part of a network device, such as a chip system in the network device. The chip system is used to support the network device to implement the functions involved in the first aspect and any possible implementation thereof, such as obtaining, determining, and sending the data and / or information involved in the above communication method. The chip system includes a chip, and may also include other discrete devices or circuit structures.
[0020] In a fourth aspect, a computer-readable storage medium is provided, the computer-readable storage medium comprising computer execution instructions, and when the computer execution instructions are executed on a computer, the computer executes the capacity expansion method described in the first aspect.
[0021] In a fifth aspect, a computer program product is also provided. The computer program product includes computer instructions. When the computer instructions are executed on the expansion device, the expansion device executes the expansion method as described in the first aspect above.
[0022] It should be noted that the above computer instructions may be stored in whole or in part on a computer-readable storage medium, wherein the computer-readable storage medium may be packaged together with the processor of the expansion device, or may be packaged separately from the processor of the expansion device, which is not limited in the present embodiment of the application.
[0023] The description of the second, third, fourth and fifth aspects of this application can refer to the detailed description of the first aspect.
[0024] In the embodiments of the present application, the name of the expansion device does not limit the device or functional module itself. In actual implementation, these devices or functional modules may appear with other names. For example, the receiving unit may also be called a receiving module, a receiver, etc. As long as the functions of each device or functional module are similar to those of the present application, they fall within the scope of the claims of the present application and their equivalent technologies.
[0025] The technical solution provided by this application brings at least the following beneficial effects:
[0026] Based on any of the above aspects, the present application provides a capacity expansion method, including: cluster backup processing can be performed on the slave cluster device, and an association relationship between the slave cluster device and the master cluster device can be established. Among them, the cluster backup technology does not include data synchronization. Afterwards, the slave cluster device can be determined as an expansion device of the master cluster device.
[0027] As can be seen from the above, the association relationship between the master cluster device and the slave cluster device can be established through basic backup processing, so that the configuration of the slave cluster device is the same as that of the master cluster. In addition, if the cluster backup data does not include data synchronization, the slave cluster device after the cluster backup processing will not synchronize data with the master cluster, that is, the slave cluster device is not a backup device for the master cluster device. In this case, since the configuration of the master cluster device and the slave cluster device is the same, the slave cluster device can be used as an expansion device for the master cluster device. In this way, the slave cluster device is a cluster device other than the master cluster device, and the master cluster device does not need to perform data migration, thereby avoiding various risks caused by data migration.
[0028] The beneficial effects of the second, third, fourth and fifth aspects of the present application can all be referred to the analysis of the above beneficial effects, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 A schematic diagram of the structure of a capacity expansion system provided in an embodiment of the present application;
[0030] Figure 2 Another structural schematic diagram of a capacity expansion system provided in an embodiment of the present application;
[0031] Figure 3 A schematic diagram of the hardware structure of a capacity expansion device provided in an embodiment of the present application;
[0032] Figure 4 A flowchart of a capacity expansion method provided in an embodiment of the present application;
[0033] Figure 5 A processing flow chart of data to be processed provided in an embodiment of the present application;
[0034] Figure 6 A schematic diagram of a process for determining location information of data to be processed based on a first device provided in an embodiment of the present application;
[0035] Figure 7 A schematic diagram of a processing flow of data to be processed provided in an embodiment of the present application;
[0036] Figure 8 A schematic diagram of a process for creating a bucket provided in an embodiment of the present application;
[0037] Fig. 9 A schematic diagram of a metadata synchronization process provided by an embodiment of the present application;
[0038] Fig.10 A schematic diagram of the structure of a capacity expansion device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0040] It should be noted that, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0041] In order to facilitate a clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and order of execution.
[0042] Ceph is a distributed storage system that can provide file storage, block storage, and object storage at the same time. It has high performance, high reliability, and high scalability. It can meet diverse needs and is a relatively popular storage solution.
[0043] With the rapid growth of data volume and storage requirements, Ceph needs to be expanded. When Ceph is expanded, it is usually achieved by adding nodes or storage devices internally. After the expansion is completed, a large amount of data will be migrated to maintain the balance of storage pressure on each device in Ceph.
[0044] However, large-scale data migration will lead to multiple risks such as increased latency, disk failure, data loss, and data inconsistency, which will affect the normal operation of the system and cause revenue loss. In addition, this requires managers to have a wealth of knowledge to ensure data security during the migration process.
[0045] In view of the above problems, the present application provides a capacity expansion method, including: cluster backup processing can be performed on the slave cluster device, and an association relationship between the slave cluster device and the master cluster device is established. Among them, the cluster backup technology does not include data synchronization. Afterwards, the slave cluster device can be determined as an expansion device of the master cluster device.
[0046] As can be seen from the above, the association relationship between the master cluster device and the slave cluster device can be established through basic backup processing, so that the configuration of the slave cluster device is the same as that of the master cluster. In addition, if the cluster backup data does not include data synchronization, the slave cluster device after the cluster backup processing will not synchronize data with the master cluster, that is, the slave cluster device is not a backup device for the master cluster device. In this case, since the configurations of the master cluster device and the slave cluster device are the same, the slave cluster device can be used as an expansion device for the master cluster device. In this way, the slave cluster device is a cluster device other than the master cluster device, and the master cluster device does not need to perform data migration, thereby avoiding various risks caused by data migration. This expansion method is suitable for expansion systems.
[0047] Figure 1 A structural diagram of the expansion system is shown in FIG. Figure 1 As shown, the capacity expansion system includes: an electronic device 101 , a master cluster device 102 and a slave cluster device 103 .
[0048] The electronic device 102 is connected to the master cluster device 102 and the slave cluster device 103 in communication. The master cluster device 102 is connected to the slave cluster device 103 in communication. The slave cluster device 103 is a cluster device newly added in addition to the master cluster device 102.
[0049] It should be noted that both the master cluster device 102 and the slave cluster device 103 may include multiple storage devices, and the electronic device 102 may be a storage proxy device or a device where a proxy layer is located, for managing the master cluster device 102 and the slave cluster device 103 .
[0050] In the present application, the electronic device 101 can perform cluster backup processing on the slave cluster device 103 and establish an association relationship between the slave cluster device 103 and the master cluster device 102. The cluster backup technology does not include data synchronization. Afterwards, the electronic device 101 can determine the slave cluster device 103 as an expansion device for the master cluster device 102.
[0051] In a possible implementation, the electronic device 101 may be a terminal, a server, or other types of electronic devices.
[0052] In another possible implementation, the electronic device 101 may be a device where an agent layer is located. The agent layer is software. The user may control the master cluster device 102 and the slave cluster device 103 through the agent layer in the device 101 . Figure 2 Another structural diagram of an expansion system is shown. Figure 2 As shown, the system may include a main cluster device 201 (i.e. Figure 1 The master cluster device 102 in the cluster), the slave cluster device 202 (ie Figure 1 The slave cluster device 103), the proxy layer 203 and the client device 204.
[0053] In a possible implementation, the proxy layer 203 may be Figure 1 The electronic device 101 in the client device 204 is the upper node device of the electronic device 101. Alternatively, the proxy layer 203 can be software in the client device 204, and the client device 204 is Figure 1 Optionally, the proxy layer 203 may be an application program (APP) that can implement read and write functions for the master cluster device 201 and the slave cluster device 202 .
[0054] Optionally, the terminal may be a device that provides voice and / or data connectivity to a user, a handheld device with wireless connection function, or other processing device connected to a wireless modem. The terminal may communicate with one or more core networks via a radio access network (RAN). The terminal may be a mobile terminal, such as a mobile phone (or "cellular" phone) and a computer with a mobile terminal, or a portable, pocket-sized, handheld, computer-built-in or vehicle-mounted mobile device that exchanges language and / or data with a radio access network, such as a mobile phone, a tablet computer, a laptop computer, a netbook, a personal digital assistant (PDA).
[0055] The basic hardware structure of electronic device 101 includes Figure 3The components included in the expansion device shown in FIG. Figure 3 Taking the expansion device shown as an example, the hardware structure of the electronic device 101 is introduced.
[0056] like Figure 3 , which is a schematic diagram of a hardware structure of a capacity expansion device provided in an embodiment of the present application. The capacity expansion device includes a processor 21, a memory 22, a communication interface 23, and a bus 24. The processor 21, the memory 22, and the communication interface 23 can be connected via a bus 24.
[0057] The processor 21 is the control center of the expansion device, which can be a processor or a general term for multiple processing elements. For example, the processor 21 can be a general-purpose central processing unit (CPU) or other general-purpose processors. Among them, the general-purpose processor can be a microprocessor or any conventional processor.
[0058] As an embodiment, the processor 21 may include one or more CPUs, such as Figure 3 CPU 0 and CPU 1 are shown in .
[0059] The memory 22 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.
[0060] In a possible implementation, the memory 22 may exist independently of the processor 21, and the memory 22 may be connected to the processor 21 via a bus 24 to store instructions or program codes. When the processor 21 calls and executes the instructions or program codes stored in the memory 22, the expansion method provided in the following embodiments of the present application can be implemented.
[0061] In the embodiment of the present application, for the electronic device 101, the software programs stored in the memory 22 are different, so the functions implemented by the electronic device 101 are different. The functions performed by each device will be described in conjunction with the following flowchart.
[0062] In another possible implementation, the memory 22 may also be integrated with the processor 21 .
[0063] The communication interface 23 is used to connect the expansion device to other devices through a communication network, and the communication network may be Ethernet, wireless access network, wireless local area network (WLAN), etc. The communication interface 23 may include a receiving unit for receiving data and a sending unit for sending data.
[0064] The bus 24 may be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0065] It should be pointed out that Figure 3 The structure shown in the figure does not constitute a limitation on the expansion device, except Figure 3 In addition to the components shown, the expansion device may include more or fewer components than shown, or combine certain components, or arrange the components differently.
[0066] The capacity expansion method provided in the embodiment of the present application is described in detail below with reference to the accompanying drawings.
[0067] The capacity expansion method provided in the embodiment of the present application is applied to Figure 1 The electronic device 101 in the expansion system shown in FIG. Figure 4 As shown, the capacity expansion method provided in the embodiment of the present application includes:
[0068] S401: The electronic device performs cluster backup processing on the slave cluster device, and establishes an association relationship between the slave cluster device and the master cluster device.
[0069] Among them, cluster backup processing does not include: data synchronization.
[0070] In order to expand the capacity of the master cluster device, the user can add a slave cluster device in addition to the master cluster device. Afterwards, the electronic device can perform a backup process on the slave cluster device in response to the trigger operation performed by the user, so that the configurations between the master cluster device and the slave cluster device are the same, and the slave cluster device becomes the backup device of the master cluster device. However, since the data backup process does not include the configuration of data synchronization, the data in the slave cluster device and the master cluster device are not synchronized, and the slave cluster device cannot become the backup device of the master cluster device.
[0071] It should be pointed out that the operation of performing cluster backup processing on the slave cluster device by the electronic device can be processed on the slave cluster device in a manual configuration manner, thereby eliminating the need for processing by the electronic device.
[0072] In a possible implementation, the cluster backup technology may be a multisite technology in Ceph. Multisite is a core mechanism in the object storage gateway (rados gateway, RGW), which is mainly used to achieve data synchronization between multiple Ceph object storage clusters, that is, to achieve data backup between multiple clusters.
[0073] Exemplarily, taking the cluster backup mode of multisite as an example, the master cluster is the main cluster (or the original cluster), and the secondary cluster is a newly created cluster for capacity expansion, that is, the slave cluster. First, bind the two clusters to multisite. Create a new Realm, and create a zonegroup. Create two zones in the zonegroup, and these two zones are bound to the two clusters respectively. After that, based on the multisite technology, you can set the master cluster --sync-from=[] and --asyc-from-all=false, and set the secondary cluster --sync-from=[] and --async-from-all=false to achieve asynchronous user storage data between the two clusters. In addition, due to the configuration of multisite, the metadata between the two clusters can be synchronized.
[0074] In a possible implementation, in the master cluster and slave cluster after multisite configuration, only the master cluster device stores metadata, and stores metadata of both cluster devices. When the metadata of the slave cluster device changes, the changed metadata is synchronized to the master cluster device.
[0075] S402: The electronic device determines the slave cluster device as an expansion device of the master cluster device.
[0076] Since the configurations of the slave cluster device and the master cluster device are the same, and the data between the two cluster devices are not synchronized, that is, the data stored in the slave cluster device is 0. Therefore, the electronic device can determine the slave cluster device as the expansion device of the master cluster device. In addition, the electronic device can also make the configuration data of the slave cluster device and the master cluster device consistent except for the storage data through the association relationship configured by the cluster backup technology between the master cluster device and the slave cluster device, thereby avoiding various problems such as read errors and duplicate writing.
[0077] In this way, since the slave cluster device is a new device in addition to the master cluster device, the master cluster device does not need to migrate a large amount of data (such as object data, object, user data, etc.) stored in itself to the slave cluster device, which can not only achieve the purpose of device expansion, but also avoid various risks caused by large-scale data migration after expansion. And there is no need for management personnel to ensure data security during the migration process, thus achieving a seamless level of cluster device expansion.
[0078] In some embodiments, Figure 5 A processing flow chart of the data to be processed is shown. Figure 4 ,like Figure 5 As shown, the method provided in the embodiment of the present application also includes:
[0079] S501: The electronic device obtains a first request message.
[0080] The first request message is used to request processing of the data to be processed.
[0081] In a possible implementation, the electronic device can obtain the first request message sent by the third-party device, thereby requesting to process the data to be processed. Since the electronic device is in communication connection with the master cluster device and the slave cluster device respectively, the electronic device can manage the data in the master cluster device and the slave cluster device.
[0082] It should be understood that the data to be processed may include data to be read, data to be written, data to be adjusted, data to be deleted, etc.
[0083] S502: If the historical location information contains location information of the data to be processed, the electronic device determines the cluster device corresponding to the data to be processed based on the historical location information.
[0084] The historical location information is cached data. The historical location information belongs to metadata cached by the electronic device. It should be understood that the historical location information can be information cached locally in the electronic device when the electronic device processes (eg, writes, reads, etc.) historical data.
[0085] After receiving the first request message, the electronic device can query the location information corresponding to the data to be processed based on the stored historical location information. If the location information corresponding to the data to be processed exists in the historical location information, the electronic device can determine the location information corresponding to the data to be processed based on the historical location information, thereby determining whether the cluster device where the location information is located is a master cluster device or a slave cluster device.
[0086] In a possible implementation, the historical location information may be location information of data to be processed that has been processed by the electronic device within a preset time period. Such location information may be cached in the electronic device, namely, cached data.
[0087] S503: The electronic device sends a first indication message to the cluster device corresponding to the data to be processed.
[0088] The first indication information is used to instruct the cluster device corresponding to the data to be processed to process the data to be processed.
[0089] The electronic device may send a first indication message to the cluster device corresponding to the data to be processed, so that the cluster device responds to the first indication message to process the data to be processed, for example, delete the data to be processed, write the data to be processed, adjust the data to be processed, etc.
[0090] In a possible implementation, when the cluster backup technology is multisite, since the data is stored in a bucket in the cluster device, when processing the data to be processed, the electronic device can query whether there is a bucket corresponding to the data to be processed in the historical location information. If there is a bucket corresponding to the data to be processed, the electronic device can send a first indication information to the cluster device where the bucket is located.
[0091] In some embodiments, Figure 6 A schematic diagram of a process for determining location information of data to be processed based on a first device is shown. Figure 5 ,like Figure 6 As shown, the method provided in the embodiment of the present application also includes:
[0092] S601: If the historical location information does not contain location information of the data to be processed, the electronic device sends a first request message to the first device, so that the first device determines the cluster device corresponding to the data to be processed based on the target location information, and processes the data to be processed in the cluster device corresponding to the data to be processed.
[0093] The target location information is stored in the first device. The target location information includes location information of data in the master cluster device and location information of data in the slave cluster device. The first device is a master cluster device or a slave cluster device. Optionally, the location information may be metadata, and the target location information may include metadata of the master cluster device and metadata of the slave cluster device.
[0094] Since the historical location information is cached data in the electronic device, the historical location information is only part of the target location information, and the target location information is the location information storing all the data in the master cluster device and the slave cluster device. In this case, if the location information corresponding to the data to be processed does not exist in the historical location information, the electronic device can send a first request message to the first device. After receiving the first request message, the first device can determine the cluster device corresponding to the data to be processed based on the stored target location information, and process the data to be processed in the cluster device corresponding to the data to be processed.
[0095] It should be noted that, when the cluster device corresponding to the data to be processed is the first device itself, the first device can process the data to be processed locally. Alternatively, when the cluster device corresponding to the data to be processed is the second device, the first device can send a first request message to the second device so that the second device processes the data to be processed. The second device is a device different from the first device in the master cluster device and the slave cluster device.
[0096] In some embodiments, Figure 7 A schematic diagram of a processing flow of data to be processed is shown. Figure 4 ,like Figure 7 As shown, the method provided in the embodiment of the present application also includes:
[0097] S701. When the data to be processed is data to be written and there is an association between the data to be processed and the historical data, write the data to be processed into the master cluster device; or, when the data to be processed is data to be written and there is no association between the data to be processed and the historical data, write the data to be processed into the slave cluster device.
[0098] The data to be processed includes data to be written and / or data to be read. Optionally, in some cases, a complete data (or file) may be stored in two cluster devices respectively. Therefore, when the electronic device reads the data to be read, it reads from the two cluster devices respectively and merges the read data.
[0099] In the case where the data to be processed is to be written, the electronic device can determine whether the data to be processed is associated with the historical data in the main cluster device, for example, the data to be written and some historical data in the main cluster device are data of the same user, or the same group of data, etc. In the case where the data to be processed is associated with the historical data in the main cluster device, the electronic device can write the data to be processed into the main cluster device, so that the integrity of the data can be included, thereby facilitating operations such as reading and deletion.
[0100] Alternatively, the electronic device may determine that the data to be processed has no association relationship with the historical data in the master cluster device, for example, the user to which the data to be processed belongs is a newly added user, the data to be processed is a newly added type of data, etc. In the case that the data to be processed has no association relationship with the historical data in the master cluster device, the electronic device may write the data to be processed into the slave cluster device. In this way, all the newly added data is written into the slave cluster device with a larger remaining storage space, thereby reducing the storage pressure of the master cluster device, and the data that has an association relationship with the historical data in the master cluster device is still written into the master cluster device, so that it is convenient to process these associated data.
[0101] In a possible implementation, the electronic device can cache other metadata in addition to the historical location information. Therefore, the electronic device can determine whether the data to be processed and the historical data in the main cluster device are associated based on the cached metadata. Alternatively, the electronic device can also directly send the data to be processed to the first device, so that the first device can determine whether the data to be processed and the historical data are associated based on the stored target location information.
[0102] In another possible implementation, the electronic device determines whether the data to be processed has an association relationship with the historical data in the master cluster device by: determining whether the bucket to be written by the data to be processed exists in the master cluster device, and when the bucket to be written by the data to be processed exists in the master cluster device, the electronic device can determine that the data to be processed has an association relationship with the historical data in the master cluster device. When the bucket to be written by the data to be processed belongs to the slave cluster device, the electronic device can determine that the data to be processed has no association relationship with the historical data in the master cluster device.
[0103] It should be noted that the master cluster device and the slave cluster device are in the same namespace, that is, the bucket identifiers and data identifiers in the master cluster device and the slave cluster device cannot be repeated and are unique.
[0104] In some embodiments, Figure 8 A schematic diagram of the process of creating a bucket is shown. Figure 4 ,like Figure 8As shown, the method provided in the embodiment of the present application also includes:
[0105] S801. The electronic device obtains a second request message.
[0106] The second request message is used to request the creation of a bucket.
[0107] In Ceph, data can be stored in buckets in cluster devices, so the electronic device can obtain a second request message for requesting to create a bucket.
[0108] S802: The electronic device sends a second request message to the slave cluster device, so that the slave cluster device creates a bucket based on the second request message.
[0109] The newly created bucket is used to store newly written data.
[0110] After obtaining the second request message for requesting to create a bucket, the electronic device may send the second request message to the slave cluster device. After receiving the second request message, the slave cluster device may create a new bucket in response to the second request message. In this way, since the newly created buckets are all created in the slave cluster device, the newly written data are all stored in the slave cluster device, thereby realizing the utilization of the storage space of the slave cluster device and reducing the storage pressure of the master cluster device.
[0111] In some embodiments, Fig. 9 A schematic diagram of a metadata synchronization process is shown. Figure 4 ,like Fig. 9 As shown, the method provided in the embodiment of the present application also includes:
[0112] S901. The electronic device obtains a third request message.
[0113] The third request message is used to trigger a change in metadata of the first device, where the first device is a master cluster device or a slave cluster device.
[0114] In Ceph, metadata is used to represent data attributes, so when the data attributes of the stored data change, the metadata will also change. In this case, the electronic device can obtain a third request message for triggering the metadata change of the first device, for example, the third request message is used to request the deletion of certain data, or the third request message is used to request the adjustment of the position of certain data. These operations will cause the metadata of the data to change.
[0115] S902: The electronic device sends a third request message to the first device, so that the first device synchronizes the changed metadata with the second device.
[0116] The second device is a device other than the first device in the master cluster device and the slave cluster device.
[0117] The electronic device may send a third request message to the first device corresponding to the third request message, so that the first device operates in response to the third request message, thereby changing the metadata of the first device. Since the master cluster device and the slave cluster device are configured through cluster backup technology, the metadata between the two cluster devices are the same. Therefore, after the metadata of the first device changes, the first device needs to send the changed metadata to the second device, so that the second device is updated based on the changed metadata, thereby ensuring the consistency of metadata updates and metadata of the master and slave cluster devices, and at the same time ensuring the consistency of the user's identity identification (access key id, ak) and key (secret access key, sk) information in the master and slave cluster devices, which is convenient for the electronic device to perform request parsing and calling.
[0118] In one possible implementation, when the cluster backup technology is multisite, the metadata of the two cluster devices are stored in the master cluster device, while the slave cluster device does not store metadata. In this way, when the metadata in the master cluster device changes, the master cluster device only needs to synchronize the metadata stored in it.
[0119] In another possible implementation, the electronic device may pre-configure multiple determination rules to implement rules for multiple operations such as reading, writing, and deleting data. For example, the newly written data is determined to be written to the slave cluster device.
[0120] It should be pointed out that, since the naming of data or buckets or files in the master cluster device and the slave cluster device is unique, the judgment rule may include at least one of the following: within a preset period, the electronic device can traverse the two cluster devices (or target location information) when reading data. If it is found that the two cluster devices have data to be read with the same identifier, the data to be read with the latest write time is read, and the remaining data to be read with the same identifier as the data to be read is deleted to ensure the uniqueness of the identifier (or naming) in the two cluster devices. Alternatively, within a preset period, after the electronic device determines the data to be deleted, it traverses the two clusters (or target location information) and deletes all the data to be deleted in the two cluster devices. Alternatively, within a preset period, after the electronic device determines the data to be written, it can traverse the two cluster devices (or target location information). If the data with the same identifier as the data to be written is found, the data to be written is written, and the data with the same identifier as the data to be written is deleted. Optionally, when deleting data, it can be background asynchronous deletion.
[0121] It should be understood that when the master cluster device or the slave cluster device creates a bucket, reads data, writes data, deletes data, and other operations in response to a request message, it can return a corresponding confirmation message to the electronic device after the execution is completed or fails. For example, after the data to be written is successfully written, a confirmation message of successful writing is returned to the electronic device, and after the data to be written fails, a confirmation message of failed writing is returned to the electronic device.
[0122] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to realize the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0123] The embodiment of the present application can divide the functional modules of the expansion device according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. Optionally, the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0124] like Fig.10 The figure is a schematic diagram of the structure of a capacity expansion device provided in an embodiment of the present application. The capacity expansion device can be used to perform Figure 4-Figure 9 Any of the expansion methods shown in the items. Fig.10 The capacity expansion device shown includes: a processing unit 1001 and a determining unit 1002 .
[0125] The processing unit 1001 is used to perform cluster backup processing on the slave cluster device and establish an association relationship between the slave cluster device and the master cluster device. The cluster backup processing does not include: data synchronization. Figure 4 , the processing unit 901 is used to execute S401.
[0126] The determination unit 1002 is configured to determine a slave cluster device as an expansion device for a master cluster device. Figure 4 , determining unit 1002 is used to execute S402.
[0127] Optionally, the device further includes: an acquiring unit 1003 and a sending unit 1004 .
[0128] The acquisition unit 1003 is used to acquire a first request message, where the first request message is used to request processing of the data to be processed. Figure 5 , the acquisition unit 1003 is used to execute S501.
[0129] The determination unit 1002 is further configured to determine the cluster device corresponding to the data to be processed based on the historical location information if the historical location information contains the location information of the data to be processed; the historical location information is cached data. Figure 5 , the determination unit 1002 is used to execute S502.
[0130] The sending unit 1004 is configured to send a first indication message to the cluster device corresponding to the data to be processed, where the first indication message is used to instruct the cluster device corresponding to the data to be processed to process the data to be processed. Figure 5 , the sending unit 1004 is used to execute S503.
[0131] Optionally, the sending unit 1004 is further configured to send a first request message to the first device if the location information of the data to be processed does not exist in the historical location information, so that the first device determines the cluster device corresponding to the data to be processed based on the target location information, and processes the data to be processed in the cluster device corresponding to the data to be processed; wherein the target location information includes the location information of the data in the master cluster device and the location information of the data in the slave cluster device, and the first device is the master cluster device or the slave cluster device. Figure 6 , the sending unit 1004 is used to execute S601.
[0132] Optionally, the processing unit 1001 is further configured to write the data to be processed into the main cluster device when the data to be processed is data to be written and the data to be processed is associated with the historical data. Figure 7 , processing unit 1001 is used to execute S701.
[0133] The processing unit 1001 is further configured to write the data to be processed into the slave cluster device when the data to be processed is data to be written and there is no association relationship between the data to be processed and the historical data. Figure 7 , processing unit 1001 is used to execute S701.
[0134] Optionally, the acquisition unit 1003 is further configured to acquire a second request message, where the second request message is used to request the creation of a bucket. Figure 8 , the acquisition unit 1003 is used to execute S801.
[0135] The sending unit 1004 is further configured to send a second request message to the slave cluster device, so that the slave cluster device creates a bucket based on the second request message. Figure 8 , the sending unit 1004 is used to execute S802.
[0136] Optionally, the acquisition unit 1003 is further configured to acquire a third request message, where the third request message is used to trigger a change in metadata of the first device, where the first device is a master cluster device or a slave cluster device. Fig. 9 , the acquisition unit 1003 is used to execute S901.
[0137] The sending unit 1004 is further configured to send a third request message to the first device, so that the first device synchronizes the changed metadata to the second device, and the second device is a device other than the first device in the master cluster device and the slave cluster device. Fig. 9 , the sending unit 1004 is used to execute S902.
[0138] An embodiment of the present application also provides a computer-readable storage medium, which includes computer-executable instructions. When the computer-executable instructions are executed on a computer, the computer executes the expansion method provided in the above embodiment.
[0139] The embodiment of the present application also provides a computer program, which can be directly loaded into a memory and contains software code. After being loaded and executed by a computer, the computer program can implement the capacity expansion method provided in the above embodiment.
[0140] Those skilled in the art should be aware that in one or more of the above examples, the functions described in this application can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer-readable storage media and communication media, wherein communication media include any media that facilitates the transmission of computer programs from one place to another. Storage media can be any available media that can be accessed by general or special-purpose computers.
[0141] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0142] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The unit described as a separate component may or may not be physically separated, and the component displayed as a unit may be a physical unit or multiple physical units, that is, it may be located in one place, or it may be distributed in multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the scheme of this embodiment.
[0143] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. 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 readable storage medium. Based on such an understanding, the technical solution of the embodiment 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, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk or an optical disk.
[0144] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A capacity expansion method, characterized in that: include: Performing cluster backup processing on the slave cluster device, establishing an association relationship between the slave cluster device and the master cluster device, wherein the cluster backup processing does not include: data synchronization; The slave cluster device is determined as an expansion device of the master cluster device.
2. The method according to claim 1, characterized in that: The method further comprises: Obtaining a first request message, where the first request message is used to request processing of to-be-processed data; If the location information of the data to be processed exists in the historical location information, the cluster device corresponding to the data to be processed is determined based on the historical location information; the historical location information is cached data; The first indication message is sent to the cluster device corresponding to the data to be processed, where the first indication message is used to instruct the cluster device corresponding to the data to be processed to process the data to be processed.
3. The method according to claim 2, characterized in that The method further comprises: If the location information of the data to be processed does not exist in the historical location information, sending the first request message to the first device, so that the first device determines the cluster device corresponding to the data to be processed based on the target location information, and processes the data to be processed in the cluster device corresponding to the data to be processed; The target location information includes location information of data in the master cluster device and location information of data in the slave cluster device, and the first device is the master cluster device or the slave cluster device.
4. The method according to any one of claims 1 to 3, characterized in that: The data to be processed includes data to be written and / or data to be read; the method further includes: When the data to be processed is data to be written, and there is an association relationship between the data to be processed and historical data, writing the data to be processed into the main cluster device; Alternatively, when the data to be processed is data to be written and there is no association relationship between the data to be processed and the historical data, the data to be processed is written into the slave cluster device.
5. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Obtain a second request message, where the second request message is used to request to create a bucket; The second request message is sent to the slave cluster device, so that the slave cluster device creates a bucket based on the second request message.
6. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Obtaining a third request message, where the third request message is used to trigger a change in metadata of a first device, where the first device is the master cluster device or the slave cluster device; The third request message is sent to the first device, so that the first device synchronizes the changed metadata with a second device, where the second device is a device other than the first device among the master cluster device and the slave cluster devices.
7. A capacity expansion device, characterized in that: comprising a processing unit and a determining unit; The processing unit is used to perform cluster backup processing on the slave cluster device and establish an association relationship between the slave cluster device and the master cluster device, wherein the cluster backup processing does not include: data synchronization; The determining unit is configured to determine the slave cluster device as an expansion device for the master cluster device.
8. A computer program product, characterized in that The computer program product includes computer instructions, and when the computer instructions are executed on a computer, the computer is enabled to execute the capacity expansion method according to any one of claims 1 to 6.
9. A capacity expansion device, characterized in that: It includes a memory and a processor; the memory is used to store computer-executable instructions, and the processor is connected to the memory through a bus; when the expansion device is running, the processor executes the computer-executable instructions stored in the memory, so that the expansion device executes the expansion method as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes computer-executable instructions. When the computer-executable instructions are executed on a computer, the computer is enabled to execute the capacity expansion method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Cluster online capacity expansion method and device, equipment and storage medium
CN114398012A
Method for realizing online non-inductive migration of cloud hard disk in large-scale cluster scene based on COW
CN117971388A
Disaster recovery migration method and system oriented to computing power network
CN118227379A
System and method for migrating storage while in use
US10509567B2
Data distribution method for decentralized distributed heterogeneous storage system
WO2017206649A1
