Symptom: in ErlangProgramAfter the startup, as long as an external Erlang program is accepted through gen_server: Call or other accesses, many unknown Erlang processes will appear.
Analysis: At the beginning, I thought something went wrong. During the local test, there was no such phenomenon. Check these unknown Erlang processes and find that each of them has a port, then we can find through the nodes () function that the Erlang program and many modules have established links. When the Erlang program is started, the default value isTransitiveFully connected,That is, when node A is connected to Node B and Node B is connected to node C, node A is also connected to node C, thus forming a fully connected network.
Reprinted as follows:
But sometimes we want to connect to a node instead of other nodes (for example, a node is only used to view some information about the cluster ), in this case, you can specify this node as the hidden node (specify the-hidden parameter when the node starts). The hidden node is not added to the fully connected network of the cluster. The hidden node can also reduce the number of TCP/IP connections: Because if the number of nodes in a cluster is N, the number of TCP/IP connections is: N * (N-1)/2. Therefore, if you set a node that does not need to be fully connected to a den node, the node will be removed from the fully connected network, this reduces the number of TCP/IP connections.
Note that by default, nodes () does not return the hidden node. You can specify the hidden or connected parameter (that is, node (hidden) or node (connected) To return the information of the hidden node.