CN111404997A - Heartbeat communication method, system and related device of double-control server - Google Patents

Heartbeat communication method, system and related device of double-control server Download PDF

Info

Publication number
CN111404997A
CN111404997A CN202010125777.6A CN202010125777A CN111404997A CN 111404997 A CN111404997 A CN 111404997A CN 202010125777 A CN202010125777 A CN 202010125777A CN 111404997 A CN111404997 A CN 111404997A
Authority
CN
China
Prior art keywords
network card
virtual network
virtual
heartbeat communication
creating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN202010125777.6A
Other languages
Chinese (zh)
Inventor
戚勇
吕玉彬
李佩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202010125777.6A priority Critical patent/CN111404997A/en
Publication of CN111404997A publication Critical patent/CN111404997A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/70Virtual switches
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a heartbeat communication method of a double-control server, comprising the following steps: generating an NTB channel between the double controllers; when a storage system of a server is started, a virtual network card is created; providing a virtual network card IP address corresponding to heartbeat communication on the virtual network card; and adding the virtual network card to a host machine so that the host machine can select the virtual network card and realize heartbeat communication between nodes by utilizing the NTB channel. The virtual network card is virtualized on the host machine, and the virtual network card is used for nas heartbeat communication on the virtual machine, so that faults can be avoided, and the stability of heartbeat communication is enhanced. The application also provides a heartbeat communication system of the double-control server, a computer readable storage medium and the server, which have the beneficial effects.

Description

