CN113805807A - Method, device, equipment and readable medium for synchronizing double-control storage array database - Google Patents

Method, device, equipment and readable medium for synchronizing double-control storage array database Download PDF

Info

Publication number
CN113805807A
CN113805807A CN202111064289.XA CN202111064289A CN113805807A CN 113805807 A CN113805807 A CN 113805807A CN 202111064289 A CN202111064289 A CN 202111064289A CN 113805807 A CN113805807 A CN 113805807A
Authority
CN
China
Prior art keywords
controller
safe
database
disk
file system
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.)
Pending
Application number
CN202111064289.XA
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.)
Jinan Inspur Data Technology Co Ltd
Original Assignee
Jinan Inspur Data Technology 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 Jinan Inspur Data Technology Co Ltd filed Critical Jinan Inspur Data Technology Co Ltd
Priority to CN202111064289.XA priority Critical patent/CN113805807A/en
Publication of CN113805807A publication Critical patent/CN113805807A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0689Disk arrays, e.g. RAID, JBOD
    • 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
    • G06F16/275Synchronous replication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/062Securing storage systems
    • G06F3/0622Securing storage systems in relation to access
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/065Replication mechanisms

Landscapes

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

Abstract

The invention provides a method, a device, equipment and a readable medium for synchronizing a double-control storage array database, wherein the method comprises the following steps: selecting two hard disks in a storage array as a safe box disk, and dividing a partition with a preset size in the safe box disk; forming RAID1 equipment by partitions with preset sizes in the safe box disc, and formatting the RAID1 equipment into an XFS file system; setting the priority and the read-write permission of the master controller and the slave controller for accessing the safe box disc; the main controller mounts the XFS file system under a system directory and starts a database service, and stores a generated database file into a safe box disc; in response to receiving a request for database update, the primary controller database service writes data into a database file; and responding to the fault of the main controller, the controller acquires the read-write permission of the safe disk, mounts the XFS file system under a system directory, and starts database service. By using the scheme of the invention, the consistency of the main database and the standby database can be effectively ensured, and the information loss of the databases is prevented.

Description

