In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article is reproduced from the official account kiritomoe, not only learning results, but also learning how good people think.
I once wrote an article similar to the title of this article, "thinking about elegant downtime". The above and this article have one thing in common: network card address registration and elegant downtime are very small knowledge points. however, the knowledge involved is a huge system, and like most readers, I was in the stage of "knowing such a thing but not knowing the details" before writing this kind of article. But once you dig deep, you will feel the wonder and have the opportunity to get in touch with a lot of knowledge points that you don't usually pay much attention to.
In addition, I would also like to introduce a technique called "meta-reading". Maybe I coined the word myself, and some people call it "super-perspective reading". Its connotation means that what ordinary readers learn from my article is a certain knowledge point, while Yuanyue readers may pay extra attention to how I master a certain knowledge point from my article. In the process of learning a knowledge point, I pay attention to which knowledge points are related to them, and how to connect them together to form a system. This article is a typical example. I will diverge on some points. You can try to think about the issue of "network card address registration" with me.
1 how to choose the appropriate address of the network card
Perhaps quite a number of people do not know what I am going to talk about in this article. If I say a scene, it should be clear. In the process of distributed service invocation, taking Dubbo as an example, service providers often need to report their IP addresses to the registry for consumers to discover. Dubbo works fine in most cases, but if you pay attention to Dubbo's github issue, there's a lot of feedback: Dubbo Provider registered the wrong IP. If you can immediately think of keywords such as multiple network cards, coexistence of internal and external network addresses, VPN, virtual network cards and so on, then I suggest you continue to read this article, because I also think of these, they are all things to be discussed in this article! So "how to choose the appropriate address of the network card"? Is the existing logic of Dubbo complete after all? Are there any improvement measures? We are not in a hurry to answer it, but bring these questions to study together. I believe that at the end of the article, you will have your own comments on the answers.
2 how does Dubbo do it?
The logic of Dubbo to obtain the address of the network card is also a thousand twists and turns in each version, and it has also been optimized. We use the latest 2.7.2-SNAPSHOT version to introduce it. When you look at the following source code, you can read it with questioning mentality, and you can get the source code in the master branch of dubbo github. The logic to get localhost is in org.apache.dubbo.common.utils.NetUtils#getLocalAddress0 ()
Private static InetAddress getLocalAddress0 () {
InetAddress localAddress = null
/ / first try to get the IP corresponding to hostname in / etc/hosts
LocalAddress = InetAddress.getLocalHost ()
Optional addressOp = toValidAddress (localAddress)
If (addressOp.isPresent ()) {
Return addressOp.get ()
}
/ / if no IP suitable for registration is found, start polling the network card
Enumeration interfaces = NetworkInterface.getNetworkInterfaces ()
If (null = = interfaces) {
Return localAddress
}
While (interfaces.hasMoreElements ()) {
NetworkInterface network = interfaces.nextElement ()
Enumeration addresses = network.getInetAddresses ()
While (addresses.hasMoreElements ()) {
/ / return the first matching IP suitable for registration
Optional addressOp = toValidAddress (addresses.nextElement ())
If (addressOp.isPresent ()) {
Return addressOp.get ()
}
}
}
Return localAddress
}
The logic of obtaining localhost in Dubbo is roughly divided into two steps.
First go to the / etc/hosts file to find the IP address corresponding to hostname. If you find it, return it. If you can't find it, transfer to 2.
Poll the network card to find the appropriate IP address and return it if you find it. If you cannot find the return null, there is a logic outside the getLocalAddress0. If null is returned, register the local loopback address 127.0.0.1.
First of all, there is not much problem with this logic. Let's analyze some of the details and verify them.
2.1 attempt to get hostname mapping IP
Dubbo first selects the IP corresponding to hostname and the corresponding InetAddress.getLocalHost () in the source code. When the Dubbo application is actually deployed in * nix system, you can first use the hostname command to obtain the host name.
XujingfengdeMacBook-Pro:~ xujingfeng$ hostnamexujingfengdeMacBook-Pro.local
Immediately after configuring the IP mapping in / etc/hosts, to verify the mechanism of Dubbo, we randomly configure an IP address for hostname
127.0.0.1 localhost1.2.3.4 xujingfengdeMacBook-Pro.local
Then call NetUtils.getLocalAddress0 () to verify, and the console prints as follows:
XujingfengdeMacBook-Pro.local/1.2.3.42.2 determines a valid IP address
In toValidAddress logic, Dubbo has the following logic to determine whether an IP address is valid.
Private static Optional toValidAddress (InetAddress address) {if (address instanceof Inet6Address) {Inet6Address v6Address = (Inet6Address) address; if (isValidV6Address (v6Address)) {return Optional.ofNullable (normalizeV6Address (v6Address));}} if (isValidV4Address (address)) {return Optional.of (address);} return Optional.empty ();}
Verify that it conforms to the IP specification of Ipv6 or Ipv4 in turn. For the address of Ipv6, see the following code:
Static boolean isValidV6Address (Inet6Address address) {boolean preferIpv6 = Boolean.getBoolean ("java.net.preferIPv6Addresses"); if (! preferIpv6) {return false;} try {return address.isReachable;} catch (IOException e) {/ / ignore} return false;}
First, get the java.net.preferIPv6Addresses parameter, whose default value is false. Since most applications do not use Ipv6 address as the ideal registration IP, this is not a big problem, and then use isReachable to determine the connectivity of the network card. For example, some network cards may be the addresses of VPN/ virtual network cards. If they are not configured with a routing table, they are often unable to connect and can be filtered.
For the address of Ipv4, see the following code:
Static boolean isValidV4Address (InetAddress address) {if (address = = null | | address.isLoopbackAddress ()) {return false;} String name = address.getHostAddress (); boolean result = (name! = null & & IP_PATTERN.matcher (name). Matches () & & Constants.ANYHOST_VALUE.equals (name) & &! Constants.LOCALHOST_VALUE.equals (name)); return result;}
Compared with Ipv6's judgment, here we have found the asymmetry between front and back.
Compared with Ipv6, Ipv4 has more regular check, local loopback address check and ANYHOST check in Ipv4 format.
Compared with Ipv6, the logic of Ipv4 has less check of network card connectivity.
As we all know, Ipv4 defines 127.0.0.1 as the local loopback address, and the Ipv6 also has a loopback address: 0VOV0VOUR 0R0V1or:: 1. The suggestion for improvement is also obvious, and we put it to a unified summary at the end of the article.
2.3 polling network card
If the above address acquisition is null, then enter the logic of polling the network card (for example, if hosts does not specify the mapping of hostname or hostname is configured to 127.0.0.1 and so on, the empty network card address will be obtained). The corresponding source code of the polling network card is NetworkInterface.getNetworkInterfaces (), which involves more knowledge points, which supports my material for writing this article. The logic of Dubbo is not complex, and simple verification is carried out. Just return to the first available IP.
Impatient readers may not be able to help it, many network cards! There may be more than one suitable network card, how does Dubbo deal with it? According to reason, let's do justice for Dubbo. Why don't you make your own appointment? We first agree on the scenario of multiple network cards before we can continue to finish this article: we can only filter those "wrong" network cards as much as possible. Dubbo seems to treat all network cards equally, can we try to optimize the logic in it?
In many open source service governance frameworks, problems related to misregistration of IP are very high in stackoverflow or its issue, and most of them are caused by polling network cards. Now that things have come to this point, it is necessary to know something about networks and network cards before we can filter out IP addresses that are obviously not suitable for RPC service registration.
3 introduction to Ifconfig
I do not want to deter you from the follow-up content, specifically chose this most familiar Linux command! Please turn a blind eye to the complaints: "Oh, my God, it's 2019 years, why are you still using net-tools/ifconfig,iproute2/ip to learn about it?" Whether you are using mac or linux, you can use it to CRUD your network card configuration.
3.1 Common instructions
Start and close the specified network card:
Ifconfig eth0 upifconfig eth0 down
Ifconfig eth0 up is to start the network card eth0, and ifconfig eth0 down is to close the network card eth0. Ssh login linux server users should be careful to perform this operation, do not cry themselves. Otherwise, you need to go to google: "how to remotely connect to the Linux server after disabling the eth0 network card".
Configure and delete IPv6 addresses for the network card:
Ifconfig eth0 add 33ffe:3240:800:1005::2/64 # configure IPv6 address for Nic eth0 ifconfig eth0 del 33ffe:3240:800:1005::2/64 # Delete IPv6 address for Nic eth0
Modify the MAC address with ifconfig:
Ifconfig eth0 hw ether 00:AA:BB:CC:dd:EE
Configure the IP address:
[root@localhost ~] # ifconfig eth0 192.168.2.10 [root@localhost ~] # ifconfig eth0 192.168.2.10 netmask 255.255.255.0 [root@localhost ~] # ifconfig eth0 192.168.2.10 netmask 255.255.255.0 broadcast 192.168.2.255
Enable and disable the arp protocol:
Ifconfig eth0 arp # enable the arp protocol of the network card eth0 ifconfig eth0-arp # disable the arp protocol of the network card eth0
Set the maximum transmission unit:
Ifconfig eth0 mtu 1500 # sets the maximum big data packet size to 1500 bytes3.2 to view Nic information.
Execute ifconfig-an on a ubuntu
Ubuntu@VM-30-130 MUBUBUTU VAT $ifconfig-a
Eth0 Link encap:Ethernet HWaddr 52:54:00:a9:5f:ae
Inet addr:10.154.30.130 Bcast:10.154.63.255 Mask:255.255.192.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:149673 errors:0 dropped:0 overruns:0 frame:0
TX packets:152271 errors:0 dropped:0 overruns:0 carrier:0
Collisions:0 txqueuelen:1000
RX bytes:15205083 (15.2 MB) TX bytes:21386362 (21.3MB)
Lo Link encap:Local Loopback
Inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
Collisions:0 txqueuelen:1
RX bytes:0 (0.0B) TX bytes:0 (0.0B)
Docker0 Link encap:Ethernet HWaddr 02:42:58:45:c1:15
Inet addr:172.17.0.1 Bcast:172.17.255.255 Mask:255.255.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
Collisions:0 txqueuelen:0
RX bytes:0 (0.0B) TX bytes:0 (0.0B)
Tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
UP POINTOPOINT NOARP MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
Collisions:0 txqueuelen:100
RX bytes:0 (0.0B) TX bytes:0 (0.0B)
In order to prevent hackers from attacking my Linux, I secretly made some "modifications" to IP. Please don't embarrass a young man who takes advantage of discounts and groups to buy cheap cloud servers. Detailed interpretation of the departmental network card:
Eth0 represents the first network card, where HWaddr represents the physical address of the network card. You can see that the current physical address (MAC address) of this network card is 02MAC 42MAC 38Rd 52Rd 70LV 54.
Inet addr is used to represent the IP address of the network card. The IP address of this network card is 10.154.30.130, broadcast address, Bcast: 172.18.255.255, mask address Mask:255.255.0.0
Lo is the loopback address of the host, which is generally used to test a network program, but does not want users of the local area network or external network to view it, so it can only run and view the network interface used on this host. For example, assign the HTTPD server to the bad address and type 127.0.0.1 in the browser to see your WEB site. But only you can see, other hosts or users of the local area network do not know.
First line: connection type: Ethernet (Ethernet) HWaddr (hardware mac address)
Second line: IP address, subnet, mask of the network card
Line 3: UP (for the network card's open status) RUNNING (the network cable for the network card is connected) MULTICAST (supports multicast) MTU:1500 (maximum transmission unit): 1500 bytes (ipconfig without-a, you can't see the network card of DOWN)
Fourth and fifth elements: statistics of receiving and sending packets
Line 7: receive and send data byte statistics.
How did the next two network cards docker0,tun0 come out? I installed docker and openvpn on my ubuntu. These two things should be the main culprits that interfere with our service registration every day. of course, there may also be a second network card like eth2. What ifconfig-a sees corresponds to JDK's api: NetworkInterface.getNetworkInterfaces (). Let's make a brief summary, there are roughly three disturbing factors.
The address of the virtual network card headed by the docker bridge, after all, this thing is so popular, how can it be listed separately?
Virtual network card addresses represented by TUN/TAP are mostly VPN scenarios
Eth2 as the representative of the multi-network card scene, money can install multiple network cards!
Our follow-up space will introduce these scenes separately, trying to make sure that everyone has not eaten pork, or at least see how the pig runs.
4 interference factor 1: Docker bridge
Friends who are familiar with docker should know that docker creates a docker0 bridge by default for the container instance to connect. If the default bridge is not intuitive enough, we can use bridge mode to customize the creation of a new bridge:
Ubuntu@VM-30-130MUBUUUTU ifconfig abr-a38696dbbe58 Link encap:Ethernet HWaddr 02:42:6e:aa:fd:0c inet addr:172.19.0.1 Bcast:172.19.255.255 Mask:255.255.0.0 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets $docker network create kirito-bridgea38696dbbe58aa916894c674052c4aa6ab32266dcf6d8111fb794b8a344aa0d9ubuntu@VM-30-130MUBUUUTU VAT: 0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0B) TX bytes:0 (0.0B)
After using the docker network instruction to create the bridge, the corresponding network card is automatically created. I only give the incremental return part of the ifconfig-a, and you can see that there is an extra br-a38696dbbe58 network card.
I deliberately distinguish between "bridge" and "network card". You can use bridge-utils/brctl to view bridge information:
Ubuntu@VM-30-130 MUBUBUUTU VOLTION $sudo brctl showbridge name bridge id STP enabled interfacesbr-a38696dbbe58 8000.02426eaafd0c nodocker0 8000.02425845c215 no
A bridge is a virtual device that can only be seen by brctl show. After the bridge is created, a network card with the same name is automatically created and added to the bridge.
5 interference factor 2: TUN/TAP virtual network equipment
What we usually call virtual network cards and virtual machines are roughly related to TUN/TAP. Most of my readers are Java practitioners, I believe the following content is not too superb, do not be fooled by unfamiliar nouns. For readers who are bluffed, they can also skip 5.1 to 5.3 and watch 5.4 directly.
5.1 how the real network card works
The eth0 in the figure above represents the real network card interface (interface) that our host already has.
The real network card represented by the network card interface eth0 is connected to the external network through the network cable (wire). The data packets received by the physical network card will be transmitted to the network protocol stack (Network Stack) of the kernel via the interface eth0. These packets are then further processed by the protocol stack.
For some incorrect packets, the protocol stack can choose to discard; for packets that do not belong to the local machine, the protocol stack can choose to forward them; and for packets that are indeed delivered to the local machine, and the packet is really needed by the upper application, the protocol stack will inform the upper layer of the waiting application through Socket API.
5.2 how TUN works
We know that the ordinary network card sends and receives data packets through the network cable, while the TUN device is relatively special, it sends and receives data packets through a file.
As shown in the figure above, tunX and the above eth0 are logically equivalent, and tunX also represents a network interface, although this interface is simulated by the system through software.
The virtual network card represented by the network card interface tunX is connected to our application program (App) through a file / dev/tunX. Every time the application program uses a system call such as write to write data to this file, the data will be transferred to the network protocol stack through the virtual network card and through the network interface tunX through the network layer packet. At the same time, the application program can also be transferred to the network protocol stack through system calls such as read. All packets passed to tunX by the protocol stack are read via the file / dev/tunX.
In addition, the protocol stack can manipulate the virtual network card represented by tunX just like an ordinary network card. For example, set the IP address and route for tunX. In short, from the point of view of the protocol stack, the network card represented by tunX is not much different from other ordinary network cards. Of course, there is still a difference, that is, there is no MAC address for tunX devices, which is easy to understand. TunX is only simulated to the network layer, and there is no point in asking for a MAC * address. Of course, if it is * tapX, there is no difference between tapX and a real Nic in the eyes of the protocol stack.
Are you a little confused? Who am I and why I want to learn TUN in this article! Because our commonly used VPN is basically based on TUN/TAP, if we use TUN devices to build a UDP-based VPN, then the whole process may look like this:
5.3 how TAP works
TAP devices work in exactly the same way as TUN devices, except that:
TUN device is a three-layer device, it only simulates to the IP layer, that is, the network layer we can send and receive IP layer packets through the / dev/tunX file, it cannot do bridge with the physical network card, but it can connect with the physical network card through layer 3 switching (such as ip_forward). You can use commands such as ifconfig to set the IP address for the device.
TAP device is a layer 2 device, which is deeper than TUN. It can send and receive MAC layer packets, that is, data link layer, through / dev/tapX file. It has MAC layer function, can do bridge with physical network card, and supports MAC layer broadcast. Similarly, we can also set the IP address for the device through commands such as ifconfig, and we can give it an MAC address if you like.
With regard to the second and third layers that appear in the article, I will explain here that the first layer is the physical layer, the second layer is the data link layer, the third layer is the network layer, and the fourth layer is the transport layer.
5.4 openvpn actual combat
Openvpn is an open source vpn tool on Linux, and we use it to recreate the scenarios that affect our choice of network cards.
Install openvpn
Sudo apt-get install openvpn
Install a TUN device:
Ubuntu@VM-30-130 sudo openvpn ubuntu dev tun0Mon Apr dev tun0Mon Apr 29 22:23:31 2019 TUN/TAP device tun0 openedMon Apr 29 22:23:31 2019 Persist state set to: ON
Install a TAP device:
Ubuntu@VM-30-130 sudo openvpn ubuntu dev tap0Mon Apr dev tap0Mon Apr 29 22:24:36 2019 TUN/TAP device tap0 openedMon Apr 29 22:24:36 2019 Persist state set to: ON
Execute ifconfig-a to check the Nic and only give the increments:
Tap0 Link encap:Ethernet HWaddr 7a:a2:a8:f1:6b:df
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
Collisions:0 txqueuelen:100
RX bytes:0 (0.0B) TX bytes:0 (0.0B)
Tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
Inet addr:10.154.30.131 P-t-P:10.154.30.131 Mask:255.255.255.255
UP POINTOPOINT NOARP MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
Collisions:0 txqueuelen:100
RX bytes:0 (0.0B) TX bytes:0 (0.0B)
This explains why there is a network card like tun0 at the beginning of the article. Readers here may wonder, isn't it possible to create tap and tun NICs using ifconfig? Of course, openvpn is a vpn tool that can only create network cards called tunX/tapX, which follow certain specifications. Ifconfig can be created at will, but no one recognizes those network cards that are created at will.
6 interference factor 3: multiple network cards
There is not much to say about this, there are many real network cards, from Puge to get the above IP information.
7 differences under MAC
Although ifconfig and other instructions are common to * nux, their display information, network card-related attributes and naming are quite different. For example, this is the return of executing ifconfig-a under my MAC:
XujingfengdeMacBook-Pro:dubbo-in-action xujingfeng$ ifconfig-alo0: flags=8049 mtu 16384 options=1203 inet 127.0.0.1 netmask 0xff000000 inet6:: 1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 nd6 options=201gif0: flags=8010 mtu 1280stf0: flags=0 mtu 1280XHC0: flags=0 mtu 0XHC20: flags=0 mtu 0en0: flags=8863 mtu 1500 ether 88:e9:fe:88:a0:76 inet6 fe80::1cab:f689:60d1:bacb%en0 prefixlen 64 secured scopeid 0x6 inet 30.130.11.242 netmask 0xffffff80 broadcast 30.130. 11.255 nd6 options=201 media: autoselect status: activep2p0: flags=8843 mtu 2304 ether 0a:e9:fe:88:a0:76 media: autoselect status: inactiveawdl0: flags=8943 mtu 1484 ether 66:d2:8c:8c:dd:85 inet6 fe80::64d2:8cff:fe8c:dd85%awdl0 prefixlen 64 scopeid 0x8 nd6 options=201 media: autoselect status: activeen1: flags=8963 mtu 1500 options=60 ether aa:00:d0:13:0e:01 media: autoselect status: inactiveen2: flags=8963 mtu 1500 options=60 Ether aa:00:d0:13:0e:00 media: autoselect status: inactivebridge0: flags=8863 mtu 1500 options=63 ether aa:00:d0:13:0e:01 Configuration: id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0 maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200 root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0 ipfilter disabled flags 0x2 member: en1 flags=3 ifmaxaddr 0 port 9 priority 0 path cost 0 member: en2 flags=3 ifmaxaddr 0 port 10 priority 0 path cost 0 nd6 options=201 media: status: inactiveutun0: flags=8051 mtu 2000 inet6 fe80::3fe0:3e8b:384:9968%utun0 prefixlen 64 scopeid 0xc nd6 options=201utun1: flags=8051 mtu 1380 inet6 fe80::7894:3abc:5abd:457d%utun1 prefixlen 64 scopeid 0xd nd6 options=201
There are a lot of contents. I would like to highlight a few differences:
The form of content display is different, and there is no statistical information such as the number of bytes of data received and sent under Linux.
The name of the real Nic is different: eth0-> en0
The naming format of the virtual network card is different: tun/tap-> utun
For the interpretation of the names of these common network cards, I extracted some of the answers from stackoverflow:
In arbitrary order of my familarity / widespread relevance:
Lo0 is loopback.
En0 at one point "ethernet", now is WiFi (and I have no idea what extra en1 or en2 are used for).
Fw0 is the FireWire network interface.
Stf0 is an IPv6 to IPv4 tunnel interface to support the transition from IPv4 to the IPv6 standard.
Gif0 is a more generic tunneling interface [46]-to- [46].
Awdl0 is Apple Wireless Direct Link
P2p0 is related to AWDL features. Either as an old version, or virtual interface with different semantics than awdl.
The "Network" panel in System Preferences to see what network devices "exist" or "can exist" with current configuration.
Many VPNs will add additional devices, often "utun#" or "utap#" following TUN/TAP (L3/L2) virtual networking devices.
Use netstat-nr to see how traffic is currently routed via network devices according to destination.
Interface naming conventions started in BSD were retained in OS X / macOS, and now there also additions.
8 suggestions for improvement of Dubbo
We have carried out the above exploration, which can be regarded as a little understanding of the network card. Looking back at Dubbo's logic of obtaining a network card, can it be improved?
Dubbo Action 1:
Maintain consistent verification of Ipv4 and Ipv6. Add connectivity check for Ipv4 and LoopBack and ANYHOST check for Ipv6.
Dubbo Action 2:
NetworkInterface network = interfaces.nextElement (); if (network.isLoopback () | | network.isVirtual () | |! network.isUp ()) {continue;}
JDK provides the above API, which we can use to filter some network cards that must be incorrect.
Dubbo Action 3:
We spend a lot of space in this article to introduce the problems of virtual network cards caused by docker and TUN/TAP scenarios, which is a common influencing factor. Although their names are fixed, such as docker0, tunX and tapX, I think there are some hack to filter registration IP through the judgment of network card names, so it is not recommended for dubbo contributor to propose corresponding pr to add these hack judgments, although it may be helpful to the judgment.
For the real multi-Nic, internal and external network IP coexistence scenario, not only the frame side is making efforts, users also need to do something, just like love, I can take the initiative, but you also have to feedback in order to develop the story.
Dubbo User Action 1:
You can configure the / etc/hosts file to configure the IP display corresponding to hostname.
Dubbo User Action 2:
You can use startup parameters to display the specified registered IP:
-DDUBBO_IP_TO_REGISTRY=1.2.3.4
You can also specify which network card the Dubbo service is bound to:
-DDUBBO_IP_TO_BIND=1.2.3.49 reference articles
Analysis of TUN/TAP equipment
What-are-en0-en1-p2p-and-so-on-that-are-displayed-after-executing-ifconfig
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 269
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.