Heartbeat communication method, system and related device of double-control server
Technical Field
The present application relates to the field of servers, and in particular, to a heartbeat communication method and system for a dual-control server, and a related device.
Background
The existing platform uses an external direct connection line to realize NAS heartbeat connection, a PORT (PORT.
Therefore, how to ensure the stability of the NAS heartbeat connection is a technical problem that needs to be solved urgently by those skilled in the art.
Disclosure of Invention
The application aims to provide a heartbeat communication method, a heartbeat communication system, a computer readable storage medium and a server of a double-control server, which can enhance the stability of heartbeat communication.
In order to solve the above technical problem, the present application provides a heartbeat communication method for a dual control server, and the specific technical scheme is as follows:
generating an NTB channel between the double controllers;
when a storage system of a server is started, a virtual network card is created;
providing a virtual network card IP address corresponding to heartbeat communication on the virtual network card;
and adding the virtual network card to a host machine so that the host machine can select the virtual network card and realize heartbeat communication between nodes by utilizing the NTB channel.
Before the creating of the virtual network card, the method further includes:
and creating a network card drive of the virtual network card.
Wherein, the network card driver for creating the virtual network card comprises:
adding TUN/TAP virtual network equipment in a system kernel;
ko driver module is constructed at the time of compilation of the system kernel;
and adding a command line inserted by the tun.ko drive module into a starting script of the host machine.
Wherein, establish virtual network card includes:
judging whether a/dev/net/tun character device exists or not;
if yes, executing a network card creating command and creating a virtual network card.
Wherein adding the virtual network card to a host machine comprises:
establishing a network bridge between a network card of a virtual machine and the virtual network card;
adding the virtual network card to a network card table, and enabling the virtual machine and the virtual network card to be in the same network segment of IP;
and realizing iscsi monitoring service by using a preset instruction so as to map the block devices of the host machine to the virtual machine and format the block devices into a file system.
The present application further provides a heartbeat communication system of a dual-control server, including:
the channel generation module is used for generating an NTB channel between the double controllers;
the virtual network card creating module is used for creating a virtual network card when a storage system of the server is started;
the virtual network card support module is used for providing a virtual network card IP address corresponding to heartbeat communication on the virtual network card;
and the communication module is used for adding the virtual network card to a host machine so that the host machine can select the virtual network card and realize heartbeat communication between nodes by utilizing the NTB channel.
Wherein, still include:
and the network card driver creating module is used for creating the network card driver of the virtual network card.
Wherein the communication module comprises:
the communication unit is used for establishing a network bridge between a network card of a virtual machine and the virtual network card; adding the virtual network card to a network card table, and enabling the virtual machine and the virtual network card to be in the same network segment of IP; and realizing iscsi monitoring service by using a preset instruction so as to map the block devices of the host machine to the virtual machine and format the block devices into a file system.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method as set forth above.
The present application further provides a server comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method described above when calling the computer program in the memory.
The application provides a heartbeat communication method of a double-control server, comprising the following steps: generating an NTB channel between the double controllers, and creating a virtual network card when a storage system of the server is started; providing a virtual network card IP address corresponding to heartbeat communication on the virtual network card; and adding the virtual network card to a host machine so that the host machine can select the virtual network card and realize heartbeat communication between nodes by utilizing the NTB channel.
The virtual network card is virtualized on the host machine, and the virtual network card is used for nas heartbeat communication on the virtual machine, so that faults can be avoided, and the stability of heartbeat communication is enhanced. The application also provides a heartbeat communication system of the double-control server, a computer readable storage medium and a server, which have the beneficial effects and are not repeated herein.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a heartbeat communication method of a dual control server according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a heartbeat communication system of a dual-control server according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, fig. 1 is a flowchart of a heartbeat communication method of a dual control server according to an embodiment of the present application, where the method includes:
s101: generating an NTB channel between the double controllers;
this step is intended to generate an NTB channel between the dual controllers. It should be noted that the NTB channel needs to be generated before the virtual network card is created, so as to implement the heartbeat communication later.
S102: when a storage system of a server is started, a virtual network card is created;
when the storage system is started, the virtual network card needs to be created immediately to ensure that the virtual network can be used smoothly.
The embodiment does not specifically limit how to create the virtual network card, and the embodiment provides an optimal creation scheme herein.
It should be noted that before the virtual network card is created, a network card driver for creating the virtual network card is usually required. Namely, a network card driver is created first, and then a virtual network card is created. The network card driver for creating the virtual network card comprises the following steps:
the first step is as follows: adding TUN/TAP virtual network equipment in a system kernel;
the TUN and TAP devices are L inux kernel virtual network devices, a pure software implementation, the system sends messages to a user space program connected to the TUN/TAP device, which can send messages to the TUN/TAP interface as if it were a physical interface, at which time the TUN/TAP device sends (or injects) messages to the OS protocol stack as if the messages were received from the physical interface.
The second step is that: ko driver module is constructed at the time of compilation of the system kernel;
the third step: and adding a command line inserted by the tun.ko drive module into a starting script of the host machine.
Ko is the drive module required for TUN devices. When the host computer is started, because the command line of the tun.ko drive module is inserted, the drive corresponding to the virtual network card is created, so that the virtual network card can be immediately created when the storage system is started.
And creating a virtual network card comprises:
judging whether a/dev/net/tun character device exists or not; if yes, executing a network card creating command and creating a virtual network card.
When the kernel sends a data packet to the virtual network device, the data packet is stored in a queue related to the device, and the data packet is not copied into a buffer area of the user space until the user space program reads a descriptor of the opened character device TUN, so that the effect is equivalent to that the data packet is directly sent to the user space.
S103: providing a virtual network card IP address corresponding to heartbeat communication on a virtual network card;
it should be noted that after the virtual network card is created, the IP address of the virtual network card used for heartbeat communication needs to be written to the virtual network card to replace the network card used in the current host, otherwise, the virtual network card cannot replace the physical network card in the host, the NAS heartbeat communication cannot be established by using the virtual network card, and the problem of frequent heartbeat failure caused by the external network cable still exists.
S104: and adding the virtual network card to the host machine so that the host machine can select the virtual network card and realize heartbeat communication between the nodes by utilizing the NTB channel.
In the step, the virtual network card is required to be added to the host machine, and the virtual network card is mainly added to a network card list of the host machine, so that the host machine can directly search the virtual network card from the network card list to realize heartbeat communication when the heartbeat communication is executed.
The method for adding the virtual network card to the host is not specifically limited, and the embodiment provides an optimal adding method:
s1041: establishing a network bridge between a network card of a virtual machine and the virtual network card;
s1042: adding the virtual network card to a network card table, and enabling the virtual machine and the virtual network card to be in the same network segment of IP;
s1043: and realizing iscsi monitoring service by using a preset instruction so as to map the block devices of the host machine to the virtual machine and format the block devices into a file system.
In S1043, an iscsi listening service needs to be implemented, where the preset command is not specifically limited, and the iscsi is an IP-SAN device, which is a cheap SAN device formed by a TCP/IP network encapsulation scsi protocol.
According to the embodiment of the application, the virtual network card is virtualized on the host machine, and the virtual network card is used for NAS heartbeat communication on the virtual machine, so that the heartbeat fault caused by link failure due to the mode of externally inserting a network cable is avoided, and the NAS service is not influenced.
The following describes a heartbeat communication method of a dual-control server provided by the present application with a specific implementation process:
when the storage system is started, the virtual network card needs to be created immediately, and the virtual network can be guaranteed to be used smoothly. And the Agent module of the NAS system is stored and used for managing the link between the NAS virtual machine and the hardware NTB chip, and the channel is a transparent channel for transmitting the NAS heartbeat information. And the Agent module and the NAS virtual network card receive and transmit data.
1. And using the virtual network equipment to create a virtual network card.
①, firstly, a driver of the virtual network card is added to realize the transmission of NAS heartbeat data and configuration information between the virtual machine and the host machine.
a) Adding TUN/TAP virtual network equipment in a linux kernel, and selecting Universal TUN/TAPdevice driver support in the kernel;
b) ko driver module is constructed at kernel compilation time;
c) adding a tun.ko module insertion command into a starting script of a host machine;
② the virtual network card drive is provided, the virtual network card can be created immediately after the host system is started, and the virtual network card can be used smoothly.
a) Judging whether the/dev/net/tun character equipment exists or not;
b) if the command exists, executing a system ec _ createVnic command, and creating a virtual network card;
of course, if there is no dev/net/tun character device, it means that the necessary condition for creating the virtual network card is not satisfied, and message prompt such as creation failure occurs.
c) And providing the IP address of the virtual network card with the NAS heartbeat communication function on the virtual network card.
2. The iscsi target on the host adds support to the virtual network card, and the user can use the iscsi target when establishing a nas file system.
① bridge between the virtual machine network card eth1 and the virtual network card (macvtap mode)
② adding the virtual network card into the network card table in the host machine;
③, establishing IP in the same network segment with the host virtual network card in the virtual machine eth1 for communication;
④ implements iscsi listening services with the command "netstat-lpn | grep 3260" for mapping block devices of a host to a virtual machine formatted as a file system;
3. and the NTB between the host machines is used for realizing the communication between the two node virtual network cards.
And the host agent module is used for connecting the NAS virtual machine and the hardware NTB chip. The channel belongs to a transparent channel for NAS information transmission. And when the data is received, packaging the data and transmitting the data. When data is transmitted, the data is unpacked and transmitted.
In the following, a heartbeat communication system of a dual-control server provided in an embodiment of the present application is introduced, and the heartbeat communication system described below and the heartbeat communication method of the dual-control server described above may be referred to correspondingly.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a heartbeat communication system of a dual-control server according to an embodiment of the present application, and the present application further provides a heartbeat communication system of a dual-control server, including:
a channel generation module 100, configured to generate an NTB channel between two controllers;
the virtual network card creating module 200 is configured to create a virtual network card when a storage system of the server is started;
the virtual network card support module 300 is configured to provide a virtual network card IP address corresponding to heartbeat communication on the virtual network card;
a communication module 400, configured to add the virtual network card to a host, so that the host selects the virtual network card and utilizes the NTB channel to implement heartbeat communication between nodes.
Based on the above embodiment, as a preferred embodiment, the method further includes:
and the network card driver creating module is used for creating the network card driver of the virtual network card.
Based on the above embodiments, as a preferred embodiment, the communication module 400 includes:
the communication unit is used for establishing a network bridge between a network card of a virtual machine and the virtual network card; adding the virtual network card to a network card table, and enabling the virtual machine and the virtual network card to be in the same network segment of IP; and realizing iscsi monitoring service by using a preset instruction so as to map the block devices of the host machine to the virtual machine and format the block devices into a file system.
The present application also provides a computer readable storage medium having stored thereon a computer program which, when executed, may implement the steps provided by the above-described embodiments. The storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The application also provides a server, which may include a memory and a processor, where the memory stores a computer program, and the processor may implement the steps provided by the foregoing embodiments when calling the computer program in the memory. Of course, the server may also include various network interfaces, power supplies, and the like.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the system provided by the embodiment, the description is relatively simple because the system corresponds to the method provided by the embodiment, and the relevant points can be referred to the method part for description.
The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. A heartbeat communication method of a double-control server is characterized by comprising the following steps:
generating an NTB channel between the double controllers;
when a storage system of a server is started, a virtual network card is created;
providing a virtual network card IP address corresponding to heartbeat communication on the virtual network card;
and adding the virtual network card to a host machine so that the host machine can select the virtual network card and realize heartbeat communication between nodes by utilizing the NTB channel.
2. The heartbeat communication method of claim 1, wherein before creating the virtual network card, further comprising:
and creating a network card drive of the virtual network card.
3. The heartbeat communication method of claim 2, wherein creating a network card driver for the virtual network card comprises:
adding TUN/TAP virtual network equipment in a system kernel;
ko driver module is constructed at the time of compilation of the system kernel;
and adding a command line inserted by the tun.ko drive module into a starting script of the host machine.
4. The heartbeat communication method of any one of claims 1 to 3, including creating a virtual network card comprising:
judging whether a/dev/net/tun character device exists or not;
if yes, executing a network card creating command and creating a virtual network card.
5. The heartbeat communication method of claim 1, wherein adding the virtual network card to a host machine includes:
establishing a network bridge between a network card of a virtual machine and the virtual network card;
adding the virtual network card to a network card table, and enabling the virtual machine and the virtual network card to be in the same network segment of IP;
and realizing iscsi monitoring service by using a preset instruction so as to map the block devices of the host machine to the virtual machine and format the block devices into a file system.
6. A heartbeat communication system for a dual-control server, comprising:
the channel generation module is used for generating an NTB channel between the double controllers;
the virtual network card creating module is used for creating a virtual network card when a storage system of the server is started;
the virtual network card support module is used for providing a virtual network card IP address corresponding to heartbeat communication on the virtual network card;
and the communication module is used for adding the virtual network card to a host machine so that the host machine can select the virtual network card and realize heartbeat communication between nodes by utilizing the NTB channel.
7. The heartbeat communication system of claim 5, further comprising:
and the network card driver creating module is used for creating the network card driver of the virtual network card.
8. The heartbeat communication system of claim 5, wherein the communication module includes:
the communication unit is used for establishing a network bridge between a network card of a virtual machine and the virtual network card; adding the virtual network card to a network card table, and enabling the virtual machine and the virtual network card to be in the same network segment of IP; and realizing iscsi monitoring service by using a preset instruction so as to map the block devices of the host machine to the virtual machine and format the block devices into a file system.
9. 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 according to any one of claims 1 to 5.
10. A server, comprising a memory having a computer program stored therein and a processor that implements the steps of the method according to any one of claims 1-5 when called upon by the processor in the memory.
CN202010125777.6A 2020-02-27 2020-02-27 Heartbeat communication method, system and related device of double-control server Withdrawn CN111404997A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010125777.6A CN111404997A (en) 2020-02-27 2020-02-27 Heartbeat communication method, system and related device of double-control server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010125777.6A CN111404997A (en) 2020-02-27 2020-02-27 Heartbeat communication method, system and related device of double-control server