Method, device, equipment and readable medium for synchronizing double-control storage array database
Technical Field
The present invention relates to the field of computers, and more particularly, to a method, an apparatus, a device and a readable medium for synchronization of a dual-control storage array database.
Background
With the explosive growth of data and the development of storage technology, the dual-control storage array gradually becomes a storage mode for improving the reliability of data, and is widely applied. The existing double-control storage array is generally managed by a web system for storage resources, and storage resource information of users, hard disks, storage pools, logic volumes and the like in the storage array is stored in a Database (DB), so that the double-control storage array is an important information source for realizing data recovery and master-slave switching.
In the existing database synchronization technology, designated areas are divided in a main controller and a system disk of a controller for storing database files, database information is updated on the main controller and periodically synchronized to the controller, and because the system disk is isolated between double controls, the database information synchronization needs to be realized by means of network transmission and the like, and when a network shakes, problems of split brain, data overtime synchronization and the like are easily caused; in addition, when the main controller fails (such as abnormal power failure or downtime), if database synchronization is being performed, the contents of the main controller and the database of the slave controller are inconsistent. Therefore, the existing database synchronization technology has the problems of complex realization, inconsistent main and standby databases, database information loss and the like.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, a device, and a readable medium for synchronizing a dual-control storage array database, which can effectively ensure consistency between a master database and a standby database and prevent database information loss.
Based on the above purpose, the present invention provides a method for synchronizing a dual-control storage array database, which comprises the following steps:
selecting two hard disks in a storage array as a safe box disk, and dividing a partition with a preset size in the safe box disk;
forming partitions with preset sizes in a safe box disc into RAID1(Redundant Arrays of Independent Disks Level 1, data redundancy is realized by disk data mirroring) equipment, and formatting the equipment into an XFS (X File System, a high-performance log File System) File System;
setting the priority and the read-write permission of the master controller and the slave controller for accessing the safe box disc;
the main controller mounts the XFS file system under a system directory and starts a database service, and stores a generated database file into a safe box disc;
in response to receiving a request for database update, the primary controller database service writes data into a database file;
and responding to the fault of the main controller, the controller acquires the read-write permission of the safe disk, mounts the XFS file system under a system directory, and starts database service.
According to an embodiment of the present invention, selecting two hard disks in a storage array as a safe disk, and dividing a partition of a preset size in the safe disk comprises:
selecting hard disks of the No. 0 slot position and the No. 1 slot position in the double-control storage array as safe disks;
in any controller, a hard disk of the slot No. 0 is partitioned by using a partitioning tool, and a 4G-sized partition space/dev/sdb 1 is partitioned;
in any controller, the hard disk of the slot No. 1 is partitioned by using a partitioning tool, and a partition space/dev/sdc 1 with the size of 4G is partitioned.
According to one embodiment of the present invention, composing a predetermined size of partition in a safe disk into a RAID1 device and formatting as an XFS file system comprises:
composing the safe disk partitions/dev/sdb 1 and/dev/sdc 1 into RAID1 devices using commands in either controller;
commands are used in either controller to format the RAID1 device as an XFS file system.
According to one embodiment of the invention, setting the priority and the read-write authority of the main controller and the controller for accessing the safe box disc comprises the following steps:
responding to the main controller and the backup controller not having faults, wherein the main controller has the read-write permission of the safe box disc, and the backup controller has the read-only permission;
in response to a failure or absence of the primary controller, the secondary controller has read and write access to the safe disk.
According to one embodiment of the invention, in response to a failure of the main controller, the controller acquires the read-write permission of the safe disk and mounts the XFS file system under the system directory, and the starting of the database service comprises:
in response to a primary controller failure, marking a backup controller as a new primary controller;
the new main controller imports RAID1 formed by safe disks and mounts an XFS file system under a system directory;
the new master controller reads the database file and starts the database service.
In another aspect of the embodiments of the present invention, there is also provided a device for synchronizing a dual-control storage array database, where the device includes:
the dividing module is configured to select two hard disks in the storage array as a safe box disc and divide a partition with a preset size in the safe box disc;
the conversion module is configured to form RAID1 equipment by partitions with preset sizes in the safe box disc and format the RAID1 equipment into an XFS file system;
the setting module is configured to set the priority and the read-write permission of the master controller and the slave controller for accessing the safe box disc;
the mounting module is configured to mount the XFS file system to a system directory by the main controller, start a database service and store the generated database file into a safe box disc;
a write module configured to write data to the database file by the master controller database service in response to receiving a request for database update;
and the starting module is configured to respond to the fault of the main controller, and the controller acquires the read-write permission of the safe disc, mounts the XFS file system to the system directory and starts the database service.
According to an embodiment of the invention, the partitioning module is further configured to:
selecting hard disks of the No. 0 slot position and the No. 1 slot position in the double-control storage array as safe disks;
in any controller, a hard disk of the slot No. 0 is partitioned by using a partitioning tool, and a 4G-sized partition space/dev/sdb 1 is partitioned;
in any controller, the hard disk of the slot No. 1 is partitioned by using a partitioning tool, and a partition space/dev/sdc 1 with the size of 4G is partitioned.
According to one embodiment of the invention, the conversion module is further configured to:
composing the safe disk partitions/dev/sdb 1 and/dev/sdc 1 into RAID1 devices using commands in either controller;
commands are used in either controller to format the RAID1 device as an XFS file system.
In another aspect of an embodiment of the present invention, there is also provided a computer apparatus including:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method set forth above.
In another aspect of embodiments of the present invention, there is also provided a computer readable storage medium, storing a computer program which, when executed by a processor, implements the steps of the method set forth above.
The invention has the following beneficial technical effects: the method for synchronizing the double-control storage array database provided by the technical scheme of the invention selects two hard disks in a storage array as a safe box disk, and divides a partition with a preset size in the safe box disk; forming RAID1 equipment by partitions with preset sizes in the safe box disc, and formatting the RAID1 equipment into an XFS file system; setting the priority and the read-write permission of the master controller and the slave controller for accessing the safe box disc; the main controller mounts the XFS file system under a system directory and starts a database service, and stores a generated database file into a safe box disc; in response to receiving a request for database update, the primary controller database service writes data into a database file; in response to the failure of the main controller, the controller acquires the read-write permission of the safe disk, mounts the XFS file system under the system directory, and starts the database service, so that the consistency of the main database and the standby database can be effectively ensured, and the information loss of the databases is prevented.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
FIG. 1 is a schematic flow diagram of a method of dual-steering storage array database synchronization according to one embodiment of the present invention;
FIG. 2 is a diagram illustrating an apparatus for dual-ported storage array database synchronization according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a computer device according to one embodiment of the present invention;
fig. 4 is a schematic diagram of a computer-readable storage medium according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
In view of the above, a first aspect of the embodiments of the present invention provides an embodiment of a method for synchronization of a dual-managed storage array database. Fig. 1 shows a schematic flow diagram of the method.
As shown in fig. 1, the method may include the steps of:
s1, selecting two hard disks in the storage array as safe boxes, and dividing the safe boxes into partitions with preset sizes.
Hard disks of the slot 0 and the slot 1 in the double-control storage array are selected as safe disks, a partition tool is used in any controller to partition the hard disk of the slot 0, partition space/dev/sdb 1 with the size of 4G is divided, a partition tool is used in any controller to partition the hard disk of the slot 1, and partition space/dev/sdc 1 with the size of 4G is divided.
S2, the partitions with preset sizes in the safe disk are combined into RAID1 equipment and formatted into an XFS file system.
The partitions/dev/sdb 1 and/dev/sdc 1 of the two safe disks are grouped into a RAID1 device using commands in either controller, the RAID1 device has data redundancy capabilities, and then the RAID1 device is formatted into an XFS file system using commands in either controller.
S3 sets the priority and read-write authority of the master and slave controllers to access the safe tray.
When the master controller and the slave controller are normal, the master controller has the read-write permission of the safe deposit box disc and can execute read operation and write operation, the slave controller only has the read-only permission and cannot execute write operation, and when the master controller fails or is not in place, the slave controller has the read-write permission of the safe deposit box disc and can execute read operation and write operation.
S4 the host controller mounts the XFS file system to the system directory and starts database services and saves the generated database files to the safe' S tray.
When the two controllers are normal, the main controller has the read-write permission of the safe box disc, the XFS file system is mounted to the system catalog, the main controller starts database service to generate a database file, the database file is stored in the XFS file system and finally stored in the safe box disc, and the main controller provides the database service.
S5 in response to receiving the request for a database update, the master controller database service writes the data to a database file.
The main controller receives a request for updating the database, the database service executes read-write operation on the database file, and when the database file has write-in operation, the data is written into the safe box disc.
S6 responds to the failure of the main controller, the controller obtains the read-write authority of the safe disk, mounts the XFS file system under the system directory, and starts the database service.
When the main controller fails due to some reasons such as power failure or downtime, the backup controller is marked as the main controller, the backup controller has the read-write permission of the safe disk, the backup controller imports RAID1 equipment consisting of the safe disk, meanwhile mounts an XFS file system under a system directory, reads database files, starts database service, continues to provide the database service, and responds to the latest database request to perform database updating operation.
The invention aims to provide a database synchronization method aiming at a double-control storage array, wherein two shared hard disks in the array are selected as safe disks, database files are stored in the safe disks, the synchronization of a main database and a standby database can be realized without additional synchronization operation, and meanwhile, when the main database and the standby database are switched, a controller has the access right of the database files in the safe disks, takes over database service, and the method has the advantages of being simple to realize, effectively ensuring the consistency of the main database and the standby database, preventing database information from being lost and the like.
By the technical scheme of the invention, the consistency of the main database and the standby database can be effectively ensured, and the information loss of the databases is prevented.
In a preferred embodiment of the present invention, selecting two hard disks in a storage array as a safe disk, and dividing a partition of a preset size in the safe disk includes:
selecting hard disks of the No. 0 slot position and the No. 1 slot position in the double-control storage array as safe disks;
in any controller, a hard disk of the slot No. 0 is partitioned by using a partitioning tool, and a 4G-sized partition space/dev/sdb 1 is partitioned;
in any controller, the hard disk of the slot No. 1 is partitioned by using a partitioning tool, and a partition space/dev/sdc 1 with the size of 4G is partitioned. In other embodiments, the hard disks in any two slots may be selected as safe disks, and the division space may also be selected based on actual requirements.
In a preferred embodiment of the present invention, the forming of a RAID1 device from a predetermined size of partitions in a safe's disk and formatting as an XFS file system comprises:
composing the safe disk partitions/dev/sdb 1 and/dev/sdc 1 into RAID1 devices using commands in either controller;
commands are used in either controller to format the RAID1 device as an XFS file system.
In a preferred embodiment of the present invention, setting the priority and read-write authority of the master controller and the slave controller to access the safe deposit box tray comprises:
responding to the main controller and the backup controller not having faults, wherein the main controller has the read-write permission of the safe box disc, and the backup controller has the read-only permission;
in response to a failure or absence of the primary controller, the secondary controller has read and write access to the safe disk.
In a preferred embodiment of the present invention, in response to a failure of the main controller, the controller obtains the read-write permission of the safe disk, and mounts the XFS file system under the system directory, and the starting of the database service includes:
in response to a primary controller failure, marking a backup controller as a new primary controller;
the new main controller imports RAID1 formed by safe disks and mounts an XFS file system under a system directory;
the new master controller reads the database file and starts the database service.
By the technical scheme of the invention, the consistency of the main database and the standby database can be effectively ensured, and the information loss of the databases is prevented.
It should be noted that, as will be understood by those skilled in the art, all or part of the processes in the methods of the above embodiments may be implemented by instructing relevant hardware through a computer program, and the above programs may be stored in a computer-readable storage medium, and when executed, the programs may include the processes of the embodiments of the methods as described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.
Furthermore, the method disclosed according to an embodiment of the present invention may also be implemented as a computer program executed by a CPU, and the computer program may be stored in a computer-readable storage medium. The computer program, when executed by the CPU, performs the above-described functions defined in the method disclosed in the embodiments of the present invention.
In view of the above, according to a second aspect of the embodiments of the present invention, there is provided an apparatus for synchronization of a dual-managed storage array database, as shown in fig. 2, the apparatus 200 includes:
the system comprises a dividing module 201, wherein the dividing module 201 is configured to select two hard disks in a storage array as a safe box disc, and divide a partition with a preset size in the safe box disc;
the system comprises a conversion module 202, wherein the conversion module 202 is configured to form RAID1 equipment by partitions with preset sizes in safe disks and format the RAID1 equipment into an XFS file system;
the setting module 203, the setting module 203 is configured to set the priority and the read-write permission of the master controller and the slave controller for accessing the safe box disc;
the mount module 204, the mount module 204 is configured to mount the XFS file system to a system directory by the main controller, start a database service, and store the generated database file in a safe disk;
a write module 205, the write module 205 configured to, in response to receiving a request for a database update, write data to the database file by the master controller database service;
and the starting module 206, wherein the starting module 206 is configured to respond to the failure of the main controller, and the controller acquires the read-write permission of the safe disc, mounts the XFS file system to the system directory, and starts the database service.
In a preferred embodiment of the present invention, the dividing module 201 is further configured to:
selecting hard disks of the No. 0 slot position and the No. 1 slot position in the double-control storage array as safe disks;
in any controller, a hard disk of the slot No. 0 is partitioned by using a partitioning tool, and a 4G-sized partition space/dev/sdb 1 is partitioned;
in any controller, the hard disk of the slot No. 1 is partitioned by using a partitioning tool, and a partition space/dev/sdc 1 with the size of 4G is partitioned.
In a preferred embodiment of the present invention, the conversion module is further configured to:
composing the safe disk partitions/dev/sdb 1 and/dev/sdc 1 into RAID1 devices using commands in either controller;
commands are used in either controller to format the RAID1 device as an XFS file system.
In view of the above object, a third aspect of the embodiments of the present invention provides a computer device. Fig. 3 is a schematic diagram of an embodiment of a computer device provided by the present invention. As shown in fig. 3, an embodiment of the present invention includes the following means: at least one processor 21; and a memory 22, the memory 22 storing computer instructions 23 executable on the processor, the instructions when executed by the processor implementing the method of:
selecting two hard disks in a storage array as a safe box disk, and dividing a partition with a preset size in the safe box disk;
forming RAID1 equipment by partitions with preset sizes in the safe box disc, and formatting the RAID1 equipment into an XFS file system;
setting the priority and the read-write permission of the master controller and the slave controller for accessing the safe box disc;
the main controller mounts the XFS file system under a system directory and starts a database service, and stores a generated database file into a safe box disc;
in response to receiving a request for database update, the primary controller database service writes data into a database file;
and responding to the fault of the main controller, the controller acquires the read-write permission of the safe disk, mounts the XFS file system under a system directory, and starts database service.
In a preferred embodiment of the present invention, selecting two hard disks in a storage array as a safe disk, and dividing a partition of a preset size in the safe disk includes:
selecting hard disks of the No. 0 slot position and the No. 1 slot position in the double-control storage array as safe disks;
in any controller, a hard disk of the slot No. 0 is partitioned by using a partitioning tool, and a 4G-sized partition space/dev/sdb 1 is partitioned;
in any controller, the hard disk of the slot No. 1 is partitioned by using a partitioning tool, and a partition space/dev/sdc 1 with the size of 4G is partitioned.
In a preferred embodiment of the present invention, the forming of a RAID1 device from a predetermined size of partitions in a safe's disk and formatting as an XFS file system comprises:
composing the safe disk partitions/dev/sdb 1 and/dev/sdc 1 into RAID1 devices using commands in either controller;
commands are used in either controller to format the RAID1 device as an XFS file system.
In a preferred embodiment of the present invention, setting the priority and read-write authority of the master controller and the slave controller to access the safe deposit box tray comprises:
responding to the main controller and the backup controller not having faults, wherein the main controller has the read-write permission of the safe box disc, and the backup controller has the read-only permission;
in response to a failure or absence of the primary controller, the secondary controller has read and write access to the safe disk.
In a preferred embodiment of the present invention, in response to a failure of the main controller, the controller obtains the read-write permission of the safe disk, and mounts the XFS file system under the system directory, and the starting of the database service includes:
in response to a primary controller failure, marking a backup controller as a new primary controller;
the new main controller imports RAID1 formed by safe disks and mounts an XFS file system under a system directory;
the new master controller reads the database file and starts the database service.
In view of the above object, a fourth aspect of the embodiments of the present invention proposes a computer-readable storage medium. FIG. 4 is a schematic diagram illustrating an embodiment of a computer-readable storage medium provided by the present invention. As shown in fig. 4, the computer-readable storage medium 31 stores a computer program 32 that, when executed by a processor, performs the method of:
selecting two hard disks in a storage array as a safe box disk, and dividing a partition with a preset size in the safe box disk;
forming RAID1 equipment by partitions with preset sizes in the safe box disc, and formatting the RAID1 equipment into an XFS file system;
setting the priority and the read-write permission of the master controller and the slave controller for accessing the safe box disc;
the main controller mounts the XFS file system under a system directory and starts a database service, and stores a generated database file into a safe box disc;
in response to receiving a request for database update, the primary controller database service writes data into a database file;
and responding to the fault of the main controller, the controller acquires the read-write permission of the safe disk, mounts the XFS file system under a system directory, and starts database service.
In a preferred embodiment of the present invention, selecting two hard disks in a storage array as a safe disk, and dividing a partition of a preset size in the safe disk includes:
selecting hard disks of the No. 0 slot position and the No. 1 slot position in the double-control storage array as safe disks;
in any controller, a hard disk of the slot No. 0 is partitioned by using a partitioning tool, and a 4G-sized partition space/dev/sdb 1 is partitioned;
in any controller, the hard disk of the slot No. 1 is partitioned by using a partitioning tool, and a partition space/dev/sdc 1 with the size of 4G is partitioned.
In a preferred embodiment of the present invention, the forming of a RAID1 device from a predetermined size of partitions in a safe's disk and formatting as an XFS file system comprises:
composing the safe disk partitions/dev/sdb 1 and/dev/sdc 1 into RAID1 devices using commands in either controller;
commands are used in either controller to format the RAID1 device as an XFS file system.
In a preferred embodiment of the present invention, setting the priority and read-write authority of the master controller and the slave controller to access the safe deposit box tray comprises:
responding to the main controller and the backup controller not having faults, wherein the main controller has the read-write permission of the safe box disc, and the backup controller has the read-only permission;
in response to a failure or absence of the primary controller, the secondary controller has read and write access to the safe disk.
In a preferred embodiment of the present invention, in response to a failure of the main controller, the controller obtains the read-write permission of the safe disk, and mounts the XFS file system under the system directory, and the starting of the database service includes:
in response to a primary controller failure, marking a backup controller as a new primary controller;
the new main controller imports RAID1 formed by safe disks and mounts an XFS file system under a system directory;
the new master controller reads the database file and starts the database service.
Furthermore, the methods disclosed according to embodiments of the present invention may also be implemented as a computer program executed by a processor, which may be stored in a computer-readable storage medium. Which when executed by a processor performs the above-described functions defined in the methods disclosed in embodiments of the invention.
Further, the above method steps and system elements may also be implemented using a controller and a computer readable storage medium for storing a computer program for causing the controller to implement the functions of the above steps or elements.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments of the present invention.
In one or more exemplary designs, the functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Also, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, Digital Versatile Disc (DVD), floppy disk, blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (10)

