Cluster Network Card Determination via IP Segment Analysis
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In distributed storage clusters, there is no configuration file to indicate which network card is the cluster network card, making it difficult to automatically and accurately determine the cluster network card for real-time monitoring.
Innovation Solution
A method that reads the network segment of Cluster IP from a configuration file, determines the type of the network segment, obtains IPs and network cards corresponding to that type, and calculates the network segment to identify the Cluster IP and its corresponding network card, using functions like ioctl for IPv4 and getifaddrs for IPv6.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Extent of automation
If manual configuration is used to identify cluster network card, then configuration flexibility is maintained, but automation and accuracy of determination are reduced
Solution Approach 1:
The system performs self-identification of the cluster network card by automatically comparing its own IP addresses and network segments against the configured Cluster IP network segment, eliminating the need for external manual configuration or intervention
Solution Approach 2:
The manual mechanical process of configuring and identifying network cards is replaced with an automated computational system that uses IP address comparison algorithms to automatically determine which network card is the cluster network card
2Measurement precision
If random IP selection is used for Cluster IP, then network card identification becomes easier, but accuracy and reliability of cluster communication is reduced
Solution Approach 1:
The system uses feedback from IP address comparison to verify whether a network card's IP belongs to the Cluster IP network segment, continuously checking and confirming the correct network card identification through systematic comparison
Solution Approach 2:
The identification process is segmented into distinct steps: obtaining Cluster IP network segment information, retrieving local network card IP addresses, calculating network segments, comparing segments, and identifying the matching network card, making the complex process manageable and accurate
3Ease of operation
If no configuration file is used to indicate cluster network card, then configuration simplicity is improved, but ability to accurately identify cluster network card is reduced
Solution Approach 1:
The configuration file serves multiple functions: it stores the Cluster IP network segment information that is used both for network communication and for automatic identification of the cluster network card, eliminating the need for separate identification configuration
Data Source
AI summary
A method and device for determining a cluster network card, and a computer readable storage medium. The method comprises: reading a network segment of a Cluster IP from a configuration file of a current node; determining the type of the network segment of the Cluster IP by means of an address string in the network segment of the Cluster IP; obtaining an IP and a network card corresponding to the type of the network segment of the Cluster IP on the current node; and calculating the network segment of each IP, determining the IP corresponding to the network segment with the same address string as a Cluster IP, and determining the network card where the IP is located as a cluster network card. According to the disclosure, the cluster network card can be automatically and accurately found according to the configuration file.


