CN110045991B - RAID configuration method and device of server, computer equipment and storage medium - Google Patents

RAID configuration method and device of server, computer equipment and storage medium Download PDF

Info

Publication number
CN110045991B
CN110045991B CN201910176264.5A CN201910176264A CN110045991B CN 110045991 B CN110045991 B CN 110045991B CN 201910176264 A CN201910176264 A CN 201910176264A CN 110045991 B CN110045991 B CN 110045991B
Authority
CN
China
Prior art keywords
file
server
raid
configuration
mode
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.)
Active
Application number
CN201910176264.5A
Other languages
Chinese (zh)
Other versions
CN110045991A (en
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910176264.5A priority Critical patent/CN110045991B/en
Publication of CN110045991A publication Critical patent/CN110045991A/en
Application granted granted Critical
Publication of CN110045991B publication Critical patent/CN110045991B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present application relates to the field of operation and maintenance technologies, and in particular, to a RAID configuration method and apparatus for a server, a computer device, and a storage medium. The method comprises the following steps: starting a plurality of servers by PXE; acquiring a mode set by a network card ROM of each server; if the mode is a UEFI mode, downloading a first starting software package from a preset first path to a corresponding server, executing the BOOTX64.EFI file, guiding the grub.cfg configuration file to load a Vmlinux file and an initrd.img file on the server, and entering a BOOTOS; if the mode is the LEGACY mode, downloading a second starting software package from a preset second path to a corresponding server, executing the gpxelinux.0 file, guiding the default configuration file to load a Vmlinux file and an initrd.img file to the server, and entering BOOTOS; and sending RAID commands to the servers through a web interface, and carrying out RAID automatic configuration on the servers. The RAID configuration method realizes batch automatic RAID processing, and aims to solve the problems of more time consumption, low efficiency and high configuration cost of RAID configuration of the existing server.

Description

RAID configuration method and device for server, computer equipment and storage medium
Technical Field
The present application relates to the field of operation and maintenance technologies, and in particular, to a RAID configuration method and apparatus for a server, a computer device, and a storage medium.
Background
Currently, when RAID (Redundant Arrays of Independent Drives) configuration is performed on a server, a user is required to perform manual operation. Firstly, a display is connected to a server, each setting interface of the server is displayed through the display, a user operates according to each setting interface, enters a RAID setting interface, and then performs RAID configuration on the server manually on the RAID setting interface.
Content of application
Aiming at the defects in the prior art, the application provides a RAID configuration method and device of a server, computer equipment and a storage medium, and aims to solve the problems of more time consumption, low efficiency and high configuration cost of RAID configuration of the existing server.
The technical scheme provided by the application is as follows:
a method of RAID configuration of a server, the method comprising:
starting a plurality of servers by PXE;
acquiring modes set by a network card ROM of each server, wherein the modes comprise a UEFI mode or a LEAGACY mode;
if the mode is a UEFI mode, downloading a first starting software package from a preset first path to a corresponding server, wherein the first starting software package comprises a BOOTX64.EFI file, a grub.cfg configuration file, a Vmlinux file and an initrd.img file;
executing the BOOTX64.EFI file, reading the grub.cfg configuration file, loading a Vmlinux file and an initrd.img file by the server according to a path provided in the grub.cfg configuration file, and entering a BOOTOS;
if the mode is the LEGACY mode, downloading a second starting software package to a corresponding server from a preset second path, wherein the second starting software package comprises a gpxelinux.0 file, a default configuration file, a Vmlinux file and an initrd.img file;
executing the gpxelinux.0 file, reading the default configuration file, loading a Vmlinux file and an initrd.img file by the server according to a path provided in the default configuration file, and entering a BOOTOS;
and sending RAID commands to the servers through a web interface, and carrying out RAID automatic configuration on the servers.
Further, in the step of executing the bootx64.efi file, directing the grub.cfg configuration file to load the Vmlinux file and initrd.img file to the server, and entering the BOOTOS, the method includes:
acquiring MAC information of the server;
modifying the file name of the grub.cfg configuration file into MAC information to obtain a second configuration file;
and executing the BOOTX64.EFI file, guiding the second configuration file to load the Vmlinux file and the initrd. img file on the server, and entering the BOOTOS.
Further, after the step of sending a RAID command to each server through the web interface and performing RAID auto configuration on each server, the method includes:
obtaining RAID information of each server;
and storing the RAID information of each server into a designated mysql database through a josn format.
Further, after the step of storing the RAID information of each server in a designated mysql database by a josn format, the method includes:
reading RAID information of each server from the mysql database;
comparing the RAID information of each server with corresponding preset RAID information, wherein each server corresponds to one preset RAID information;
if the RAID configuration is the same, judging that the RAID configuration of the corresponding server is correct;
and if not, judging that the RAID configuration of the corresponding server is wrong.
Further, after the step of storing the RAID information of each server in a designated mysql database by a josn format, the method includes:
displaying RAID information of each server;
receiving identifiers of RAID information of each server input by a user, wherein the identifiers comprise a first identifier and a second identifier, the first identifier is an identifier which shows that the RAID information of each server is wrong, and the second identifier is an identifier which shows that the RAID information of each server is correct;
identifying a type of the identifier;
if the identifier is the second identifier, judging that the RAID configuration of the corresponding server is correct;
and if the identifier is the first identifier, judging that the RAID configuration of the corresponding server is wrong.
Further, after the step of determining that the RAID configuration of the corresponding server is incorrect, the method includes:
marking a server with the RAID configuration as an error to obtain a target server;
sending the RAID command to the target server again;
and if the RAID configuration of the target server is detected to be wrong after the three RAID commands are sent, starting the target server again by PXE, and clearing the RAID configuration of the target server.
Further, in the step of executing the gpxelinux.0 file, guiding the default configuration file to load the Vmlinux file and initrd.img file to the server, and entering the BOOTOS, the step includes:
acquiring MAC information of the server;
modifying the file name of the default configuration file into MAC information to obtain a first configuration file;
and executing the gpxelinux.0 file, guiding the first configuration file to load a Vmlinux file and an initrd.img file to the server, and entering the BOOTOS.
The present application further provides a RAID configuration apparatus for a server, the apparatus including:
the starting module is used for starting the PXE of the servers;
the acquisition module is used for acquiring the mode set by the network card ROM of each server, wherein the mode comprises a UEFI mode or a LEAGACY mode;
the first downloading module is used for downloading a first starting software package to a corresponding server from a preset first path if the mode is a UEFI mode, wherein the first starting software package comprises a BOOTX64.EFI file, a grub.cfg configuration file, a Vmlinux file and an initrd.img file;
the first processing module executes the BOOTX64.EFI file, reads the grub.cfg configuration file, and enables the server to load a Vmlinux file and an initrd.img file according to a path provided in the grub.cfg configuration file and enter the BOOTOS;
a second downloading module, configured to download, if the mode is the LEGACY mode, a second startup software package from a preset second path to a corresponding server, where the second startup software package includes a gpxelinux.0 file, a default configuration file, a Vmlinux file, and an initrd.img file;
the second processing module is used for executing the gpxelinux.0 file, reading the default configuration file, and loading the Vmlinux file and the initrd.img file into the BOOTOS by the server according to a path provided in the default configuration file;
and the configuration module is used for sending RAID commands to the servers through a web interface and carrying out RAID automatic configuration on the servers.
The present application further provides a computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the steps of the method of any one of the above when executing the computer program.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the method of any of the above.
According to the technical scheme, the method has the advantages that: PXE starting is carried out on a plurality of servers, a mode set by a network card ROM of each server is obtained, if the mode is a UEFI mode, a first starting software package is adopted for guiding to enter BOOTOS, if the mode is an LEGACY mode, a second starting software package is adopted for guiding to enter BOOTOS, RAID automatic configuration is carried out on each server through a web interface in the BOOTOS, batch automatic RAID processing is achieved, and the problems that RAID configuration of an existing server is time-consuming, low in efficiency and high in configuration cost are solved.
Drawings
FIG. 1 is a flowchart of a RAID configuration method for a server according to an embodiment of the present application;
FIG. 2 is a functional block diagram of a RAID configuration apparatus to which a server provided by an embodiment of the present application is applied;
fig. 3 is a block diagram schematically illustrating a structure of a computer device provided by an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
As shown in fig. 1, an embodiment of the present application provides a RAID configuration method for a server, where the method includes the following steps:
step S101, PXE starting is carried out on a plurality of servers.
The multiple servers are servers needing RAID configuration, the English full name of PXE is preboot execution environment, and the name of Chinese is preboot execution environment.
And step S102, obtaining the mode set by the network card ROM of each server, wherein the mode comprises a UEFI mode or a LEAGACY mode.
The method comprises the steps of detecting a mode set by a network card ROM of a server, and obtaining the mode set by the network card ROM through setting a PXE client parameter in the network card ROM, wherein a UEFI mode and an LEGACY mode are two different boot modes, the UEFI mode is a novel BIOS, the LEGACY mode is a traditional BIOS, the UEFI is a UnifiedExtensible Firmware Interface in English, and the Chinese name is a Unified Extensible Firmware Interface. The UEFI mode and the LEAGACY mode need different starting software packages, the UEFI mode corresponds to a first starting software package, and the LEAGACY mode corresponds to a second starting software package. The program in the PXE client enters the memory and displays a command menu, which starts looking for a network boot program.
Step S103, if the mode is the UEFI mode, downloading a first starting software package from a preset first path to a corresponding server, wherein the first starting software package comprises a BOOTX64.EFI file, a grub.cfg configuration file, a Vmlinux file and an initrd.img file.
And step S104, executing the BOOTX64.EFI file, after the grub.cfg configuration file is read, loading a Vmlinux file initrd.img file by the server according to a path provided in the grub.cfg configuration file, and entering BOOTOS.
And if the user equipment is in the UEFI mode, downloading the first starting software package, storing the first starting software package in a cache of the server, and loading the boot operating system through the file in the first starting software package. And executing the BOOTX64.EFI file, reading the grub.cfg configuration file, loading the Vmlinux file and the initrd.img file by the server according to a path provided in the configuration file, loading the Vmlinux file and the initrd.img file into a memory, and entering the BOOTOS. The traditional mode in the process of executing BOOTX64.EFI is to acquire grub.cfg configuration files in an IP mode, and one problem of the mode is that if the time lease allocated by DHCP is too short and tftp downloads files for too long, the IP is easy to change, so that the configuration files are easy to acquire failure. The formation of the MAC file is controlled by compiling the kernel and adding the parameters, so that an efficient boot loading mode is realized. BOOTOS is the abbreviation of Boot Operating System, and Chinese means to start the Operating System.
In some embodiments, in step S104, the method includes:
acquiring MAC information of the server;
modifying the file name of the grub.cfg configuration file into MAC information to obtain a second configuration file;
and executing the BOOTX64.EFI file, guiding the second configuration file to load the Vmlinux file and the initrd.img file to the server, and entering BOOTOS.
Cfg profile is a default profile name, and there may be a grub.cfg profile in other files, and due to uniqueness of MAC information, to avoid a boot error, the profile name of grub.cfg profile is modified to MAC information.
And S105, if the mode is the LEGACY mode, downloading a second starting software package to a corresponding server from a preset second path, wherein the second starting software package comprises a gpxelinux.0 file, a default configuration file, a Vmlinux file and an initrd.
And S106, executing the gpxelinux.0 file, reading the default configuration file, and loading the Vmlinux file and the initrd.img file into the BOOTOS by the server according to a path provided in the default configuration file.
If the mode is the LEAGACY mode, downloading a second starting software package, storing the second starting software package in a cache of the server, and loading the boot operating system through a file in the second starting software package.
Specifically, the boot file loads the kernel and the initrd file to a specific location of the memory, the kernel determines the file format of the initrd, if the file format is not in the cpio format, the file format is processed as an image-initrd, the kernel stores the content of the initrd in an/initrd.image file under rootfs, the kernel reads the content of the/initrd.image into a/dev/ram 0 device, that is, into a memory disk, the kernel mounts the/dev/ram 0 device as an original root file system in a readable and writable manner, and if the/dev/ram 0 is designated as a real root file system, the kernel jumps to the last step to normally start the boot to the BOOTOS.
In some embodiments, in step S106, the method includes:
acquiring MAC information of the server;
modifying the file name of the default configuration file into MAC information to obtain a first configuration file;
and executing the gpxelinux.0 file, guiding the first configuration file to load a Vmlinux file and an initrd.img file to the server, and entering the BOOTOS.
The default configuration file is a default configuration file name, the default configuration file may exist in other files, and due to the uniqueness of the MAC information, the file name of the default configuration file is modified into the MAC information in order to avoid a guiding error.
And S107, sending RAID commands to the servers through a web interface, and carrying out RAID automatic configuration on the servers.
After the server enters Boot os, the Boot os can automatically start a cloudboot service, the service provides an API interface and is used for receiving a RAID command configured on a web interface, the cloudboot can package the RAID command, meanwhile, details of the RAID configuration of the local machine are checked and automatically stored in a database, and current RAID configuration information can be directly displayed through the web. Therefore, the configuration of the multi-RAID function can be realized only by configuring a small amount of configuration, the automatic RAID processing is realized, and the RAID configuration of the server is not required to be manually performed by a user. And sending a RAID command to be configured through a Web interface, wherein the cludboot can automatically analyze the RAID command and then perform related configuration operation on the RAID command, and the Web server and the mysql server are positioned on the same server. The Web server automatically detects the IP address of each server in a broadcast mode, controls the IP address of each server to realize the control of all the servers, and further sends a RAID command to each server.
In the present embodiment, after step S107, the method includes:
obtaining RAID information of each server;
and storing the RAID information of each server into a designated mysql database through a josn format.
The RAID command comprises RAID clearing and RAID setting commands to each server, and each server executes a corresponding packaging command through cloudboot so as to set the RAID to be configured. And storing RAID information of each server through a mysql database to realize interface display of RAID information.
In this embodiment, after the step of storing the RAID information of each server in the designated mysql database in the josn format, the method includes:
reading RAID information of each server from the mysql database;
comparing the RAID information of each server with corresponding preset RAID information, wherein each server corresponds to one preset RAID information;
if the RAID configuration is the same, judging that the RAID configuration of the corresponding server is correct;
and if not, judging that the RAID configuration of the corresponding server is wrong.
And comparing the RAID information of each server with the corresponding preset RAID information, and judging whether the RAID configuration of the corresponding server is correct or not according to the comparison result, thereby realizing the automatic judgment of whether the RAID configuration of the server is correct or not.
After the step of storing the RAID information of each server into a designated mysql database through a josn format, the method comprises the following steps:
displaying RAID information of each server;
receiving identifiers of RAID information of each server input by a user, wherein the identifiers comprise a first identifier and a second identifier, the first identifier is an identifier which shows that the RAID information of each server is wrong, and the second identifier is an identifier which shows that the RAID information of each server is correct;
identifying a type of the identifier;
if the identifier is the second identifier, judging that the RAID configuration of the corresponding server is correct;
and if the identifier is the first identifier, determining that the RAID configuration of the corresponding server is wrong.
And the user checks the RAID information of each server, judges whether the RAID information of each server is the RAID information which the user wants, inputs a first identification to the server if the RAID information of each server is the RAID information which the user wants, inputs a second identification to the server if the RAID information of each server does not need to be judged to be the RAID information which the user wants, and distinguishes whether the display result of the RAID information of each server is correct or not through the first identification and the second identification.
After determining that the RAID configuration of the corresponding server is erroneous, it is necessary to perform RAID configuration again for the server.
In this embodiment, after the step of determining that the RAID configuration of the corresponding server is incorrect, the method includes:
marking the RAID configuration as an error server to obtain a target server;
sending the RAID command to the target server again;
and if the RAID configuration of the target server is detected to be wrong after the three RAID commands are sent, starting the target server again by PXE, and clearing the RAID configuration of the target server.
And issuing the configuration command again by the cloudboot, reporting configuration failure if the command is abnormal after three times, starting the target server by PXE again, clearing related hard disk information, verifying again, and reporting information if the command fails again.
In summary, PXE starting is performed on a plurality of servers, a mode set by a network card ROM of each server is obtained, if the mode is UEFI mode, a first starting software package is used for guiding to enter BOOTOS, and if the mode is LEGACY mode, a second starting software package is used for guiding to enter BOOTOS, and in the BOOTOS, RAID automatic configuration is performed on each server through a web interface, so that batch automatic RAID processing is realized.
As shown in fig. 2, an embodiment of the present application provides a RAID configuration apparatus 1 of a server, where the apparatus 1 includes a starting module 11, an obtaining module 12, a first downloading module 13, a first processing module 14, a second downloading module 15, a second processing module 16, and a configuration module 17.
The starting module 11 is configured to perform PXE starting on a plurality of servers.
The multiple servers are servers needing RAID configuration, the English full name of PXE is preboot execution environment, and the name of Chinese is preboot execution environment.
An obtaining module 12, configured to obtain a mode set by a network card ROM of each server, where the mode includes a UEFI mode or a LEGACY mode.
The method comprises the steps of detecting a mode set by a network card ROM of a server, and obtaining the mode set by the network card ROM through setting a PXE client parameter in the network card ROM, wherein a UEFI mode and an LEGACY mode are two different boot modes, the UEFI mode is a novel BIOS, the LEGACY mode is a traditional BIOS, the UEFI is a UnifiedExtensible Firmware Interface in English, and the Chinese name is a Unified Extensible Firmware Interface. The UEFI mode and the LEAGACY mode need different starting software packages, the UEFI mode corresponds to a first starting software package, and the LEAGACY mode corresponds to a second starting software package. A program in the PXE client enters the memory, displays a command menu, and starts to find a network bootstrap program.
The first downloading module 13 is configured to download a first starting software package to a corresponding server from a preset first path if the mode is the UEFI mode, where the first starting software package includes a bootx64.efi file, a grub.cfg configuration file, a Vmlinux file, and an initrd.img file.
The first processing module 14 is configured to execute the bootx64.efi file, direct the grub.cfg configuration file to load a Vmlinux file and an initrd.img file on the server, and enter the BOOTOS.
And if the user equipment is in the UEFI mode, downloading the first starting software package, storing the first starting software package in a cache of the server, and loading the boot operating system through the file in the first starting software package. And executing the BOOTX64.EFI file, reading the grub.cfg configuration file, loading the Vmlinux file and the initrd.img file by the server according to a path provided in the configuration file, loading the Vmlinux file and the initrd.img file into a memory, and entering the BOOTOS. The traditional mode in the process of executing BOOTX64.EFI is to acquire grub.cfg configuration files in an IP mode, and one problem of the mode is that if the time lease allocated by DHCP is too short and tftp downloads files for too long, the IP is easy to change, so that the configuration files are easy to acquire failure. The formation of the MAC file is controlled by compiling the kernel and adding the parameters, so that an efficient boot loading mode is realized. BOOTOS is the abbreviation of Boot Operating System, and Chinese means to start the Operating System.
In some embodiments, the first processing module 14 includes:
the first sub-acquisition module is used for acquiring the MAC information of the server;
the first sub-modification module is used for modifying the file name of the grub.cfg configuration file into MAC information to obtain a second configuration file;
and the first sub-loading module executes the BOOTX64.EFI file, reads the grub.cfg configuration file, and then enables the server to load the Vmlinux file initrd.img file according to a path provided in the grub.cfg configuration file and enter the BOOTOS.
Cfg profile is a default profile name, and may exist in other files, and due to uniqueness of MAC information, to avoid a boot error, the file name of the grub cfg profile is modified to MAC information.
And a second downloading module 15, configured to download, if the mode is the LEGACY mode, a second startup software package to the corresponding server from a preset second path, where the second startup software package includes a gpxelinux.0 file, a default configuration file, a Vmlinux file, and an initrd.
The second processing module 16 executes the bootx64.efi file, reads the grub.cfg configuration file, and loads the Vmlinux file and the initrd.img file into the BOOTOS according to the path provided in the grub.cfg configuration file.
If the mode is the LEAGACY mode, downloading a second starting software package, storing the second starting software package in a cache of the server, and loading the boot operating system through a file in the second starting software package.
Specifically, the boot file loads the kernel and the initrd file to a specific location of the memory, the kernel determines the file format of the initrd, if the file format is not in the cpio format, the file format is processed as an image-initrd, the kernel stores the content of the initrd in an/initrd.image file under rootfs, the kernel reads the content of the/initrd.image into a/dev/ram 0 device, that is, into a memory disk, the kernel mounts the/dev/ram 0 device as an original root file system in a readable and writable manner, and if the/dev/ram 0 is designated as a real root file system, the kernel jumps to the last step to normally start the boot to the BOOTOS.
In some embodiments, the second processing module 16 includes:
the second sub-acquisition module is used for acquiring the MAC information of the server;
the second sub-modification module is used for modifying the file name of the default configuration file into MAC information to obtain a first configuration file;
and the second sub-loading module is used for executing the gpxelinux.0 file, guiding the first configuration file to load the Vmlinux file and the initrd.img file on the server, and entering the BOOTOS.
The default configuration file is a default configuration file name, the default configuration file may exist in other files, and due to the uniqueness of the MAC information, the file name of the default configuration file is modified into the MAC information in order to avoid a guiding error.
And the configuration module 17 is configured to send a RAID command to each server through a web interface, and perform RAID automatic configuration on each server.
After the server enters Boot os, the Boot os automatically starts clodboot service, the service provides an API interface and is used for receiving a RAID command configured on a web interface, the clodboot encapsulates the RAID command, meanwhile, the details of the RAID configuration of the local machine are checked and automatically stored in a database, and the current RAID configuration information can be directly displayed through the web. Therefore, the configuration of the multi-RAID function can be realized only by configuring a small amount of configuration, the automatic RAID processing is realized, and the RAID configuration of the server is not required to be manually performed by a user. And sending a RAID command to be configured through a Web interface, wherein the cludboot can automatically analyze the RAID command and then perform related configuration operation on the RAID command, and the Web server and the mysql server are positioned on the same server. The Web server automatically detects the IP addresses of the servers in a broadcast mode, manages and controls the IP addresses of the servers to realize the control of all the servers, and then sends RAID commands to the servers.
In the present embodiment, the apparatus 1 comprises:
the first acquisition module is used for acquiring RAID information of each server;
and the first storage module is used for storing the RAID information of each server into a specified mysql database through a josn format.
The RAID command comprises RAID clearing and RAID setting commands to each server, and each server executes a corresponding packaging command through cloudboot so as to set the RAID to be configured. And storing RAID information of each server through a mysql database to realize interface display of RAID information.
In the present embodiment, the apparatus 1 comprises:
the first reading module is used for reading RAID information of each server from the mysql database;
the first comparison module is used for comparing the RAID information of each server with corresponding preset RAID information, and each server corresponds to one preset RAID information;
the first judging module is used for judging that the RAID configuration of the corresponding server is correct if the RAID configuration is the same;
and the second judgment module is used for judging that the RAID configuration of the corresponding server is wrong if the RAID configuration is different from the first judgment module.
And comparing the RAID information of each server with the corresponding preset RAID information, and judging whether the RAID configuration of the corresponding server is correct or not according to the comparison result, thereby realizing the automatic judgment of whether the RAID configuration of the server is correct or not.
The apparatus 1 comprises:
the first display module is used for displaying the RAID information of each server;
the first receiving module is used for receiving the identification of the RAID information of each server input by a user, wherein the identification comprises a first identification and a second identification, the first identification is the identification which shows that the display result of the RAID information of each server is wrong, and the second identification is the identification which shows that the display result of the RAID information of each server is correct;
the first identification module is used for identifying the type of the identifier;
a third determining module, configured to determine that the RAID configuration of the corresponding server is correct if the identifier is the second identifier;
and the fourth judging module is used for judging that the RAID configuration of the corresponding server is wrong if the identifier is the first identifier.
And the user checks the RAID information of each server, judges whether the RAID information of each server is the RAID information which the user wants, inputs a first identification to the server if the RAID information of each server is the RAID information which the user wants, inputs a second identification to the server if the RAID information of each server does not need to be judged to be the RAID information which the user wants, and distinguishes whether the display result of the RAID information of each server is correct or not through the first identification and the second identification.
After determining that the RAID configuration of the corresponding server is erroneous, it is necessary to perform RAID configuration again for the server.
In the present embodiment, the apparatus 1 comprises:
the first marking module is used for marking the server with the RAID configuration error to obtain a target server;
the first sending module is used for sending the RAID command to the target server again;
the first starting module is used for starting the target server again by PXE and clearing the RAID configuration of the target server if the RAID configuration of the target server is detected to be wrong after the RAID command is sent three times.
And issuing the configuration command again by the cloudboot, reporting configuration failure if the command is abnormal after three times, starting the target server by PXE again, clearing related hard disk information, verifying again, and reporting information if the command fails again.
In summary, PXE starting is performed on a plurality of servers, a mode set by a network card ROM of each server is obtained, if the mode is UEFI mode, a first starting software package is used for guiding to enter BOOTOS, and if the mode is LEGACY mode, a second starting software package is used for guiding to enter BOOTOS, and in the BOOTOS, RAID automatic configuration is performed on each server through a web interface, so that batch automatic RAID processing is realized.
As shown in fig. 3, in the embodiment of the present application, a computer device is further provided, where the computer device may be a server, and an internal structure of the computer device may be as shown in fig. 3. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the computer designed processor is used to provide computational and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used for storing data such as a model of a RAID configuration method of the server. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of RAID configuration for a server.
The processor executes the steps of the RAID configuration method of the server: starting a plurality of servers by PXE; acquiring modes set by a network card ROM of each server, wherein the modes comprise a UEFI mode or a LEAGACY mode; if the mode is a UEFI mode, downloading a first starting software package from a preset first path to a corresponding server, wherein the first starting software package comprises a BOOTX64.EFI file, a grub.cfg configuration file, a Vmlinux file and an initrd.img file; executing the BOOTX64.EFI file, guiding the grub.cfg configuration file to load a Vmlinux file and an initrd.img file on the server, and entering a BOOTOS; if the mode is the LEGACY mode, downloading a second starting software package to a corresponding server from a preset second path, wherein the second starting software package comprises a gpxelinux.0 file, a default configuration file, a Vmlinux file and an initrd.img file; executing the gpxelinux.0 file, guiding the default configuration file to load a Vmlinux file and an initrd.img file to the server, and entering a BOOTOS; and sending RAID commands to the servers through a web interface, and carrying out RAID automatic configuration on the servers.
In an embodiment, the step of executing the bootx64.efi file, directing the grub.cfg configuration file to load the Vmlinux file and the initrd.img file on the server, and entering the BOOTOS includes:
acquiring MAC information of the server;
modifying the file name of the grub.cfg configuration file into MAC information to obtain a second configuration file;
and executing the BOOTX64.EFI file, guiding the second configuration file to load the Vmlinux file and the initrd. img file on the server, and entering the BOOTOS.
In an embodiment, the step of sending a RAID command to each server through the web interface and performing RAID auto configuration on each server includes:
obtaining RAID information of each server;
and storing the RAID information of each server into a designated mysql database through a josn format.
In an embodiment, after the step of storing the RAID information of each server in the designated mysql database by the josn format, the method includes:
reading RAID information of each server from the mysql database;
comparing the RAID information of each server with corresponding preset RAID information, wherein each server corresponds to one preset RAID information;
if the RAID configuration is the same, judging that the RAID configuration of the corresponding server is correct;
and if not, judging that the RAID configuration of the corresponding server is wrong.
In an embodiment, after the step of storing the RAID information of each server in the designated mysql database by the josn format, the method includes:
displaying RAID information of each server;
receiving identifiers of RAID information of each server input by a user, wherein the identifiers comprise a first identifier and a second identifier, the first identifier is an identifier which shows that the RAID information of each server is wrong, and the second identifier is an identifier which shows that the RAID information of each server is correct;
identifying a type of the identifier;
if the identifier is the second identifier, judging that the RAID configuration of the corresponding server is correct;
and if the identifier is the first identifier, determining that the RAID configuration of the corresponding server is wrong.
In one embodiment, after the step of determining that the RAID configuration of the corresponding server is incorrect, the method includes:
marking a server with the RAID configuration as an error to obtain a target server;
sending the RAID command to the target server again;
and if the RAID configuration of the target server is detected to be wrong after the three RAID commands are sent, starting the target server again by PXE, and clearing the RAID configuration of the target server.
In an embodiment, the step of executing the gpxelinux.0 file, directing the default configuration file to load the Vmlinux file and the initrd.img file to the server, and entering the BOOTOS includes:
acquiring MAC information of the server;
modifying the file name of the default configuration file into MAC information to obtain a first configuration file;
and executing the gpxelinux.0 file, guiding the first configuration file to load a Vmlinux file and an initrd.img file to the server, and entering the BOOTOS.
Those skilled in the art will appreciate that the architecture shown in fig. 3 is only a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects may be applied.
The computer equipment of the embodiment of the application starts a plurality of servers by PXE, obtains the mode set by the network card ROM of each server, adopts a first starting software package to guide to enter BOOTOS if the mode is UEFI mode, adopts a second starting software package to guide to enter BOOTOS if the mode is LEGACY mode, and realizes RAID automatic configuration on each server through a web interface in BOOTOS to realize batch automatic processing of RAID.
An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for calculating text accuracy based on semantic parsing is implemented, specifically: starting a plurality of servers by PXE; acquiring modes set by a network card ROM of each server, wherein the modes comprise a UEFI mode or a LEAGACY mode; if the mode is a UEFI mode, downloading a first starting software package from a preset first path to a corresponding server, wherein the first starting software package comprises a BOOTX64.EFI file, a grub.cfg configuration file, a Vmlinux file and an initrd.img file; executing the BOOTX64.EFI file, guiding the grub.cfg configuration file to load a Vmlinux file and an initrd.img file on the server, and entering a BOOTOS; if the mode is the LEGACY mode, downloading a second starting software package to a corresponding server from a preset second path, wherein the second starting software package comprises a gpxelinux.0 file, a default configuration file, a Vmlinux file and an initrd.img file; executing the gpxelinux.0 file, guiding the default configuration file to load a Vmlinux file and an initrd.img file to the server, and entering a BOOTOS; and sending RAID commands to the servers through a web interface, and carrying out RAID automatic configuration on the servers.
In an embodiment, the step of executing the bootx64.efi file, directing the grub.cfg configuration file to load the Vmlinux file and the initrd.img file on the server, and entering the BOOTOS includes:
acquiring MAC information of the server;
modifying the file name of the grub.cfg configuration file into MAC information to obtain a second configuration file;
and executing the BOOTX64.EFI file, guiding the second configuration file to load the Vmlinux file and the initrd.img file to the server, and entering BOOTOS.
In an embodiment, the step of sending a RAID command to each server through the web interface and performing RAID auto configuration on each server includes:
obtaining RAID information of each server;
and storing the RAID information of each server into a designated mysql database through a josn format.
In an embodiment, after the step of storing the RAID information of each server in the designated mysql database by the josn format, the method includes:
reading RAID information of each server from the mysql database;
comparing the RAID information of each server with corresponding preset RAID information, wherein each server corresponds to one preset RAID information;
if the RAID configuration is the same, judging that the RAID configuration of the corresponding server is correct;
and if not, judging that the RAID configuration of the corresponding server is wrong.
In an embodiment, after the step of storing the RAID information of each server in the designated mysql database by the josn format, the method includes:
displaying RAID information of each server;
receiving identifiers of RAID information of each server input by a user, wherein the identifiers comprise a first identifier and a second identifier, the first identifier is an identifier which shows that the RAID information of each server is wrong, and the second identifier is an identifier which shows that the RAID information of each server is correct;
identifying a type of the identifier;
if the identifier is the second identifier, judging that the RAID configuration of the corresponding server is correct;
and if the identifier is the first identifier, determining that the RAID configuration of the corresponding server is wrong.
In one embodiment, after the step of determining that the RAID configuration of the corresponding server is incorrect, the method includes:
marking a server with the RAID configuration as an error to obtain a target server;
sending the RAID command to the target server again;
and if the RAID configuration of the target server is detected to be wrong after the three RAID commands are sent, starting the target server again by PXE, and clearing the RAID configuration of the target server.
In an embodiment, the step of executing the gpxelinux.0 file, directing the default configuration file to load the Vmlinux file and the initrd.img file to the server, and entering the BOOTOS includes:
acquiring MAC information of the server;
modifying the file name of the default configuration file into MAC information to obtain a first configuration file;
and executing the gpxelinux.0 file, guiding the first configuration file to load a Vmlinux file and an initrd.img file to the server, and entering the BOOTOS.
The storage medium of the embodiment of the application starts a plurality of servers by PXE, obtains the mode set by the network card ROM of each server, and if the mode is UEFI mode, the first starting software package is adopted to guide to enter BOOTOS, and if the mode is LEGACY mode, the second starting software package is adopted to guide to enter BOOTOS.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium provided herein and used in the examples may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double-rate SDRAM (SSRSDRAM), Enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and bus dynamic RAM (RDRAM).
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (10)

1. A RAID configuration method for a server, the method comprising:
starting a plurality of servers by PXE;
acquiring modes set by a network card ROM of each server, wherein the modes comprise a UEFI mode or a LEAGACY mode;
if the mode is a UEFI mode, downloading a first starting software package to a corresponding server from a preset first path, wherein the first starting software package comprises a BOOTX64.EFI file, a grub.cfg configuration file, a Vmlinux file and an initrd.img file;
executing the BOOTX64.EFI file, reading the grub.cfg configuration file, so that the server loads a Vmlinux file and an initrd.img file according to a path provided in the grub.cfg configuration file, and entering a BOOTOS;
if the mode is the LEGACY mode, downloading a second starting software package to a corresponding server from a preset second path, wherein the second starting software package comprises a gpxelinux.0 file, a default configuration file, a Vmlinux file and an initrd.img file;
executing the gpxelinux.0 file, reading the default configuration file, loading a Vmlinux file and an initrd.img file by the server according to a path provided in the default configuration file, and entering a BOOTOS;
and sending RAID commands to the servers through a web interface, and carrying out RAID automatic configuration on the servers.
2. The RAID configuration method for a server according to claim 1, wherein in the step of executing the bootx64.efi file, directing the grub.cfg configuration file to load a Vmlinux file and an initrd.img file to the server, and entering into BOOTOS, the method includes:
acquiring MAC information of the server;
modifying the file name of the grub.cfg configuration file into MAC information to obtain a second configuration file;
and executing the BOOTX64.EFI file, guiding the second configuration file to load the Vmlinux file and the initrd. img file on the server, and entering the BOOTOS.
3. The RAID configuration method for a server according to claim 1, wherein after the step of sending a RAID command to each server via a web interface to automatically configure a RAID for each server, the RAID configuration method comprises:
obtaining RAID information of each server;
and storing the RAID information of each server into a designated mysql database through a josn format.
4. The RAID configuration method of the server according to claim 3, wherein after the step of storing the RAID information of each server in a designated mysql database by a josn format, the method comprises:
reading RAID information of each server from the mysql database;
comparing the RAID information of each server with corresponding preset RAID information, wherein each server corresponds to one preset RAID information;
if the RAID configuration is the same, judging that the RAID configuration of the corresponding server is correct;
and if not, judging that the RAID configuration of the corresponding server is wrong.
5. The RAID configuration method of the server according to claim 3, wherein after the step of storing the RAID information of each server in a designated mysql database by a josn format, the method comprises:
displaying RAID information of each server;
receiving identifiers of RAID information of each server input by a user, wherein the identifiers comprise a first identifier and a second identifier, the first identifier is an identifier which shows that the RAID information of each server is wrong, and the second identifier is an identifier which shows that the RAID information of each server is correct;
identifying a type of the identifier;
if the identifier is the second identifier, judging that the RAID configuration of the corresponding server is correct;
and if the identifier is the first identifier, determining that the RAID configuration of the corresponding server is wrong.
6. The server RAID configuration method according to claim 4 or 5, wherein after the step of determining that the RAID configuration of the corresponding server is erroneous, the method comprises:
marking a server with the RAID configuration as an error to obtain a target server;
sending the RAID command to the target server again;
and if the RAID configuration of the target server is detected to be wrong after the three RAID commands are sent, starting the target server again by PXE, and clearing the RAID configuration of the target server.
7. The RAID configuration method according to claim 1, wherein in the step of executing the gpxelinux.0 file, directing the default configuration file to load the Vmlinux file and initrd.img file to the server, and entering the BOOTOS, the method includes:
acquiring MAC information of the server;
modifying the file name of the default configuration file into MAC information to obtain a first configuration file;
and executing the gpxelinux.0 file, guiding the first configuration file to load a Vmlinux file and an initrd.img file to the server, and entering BOOTOS.
8. An apparatus for RAID configuration of a server, the apparatus comprising:
the starting module is used for starting the PXE of the servers;
the acquisition module is used for acquiring the mode set by the network card ROM of each server, wherein the mode comprises a UEFI mode or a LEAGACY mode;
the first downloading module is used for downloading a first starting software package to a corresponding server from a preset first path if the mode is a UEFI mode, wherein the first starting software package comprises a BOOTX64.EFI file, a grub.cfg configuration file, a Vmlinux file and an initrd.img file;
the first processing module is used for executing the BOOTX64.EFI file, reading the grub.cfg configuration file, adding the Vmlinux file and the initrd.img file to the server according to a path provided in the grub.cfg configuration file, and entering the BOOTOS;
a second downloading module, configured to download, if the mode is the LEGACY mode, a second startup software package from a preset second path to a corresponding server, where the second startup software package includes a gpxelinux.0 file, a default configuration file, a Vmlinux file, and an initrd.img file;
the second processing module is used for executing the gpxelinux.0 file, reading the default configuration file, and loading the Vmlinux file and the initrd.img file into the server according to a path provided in the default configuration file to enter the BOOTOS;
and the configuration module is used for sending RAID commands to the servers through a web interface and carrying out RAID automatic configuration on the servers.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN201910176264.5A 2019-03-08 2019-03-08 RAID configuration method and device of server, computer equipment and storage medium Active CN110045991B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910176264.5A CN110045991B (en) 2019-03-08 2019-03-08 RAID configuration method and device of server, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910176264.5A CN110045991B (en) 2019-03-08 2019-03-08 RAID configuration method and device of server, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110045991A CN110045991A (en) 2019-07-23
CN110045991B true CN110045991B (en) 2022-05-20

Family

ID=67274678

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910176264.5A Active CN110045991B (en) 2019-03-08 2019-03-08 RAID configuration method and device of server, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110045991B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110737479A (en) * 2019-09-04 2020-01-31 平安科技(深圳)有限公司 method for starting operating system without disk, server and readable storage medium
CN110879712B (en) * 2019-11-07 2022-06-17 北京浪潮数据技术有限公司 Cloud data center physical host installation method and related device
CN111782283A (en) * 2020-06-28 2020-10-16 北京思特奇信息技术股份有限公司 Automatic management method, device and medium for bare metal server
CN112965662A (en) * 2021-03-03 2021-06-15 北京金山云网络技术有限公司 Configuration method and device of cloud server, management server and storage medium
CN113692003A (en) * 2021-08-30 2021-11-23 北京紫光展锐通信技术有限公司 Mode switching method and device of Wi-Fi module
CN115664953B (en) * 2022-11-30 2023-05-26 苏州浪潮智能科技有限公司 Resource allocation method and related device of external equipment
CN116679889B (en) * 2023-07-31 2023-11-03 苏州浪潮智能科技有限公司 Method and device for determining RAID equipment configuration information and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103746833A (en) * 2013-12-25 2014-04-23 新浪网技术(中国)有限公司 PXE-based RAID automatic configuration method and system
CN107203375A (en) * 2016-03-17 2017-09-26 恩斯迈电子(深圳)有限公司 The method for setting disk array

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7216200B2 (en) * 2003-11-04 2007-05-08 Dell Products L.P. System and method for remote RAID configuration
CN102262546A (en) * 2010-05-28 2011-11-30 鸿富锦精密工业(深圳)有限公司 Method for booting operating system in diskless way, electronic device and server
US9652343B2 (en) * 2011-09-21 2017-05-16 Kevin Mark Klughart Raid hot spare system and method
US20170269942A1 (en) * 2016-03-17 2017-09-21 MSI Computer (Shenzhen) Co., Ltd Method for setting redundant array of independent disks
US10951471B2 (en) * 2017-07-14 2021-03-16 Quanta Cloud Technology Inc. Mechanism for hardware configuration and software deployment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103746833A (en) * 2013-12-25 2014-04-23 新浪网技术(中国)有限公司 PXE-based RAID automatic configuration method and system
CN107203375A (en) * 2016-03-17 2017-09-26 恩斯迈电子(深圳)有限公司 The method for setting disk array

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于新型云化电信网络的服务器测试方法研究;穆琙博 等;《电信网技术》;20180515(第5期);第9-14页 *

Also Published As

Publication number Publication date
CN110045991A (en) 2019-07-23

Similar Documents

Publication Publication Date Title
CN110045991B (en) RAID configuration method and device of server, computer equipment and storage medium
US9146839B2 (en) Method for pre-testing software compatibility and system thereof
CN108847950B (en) Electronic device, cloud system software automatic deployment method and storage medium
CN110765026B (en) Automatic test method, device, storage medium and equipment
US20160132420A1 (en) Backup method, pre-testing method for environment updating and system thereof
CN107608681B (en) Operating system installation method and device and server
US11995427B2 (en) Method, apparatus, device, and storage medium for upgrading vehicle-mounted Tbox
CN108509215B (en) System software replacing method and device, terminal equipment and storage medium
CN112433769A (en) BMC starting method and device, computer equipment and storage medium
CN106484442B (en) Server system and method for updating startup mapping file
CN117130672A (en) Server start flow control method, system, terminal and storage medium
CN108595292B (en) System optimization method, mobile terminal and computer storage medium
CN116483416A (en) Firmware online upgrading method, server and storage medium
CN113553110A (en) Automatic correction method, device and system for hardware baseline of server
CN107015827B (en) Embedded system and method for automatically operating third-party extension program thereof
CN112463466B (en) Computer testing method
CN112328288A (en) Method, system, equipment and storage medium for updating server component
CN112667444A (en) System upgrading method, storage medium and terminal equipment
CN111240589A (en) Partition isolation-based system management method, device, equipment and storage medium
CN113868128B (en) Method and device for testing PXE (PCI express) guide function and storage medium
CN111949278B (en) Method, system, terminal and storage medium for automatically installing MCS system
CN115664953B (en) Resource allocation method and related device of external equipment
CN117221160A (en) Detection method, first node and computer readable storage medium
CN117348905A (en) BMC firmware updating method, system, terminal and storage medium
CN117667252A (en) Method, system, equipment and storage medium for opening system-guided watchdog

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
GR01 Patent grant
GR01 Patent grant