1. A method for synchronizing a double-control storage array database is characterized by comprising the following steps:
selecting two hard disks in a storage array as a safe box disk, and dividing a partition with a preset size in the safe box disk;
forming RAID1 equipment by the partitions with preset sizes in the safe box disc, and formatting the equipment into an XFS file system;
setting the priority and the read-write permission of the master controller and the slave controller for accessing the safe box disc;
the main controller mounts the XFS file system to a system directory and starts a database service, and stores a generated database file into the safe box disc;
in response to receiving a request for a database update, the master controller database service writing data into a database file;
and responding to the fault of the main controller, the controller acquires the read-write permission of the safe box disc, mounts the XFS file system to a system directory, and starts database service.
2. The method of claim 1, wherein selecting two hard disks in a storage array as safe deposit boxes and dividing a partition of a predetermined size in the safe deposit boxes comprises:
selecting hard disks of the No. 0 slot position and the No. 1 slot position in the double-control storage array as safe disks;
partitioning the hard disk of the slot No. 0 by using a partitioning tool in any controller to partition a partition space/dev/sdb 1 with the size of 4G;
and partitioning the hard disk of the No. 1 slot by using a partitioning tool in any controller to partition a 4G-sized partition space/dev/sdc 1.
3. The method of claim 2, wherein composing the pre-sized partitions in the safe disk into RAID1 devices and formatting as an XFS file system comprises:
composing the safe disk partitions/dev/sdb 1 and/dev/sdc 1 into RAID1 devices using commands in either controller;
commands are used in either controller to format the RAID1 device as an XFS file system.
4. The method of claim 1, wherein setting the priority and read-write rights of the master and slave controllers to access the safe deposit box tray comprises:
responding to the fact that the main controller and the backup controller do not have faults, wherein the main controller has the read-write permission of the safe box disc, and the backup controller has the read-only permission;
in response to the master controller failing or not being in place, the slave controller has read and write access to the safe deposit box tray.
5. The method of claim 1, wherein in response to the master controller failing, the slave controller obtaining read-write privileges for the safe deposit box disk and mounting the XFS file system under a system directory, initiating database services comprises:
in response to the primary controller failure, marking the secondary controller as a new primary controller;
the new main controller imports RAID1 formed by safe disks and mounts the XFS file system under a system directory;
the new master controller reads the database file and starts the database service.
6. An apparatus for bi-controlling storage array database synchronization, the apparatus comprising:
the device comprises a dividing module, a storage module and a judging module, wherein the dividing module is configured to select two hard disks in a storage array as a safe box disc and divide a partition with a preset size in the safe box disc;
the conversion module is configured to form RAID1 equipment by partitions with preset sizes in the safe box disc and format the RAID1 equipment into an XFS file system;
the setting module is configured to set the priority and the read-write permission of the master controller and the slave controller for accessing the safe box disc;
the mount module is configured to mount the XFS file system to a system directory by the main controller, start a database service and store a generated database file into the safe disc;
a write module configured to write data to a database file by the master controller database service in response to receiving a request for a database update;
and the starting module is configured to respond to the fault of the main controller, and the controller acquires the read-write permission of the safe disc, mounts the XFS file system to a system directory and starts database service.
7. The apparatus of claim 6, wherein the partitioning module is further configured to:
selecting hard disks of the No. 0 slot position and the No. 1 slot position in the double-control storage array as safe disks;
partitioning the hard disk of the slot No. 0 by using a partitioning tool in any controller to partition a partition space/dev/sdb 1 with the size of 4G;
and partitioning the hard disk of the No. 1 slot by using a partitioning tool in any controller to partition a 4G-sized partition space/dev/sdc 1.
8. The apparatus of claim 7, wherein the conversion module is further configured to:
composing the safe disk partitions/dev/sdb 1 and/dev/sdc 1 into RAID1 devices using commands in either controller;
commands are used in either controller to format the RAID1 device as an XFS file system.
9. A computer device, comprising:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method of any one of claims 1 to 5.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 5.
CN202111064289.XA 2021-09-10 2021-09-10 Method, device, equipment and readable medium for synchronizing double-control storage array database Pending CN113805807A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111064289.XA CN113805807A (en) 2021-09-10 2021-09-10 Method, device, equipment and readable medium for synchronizing double-control storage array database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111064289.XA CN113805807A (en) 2021-09-10 2021-09-10 Method, device, equipment and readable medium for synchronizing double-control storage array database

