Disclosure of Invention
The application aims to provide a visual node registration method, a visual node registration device and a readable storage medium of an OpenStack cluster, which are used for solving the problem that the node registration efficiency is low due to the fact that the operation of the current scheme for registering nodes based on a command line is complex. The specific scheme is as follows:
in a first aspect, the present application provides a visualization node registration method for an OpenStack cluster, including:
responding to the click operation of a newly added node button on a node registration interface, acquiring an input node name and a node IP, and executing node registration operation;
responding to the click operation of a role distribution button, and displaying a plurality of OpenStack service roles to be selected on a role distribution interface; determining a selected target role, and deploying a service component corresponding to the target role for a current node;
responding to the click operation of the network card configuration button, and displaying the network card equipment of the current node on a network card configuration interface; determining edited network card configuration information, and applying the network card configuration information to the network card equipment;
and responding to the clicking operation of the connectivity check button, performing connectivity check on the current node in the OpenStack cluster, and displaying a connectivity check result.
Preferably, the obtaining the input node name and node IP in response to the click operation of the new node button on the node registration interface, and executing the node registration operation includes:
and responding to the click operation of a newly added node button on a node registration interface, acquiring the imported excel file, and executing batched node registration operation according to the node name and the node IP in the excel file.
Preferably, the determining the edited network card configuration information and applying the network card configuration information to the network card device includes:
determining the input configuration parameters of the network card device, modifying the configuration file of the network card device according to the configuration parameters by using a functional logic layer, and restarting the network card device, wherein the configuration parameters comprise any one or more of the following parameters: IP address, network card mode, whether to start up automatically.
Preferably, the determining the edited network card configuration information and applying the network card configuration information to the network card device includes:
responding to the click operation of a bond button, determining a selected target network card device and bond parameters, and binding the target network card device into a single virtual network card by using a functional logic layer according to the bond parameters, wherein the bond parameters comprise any one or more of the following items: bond name, bond mode, IP address, gateway, subnet mask.
Preferably, the determining the edited network card configuration information and applying the network card configuration information to the network card device includes:
responding to click operation of a virtual function query button, and displaying the maximum virtual quantity in the SRIOV attribute of the network card equipment; and acquiring the input actual virtual quantity, and executing corresponding SRIOV configuration on the network card equipment by utilizing the functional logic layer.
Preferably, the method further comprises the following steps:
and responding to the click operation of the node query button, acquiring the input node name or node IP, obtaining the current node through fuzzy query, and displaying the information of the current node.
Preferably, before the obtaining the input node name and node IP in response to the click operation of the new node button on the node registration interface and executing the node registration operation, the method further includes:
and installing an operating system on the node by using a PXE means, and setting a node name and a node IP, wherein the operating system supports SSH-free authentication access.
In a second aspect, the present application provides a visualization node registration apparatus for an OpenStack cluster, including:
a node module is newly added: the system comprises a node registration interface, a node display interface and a node display interface, wherein the node display interface is used for responding to the click operation of a newly added node button on the node registration interface, acquiring an input node name and a node IP and executing the node registration operation;
a role assignment module: the OpenStack service role display method comprises the steps that a plurality of OpenStack service roles to be selected are displayed on a role distribution interface in response to clicking operation of a role distribution button; determining a selected target role, and deploying a service component corresponding to the target role for a current node;
a network card configuration module: the network card equipment is used for responding to the click operation of the network card configuration button and displaying the current node on a network card configuration interface; determining edited network card configuration information, and applying the network card configuration information to the network card equipment;
a connectivity check module: and the system is used for responding to the clicking operation of the connectivity check button, performing connectivity check on the current node in the OpenStack cluster, and displaying a connectivity check result.
In a third aspect, the present application provides a visualization node registration device for an OpenStack cluster, including:
a memory: for storing a computer program;
a processor: for executing the computer program to implement the steps of the visualization node registration method of the OpenStack cluster as described above.
In a fourth aspect, the present application provides a readable storage medium having stored thereon a computer program for implementing the steps of the visualization node registration method of an OpenStack cluster as described above when being executed by a processor.
The visualized node registration method for the OpenStack cluster comprises the following steps: responding to the click operation of a newly added node button on a node registration interface, acquiring an input node name and a node IP, and executing node registration operation; responding to the click operation of a role distribution button, and displaying a plurality of OpenStack service roles to be selected on a role distribution interface; determining the selected target role, and deploying a service component corresponding to the target role for the current node; responding to the click operation of the network card configuration button, and displaying the network card equipment of the current node on a network card configuration interface; determining the edited network card configuration information, and applying the network card configuration information to the network card equipment; and responding to the clicking operation of the connectivity check button, performing connectivity check on the current node in the OpenStack cluster, and displaying a connectivity check result.
Therefore, the method provides the OpenStack cluster node registration function for the user through the WEB interface, the user can easily complete the node registration of the cloud platform cluster only by performing simple operation on the WEB interface, the complexity of the OpenStack cloud platform deployment is effectively reduced, and the node registration efficiency is improved.
In addition, the application also provides a visual node registration device, equipment and a readable storage medium of the OpenStack cluster, and the technical effect of the device corresponds to that of the method, which is not described herein again.
Detailed Description
The core of the application is to provide a visual node registration method, device, equipment and readable storage medium for an OpenStack cluster, and provide a node registration function for the OpenStack cluster for a user through a WEB interface, so that the deployment complexity of an OpenStack cloud platform is effectively reduced, and the node registration efficiency is improved.
In order that those skilled in the art will better understand the disclosure, the following detailed description will be given with reference to the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
An embodiment of a method for registering a visualization node of an OpenStack cluster is described below, with reference to fig. 1, where the embodiment includes:
s101, responding to the click operation of a button of a newly added node on a node registration interface, acquiring an input node name and a node IP, and executing node registration operation;
s102, responding to the clicking operation of a role distribution button, and displaying a plurality of OpenStack service roles to be selected on a role distribution interface; determining a selected target role, and deploying a service component corresponding to the target role for a current node;
s103, responding to the click operation of the network card configuration button, and displaying the network card equipment of the current node on a network card configuration interface; determining edited network card configuration information, and applying the network card configuration information to the network card equipment;
and S104, responding to the clicking operation of the connectivity check button, performing connectivity check on the current node in the OpenStack cluster, and displaying a connectivity check result.
Common installation and deployment modes of the OpenStack cluster include: DevStack, RDO, SaltStack, tripleO, Fuel, Kolla, OpenStack-helm, etc. Kola is a project for automated deployment below OpenStack, and is implemented based on docker and ansible, and the OpenStack is deployed based on kolla in this embodiment, where the preconditions are: the server operating system is installed and the cluster operating system environment is initialized. The initializing cluster operating system environment comprises cluster node registration, node role allocation, node network card configuration, node connectivity check and other operations, which are collectively referred to as node registration in the embodiment, and a visualized deployment node registration method suitable for an OpenStack cloud platform is provided.
The visual deployment means a deployment mode operated through a WEB interface. In this embodiment, a node refers to a physical server.
In the node registration process, the nodes are added into the cluster mainly according to the IP (Internet protocol) of the nodes, host names and the like. The process simultaneously supports node updates, node removal operations, and the like. Specifically, when registering a node, in order to improve registration efficiency, a batch registration function may be supported, and at this time, a registration process is as follows: and responding to the click operation of a newly added node button on a node registration interface, acquiring the imported excel file, and executing batched node registration operation according to the node name and the node IP in the excel file.
In the role distribution process, multiple OpenStack service roles can be specifically supported, and a user selects at least one role and clicks to store the selected role to complete the node role distribution.
The network card configuration process may specifically include any one or more of the following: the method comprises the following steps of node network card configuration, network card bond configuration and network card SRIOV attribute configuration, wherein the network card bond configuration refers to the binding of one or more physical network cards into a logical network card. The three configuration processes are described below:
the node network card configuration process comprises the following steps: determining the input configuration parameters of the network card device, modifying the configuration file of the network card device according to the configuration parameters by using a functional logic layer, and restarting the network card device, wherein the configuration parameters comprise any one or more of the following parameters: IP address, network card mode, whether to start up automatically.
The network card bond configuration process comprises the following steps: responding to the click operation of a bond button, determining a selected target network card device and bond parameters, and binding the target network card device into a single virtual network card by using a functional logic layer according to the bond parameters, wherein the bond parameters comprise any one or more of the following items: bond name, bond mode, IP address, gateway, subnet mask.
The network card SRIOV attribute configuration process comprises the following steps: responding to click operation of a virtual function query button, and displaying the maximum virtual quantity in the SRIOV attribute of the network card equipment; and acquiring the input actual virtual quantity, and executing corresponding SRIOV configuration on the network card equipment by utilizing the functional logic layer.
In the connectivity checking process, the main purpose is to check whether the nodes registered to the cluster can be normally connected. Connectivity check may be performed on all registered nodes at a time, or may be performed only on a specified part of nodes, which is not limited in this embodiment.
In this embodiment, the current node refers to a currently selected node. Specifically, a user may select one or some nodes through a click operation, and in addition, the present embodiment also supports a query function of the nodes. The user can input the node name or the node IP address in the node query interface and then click the node query button, and the query process is as follows: and responding to the click operation of the node query button, acquiring the input node name or node IP, obtaining the current node through fuzzy query, and displaying the information of the current node.
According to the visualized node registration method of the OpenStack cluster, a WEB interface is used for providing a node registration function of the OpenStack cluster for a user, the user can easily complete node registration of the cloud platform cluster only by performing simple operation on the WEB interface, complexity of OpenStack cloud platform deployment is effectively reduced, and node registration efficiency is improved.
The following describes in detail a visualization node registration method of an OpenStack cluster according to the present application, taking practical applications as an example.
The node registration method of the embodiment is implemented based on cluster deployment nodes, and before executing a node registration process, an installation package of a visualization deployment tool is first positioned and installed on the cluster deployment nodes. In addition, the cluster deployment node is provided with an enterprise equal batch operation tool, a maridb database (a business layer needs to record operation tasks), a container mirror library (for later deployment of OpenStack), and other tools.
As shown in fig. 2, the general architecture of the visualization deployment tool includes: the system comprises a UI layer, a service layer and a functional logic layer, wherein the functions of each layer are as follows:
UI layer: the VUE + node.js technology is adopted, and node.js mainly processes service calling and complex logic; the VUE is used for displaying an interface and is used as a user operation interface to be responsible for interaction with a user;
and (4) a service layer: the method is realized by adopting a flash architecture of Python and is responsible for task conversion forwarding, recording, queuing and the like;
and a functional logic layer: the method is realized by adopting shell or python and is responsible for realizing the business function logic.
The functional design of the visualization deployment tool comprises: cluster node registration, node role distribution, node network card configuration, node connectivity check and the like. The specific introduction is as follows:
and (3) node registration: adding a computing node host into the cluster through a registered node IP, a host name and the like, supporting node addition, deletion, modification, check and the like;
and (3) node role allocation: distributing OpenStack roles to nodes added into the cluster and bearing corresponding services;
and (3) node network card configuration: supporting node network card configuration, network card bond configuration and network card SRIOV attribute configuration;
and (3) checking the connectivity of the nodes: checking whether the nodes registered to the cluster can be normally connected.
In this embodiment, the precondition implemented by the node registration function includes:
the method comprises the following steps that 1, installation of operating systems of all nodes of a cluster is completed through Cobbler and other PXE means;
condition 2, respectively designating an IP address and a host name in a PXE installation process;
the method comprises the following steps that (1) condition 3, node mutual trust setting is carried out, an installed operating system has the same SSH key authentication file, cluster nodes set SSH mutual trust, and mutual access is guaranteed to support SSH-free authentication;
and 4, installing UI layer, service layer and functional logic layer codes on the cluster deployment node.
Based on the above, the node registration method is specifically implemented as follows:
s21: and (3) node registration: inputting a node name (host name), a node IP address and an equipment serial number (optional), clicking a newly added node button, and finishing node registration;
specifically, registered nodes are added to/etc/hosts, for example:
01 node IP 01 node Name
02 node IP 02 node Name
The node registration supports batch registration, the batch registration can be completed in an Excel table importing mode, and information such as host names and IP addresses of all nodes needs to be maintained in the Excel table.
And displaying a node registration support list, and supporting node updating and node removing operations through fuzzy query of node names or IP addresses.
S22: and (3) node role allocation: selecting one or more nodes in a node list, clicking a role distribution button, displaying 5 types of OpenStack service roles, namely a control node, a network node, a storage node, a monitoring node and a computing node, selecting at least one type of roles, and clicking, storing and finishing the distribution of the roles of the nodes;
node role assignment refers to assigning a role to a selected node, for example, to be a compute node, and the node deploys the compute component service of OpenStack.
The node role distribution supports batch operation of a plurality of nodes and supports operations such as role modification and deletion. After the node adds the role, the node list shows the item-role, and the assigned role of the corresponding node is shown.
S23, node network card configuration and network card bond: selecting a node in the node list, clicking network card configuration, and displaying information of all network card devices of the node, wherein the information comprises a network card name, a network rate, a state, whether a bond is formed or not and the like; one of the network cards is selected to change the configuration of the network card (supporting the modification of an IP address, a network mode, whether the network card is started or not, and the like); selecting one or more network card corresponding network card bond buttons to perform network card bond operation on the network card bond buttons; selecting a network card to configure the SRIOV attribute;
the node network card configuration refers to that network card configuration is carried out on a single network card, corresponding parameter field values are submitted and issued to the functional logic layer through the service layer, the functional logic layer codes complete the change of the network card configuration file, and network card restarting operation is carried out to enable the modification to be effective. The network card configuration file of the network card configuration operation is located in the directory: the/etc/sysconfig/network-scripts/.
The node network card bond supports bond operation on one or more network cards, and is bound into a logical network card (virtual network card), in this embodiment, the modes supported by the network card bond are mode 1 (active/standby mode) and mode 4 (dynamic link aggregation mode), the interface maintains the bond name, the bond mode, the IP address, the gateway, and the subnet mask, and the specific bond implementation is also completed through the functional logic layer code.
And configuring the SRIOV of the node network card, wherein the number of the VFs of the physical network card is required to be configured when the SRIOV function is started by the OpenStack computing node physical host, and the specific configuration file is/sys/class/net/ethx/device/SRIOV _ numvfs. The default VF number of sriov _ numvfs is 0, and a specific value (less than or equal to the maximum VF number limit of the network card device) needs to be set. While PCIe network card devices with SRIOV capability have a limit to the number of VFs (virtual functions). The embodiment supports querying the totalvfs total amount of the selected network card SRIOV, and specifically views the configuration file: the method comprises the following steps that/sys/class/net/ethx/device/sriov _ totalvfs and sriov _ totalvfs record the maximum supported VF number of the network card equipment; the number of numvfs of the network card is set, and the SRIOV attribute of the network card of the operating system is modified corresponding to the code of the functional logic layer.
The SRIOV is configured with network card kernel equipment files, and the directory is as follows: /sys/class/net/ethx (network card name)/. Under the directory, there are files for recording various attributes of the physical device, including network card rate, status, SRIOV related attributes, etc. Where/sys/class is exported by kernel at runtime in order to expose the hierarchical relationship of the hardware through the file system.
S24: and (3) checking the connectivity of the nodes: and performing connectivity check on the nodes joining the cluster, and returning a connectivity list, for example:
node10 success
node11 fail
therefore, according to the visualized node registration method of the OpenStack cluster provided by the embodiment, the node registration of the OpenStack cluster can be completed in a WEB interface operation mode, according to an operation guidance flow and an interface annotation, a common user can easily complete the node registration of the cloud platform cluster, and the complexity of deployment and delivery of the OpenStack cloud platform is effectively reduced.
In the following, a visualization node registration device of an OpenStack cluster provided in an embodiment of the present application is introduced, and a visualization node registration device of an OpenStack cluster described below and a visualization node registration method of an OpenStack cluster described above may be referred to correspondingly.
As shown in fig. 3, the visualization node registration apparatus of an OpenStack cluster according to this embodiment includes:
newly adding a node module 301: the system comprises a node registration interface, a node display interface and a node display interface, wherein the node display interface is used for responding to the click operation of a newly added node button on the node registration interface, acquiring an input node name and a node IP and executing the node registration operation;
role assignment module 302: the OpenStack service role display method comprises the steps that a plurality of OpenStack service roles to be selected are displayed on a role distribution interface in response to clicking operation of a role distribution button; determining a selected target role, and deploying a service component corresponding to the target role for a current node;
the network card configuration module 303: the network card equipment is used for responding to the click operation of the network card configuration button and displaying the current node on a network card configuration interface; determining edited network card configuration information, and applying the network card configuration information to the network card equipment;
the connectivity check module 304: and the system is used for responding to the clicking operation of the connectivity check button, performing connectivity check on the current node in the OpenStack cluster, and displaying a connectivity check result.
The visualization node registration device of the OpenStack cluster in this embodiment is used to implement the visualization node registration method of the OpenStack cluster, and therefore, specific embodiments in the device may be found in the foregoing embodiment of the visualization node registration method of the OpenStack cluster, for example, the newly addednode module 301, therole assignment module 302, the networkcard configuration module 303, and theconnectivity check module 304 are respectively used to implement steps S101, S102, S103, and S104 in the visualization node registration method of the OpenStack cluster. Therefore, specific embodiments thereof may be referred to in the description of the corresponding respective partial embodiments, and will not be described herein.
In addition, since the visualization node registration apparatus of the OpenStack cluster of this embodiment is used to implement the visualization node registration method of the OpenStack cluster, the role of the visualization node registration apparatus corresponds to that of the method described above, and details are not described here.
In addition, the present application also provides a visualization node registration device of an OpenStack cluster, as shown in fig. 4, including:
the memory 100: for storing a computer program;
the processor 200: for executing the computer program to implement the steps of the visualization node registration method of the OpenStack cluster as described above.
Finally, the present application provides a readable storage medium having stored thereon a computer program for implementing the steps of the method for visualization node registration of an OpenStack cluster as described above when executed by a processor.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The above detailed descriptions of the solutions provided in the present application, and the specific examples applied herein are set forth to explain the principles and implementations of the present application, and the above descriptions of the examples are only used to help understand the method and its core ideas of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.