Publications (1)

Publication Number Publication Date
CN111404997A true CN111404997A (en) 2020-07-10

Family

ID=71432140

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010125777.6A Withdrawn CN111404997A (en) 2020-02-27 2020-02-27 Heartbeat communication method, system and related device of double-control server

Country Status (1)

Country Link
CN (1) CN111404997A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112235136A (en) * 2020-10-10 2021-01-15 苏州浪潮智能科技有限公司 Network file system backup method, system, terminal and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112235136A (en) * 2020-10-10 2021-01-15 苏州浪潮智能科技有限公司 Network file system backup method, system, terminal and storage medium
CN112235136B (en) * 2020-10-10 2022-12-23 苏州浪潮智能科技有限公司 Network file system backup method, system, terminal and storage medium

Similar Documents

Publication Publication Date Title
CN106027487B (en) A kind of access management method and system of hardware device
CN110677441B (en) Access method and device of object storage cluster
US20180025049A1 (en) Server and Data Processing Method
CN111404997A (en) Heartbeat communication method, system and related device of double-control server
CN110851303A (en) Data backup method, system and equipment
WO2019074556A1 (en) System and method for creating virtual disk images for use with remote computer
CN112118327A (en) Method and system for conveniently and quickly modifying IP (Internet protocol) of elastic network card under public cloud
CN110928707A (en) Data exchange method and related device for host machine and virtual machine
CN111224881A (en) Routing method, system, equipment and computer readable storage medium
CN113329022B (en) Information processing method of virtual firewall and electronic equipment
CN113626139B (en) High-availability virtual machine storage method and device
CN113162944B (en) Network communication method, device and equipment for security operation platform and security component
Cisco XRemote Configuration Commands
Cisco XRemote Configuration Commands
Cisco XRemote Configuration Commands
Cisco XRemote Configuration Commands
Cisco XRemote Configuration Commands
Cisco XRemote Configuration Commands
Cisco XRemote Configuration Commands
Cisco XRemote Configuration Commands
Cisco XRemote Configuration Commands
Cisco XRemote Configuration Commands
Cisco XRemote Configuration Commands
CN109150810B (en) Set top box convergence gateway and starting method, device and storage medium thereof
CN113691389A (en) Configuration method of load balancer, server and storage medium

Legal Events

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

Application publication date: 20200710

WW01 Invention patent application withdrawn after publication