Publications (1)

Publication Number Publication Date
CN113805807A true CN113805807A (en) 2021-12-17

Family

ID=78895070

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111064289.XA Pending CN113805807A (en) 2021-09-10 2021-09-10 Method, device, equipment and readable medium for synchronizing double-control storage array database

Country Status (1)

Country Link
CN (1) CN113805807A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040111250A1 (en) * 2002-12-10 2004-06-10 Hensley John Alan Emulated read-write disk drive using a protected medium
CN109446169A (en) * 2018-10-22 2019-03-08 北京计算机技术及应用研究所 A kind of double control disk array shared-file system
CN110618785A (en) * 2018-12-24 2019-12-27 深圳创新科软件技术有限公司 Dual-control storage system
CN110941515A (en) * 2019-12-04 2020-03-31 深圳市科力锐科技有限公司 Host backup reconstruction method, device, server and storage medium
CN111897676A (en) * 2020-07-15 2020-11-06 北京天顶星智能信息技术有限公司 File backup method and device based on database index

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040111250A1 (en) * 2002-12-10 2004-06-10 Hensley John Alan Emulated read-write disk drive using a protected medium
CN109446169A (en) * 2018-10-22 2019-03-08 北京计算机技术及应用研究所 A kind of double control disk array shared-file system
CN110618785A (en) * 2018-12-24 2019-12-27 深圳创新科软件技术有限公司 Dual-control storage system
CN110941515A (en) * 2019-12-04 2020-03-31 深圳市科力锐科技有限公司 Host backup reconstruction method, device, server and storage medium
CN111897676A (en) * 2020-07-15 2020-11-06 北京天顶星智能信息技术有限公司 File backup method and device based on database index

Similar Documents

Publication Publication Date Title
US6823474B2 (en) Method and system for providing cluster replicated checkpoint services
US8433947B2 (en) Computer program, method, and apparatus for controlling data allocation
US7213116B2 (en) Method and apparatus for mirroring objects between storage systems
US6950915B2 (en) Data storage subsystem
CN103780638B (en) Method of data synchronization and system
EP1150210B1 (en) Method for duplicating data of storage subsystem and data duplicating system
CN110597910A (en) Remote data synchronization method, device and system
CN104935654A (en) Caching method, write point client and read client in server cluster system
US7702757B2 (en) Method, apparatus and program storage device for providing control to a networked storage architecture
JP2018073231A (en) Storage system and storage device
CN113268472A (en) Distributed data storage system and method
CN115292408A (en) Master-slave synchronization method, device, equipment and medium for MySQL database
CN109189326B (en) Management method and device of distributed cluster
CN113608691A (en) High-availability method and device for NFS (network file system) of storage array
CN113805807A (en) Method, device, equipment and readable medium for synchronizing double-control storage array database
CN105975528B (en) Synchronization method, device and system for background configuration file
JP4512386B2 (en) Backup system and method
US20110296126A1 (en) Storage system
CN114610545A (en) Method, system, device and medium for reducing single point of failure of private cloud computing
CN104778180B (en) Cloud storage metadata processing system
CN107404511A (en) The replacement method and equipment of server in cluster
CN112131191A (en) Management method, device and equipment of NAMENODE file system
US20090271579A1 (en) Storage subsystem and storage system
JP2005316624A (en) Database reorganization program, database reorganization method, and database reorganization device
CN111428270A (en) Distributed storage method and system for database based on optical disk

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