From d70a02e7415caccd13fad8dda417d0d18a112a83 Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Sun, 24 Feb 2013 17:39:46 +0100 Subject: More flexible distribution config Allow both share_peers and use_shared_peers to be a list of nodes, or a function that returns a list of nodes. --- lib/diameter/doc/src/diameter.xml | 75 ++++++++++++++++++++++++----------- lib/diameter/doc/src/diameter_app.xml | 8 ++-- 2 files changed, 56 insertions(+), 27 deletions(-) (limited to 'lib/diameter/doc/src') diff --git a/lib/diameter/doc/src/diameter.xml b/lib/diameter/doc/src/diameter.xml index df9e03b2da..8ad4af85a3 100644 --- a/lib/diameter/doc/src/diameter.xml +++ b/lib/diameter/doc/src/diameter.xml @@ -43,7 +43,7 @@ under the License. -%VSN% + diameter.xml @@ -774,8 +774,8 @@ Application-Id AVP's in particular.

| evaluable()}

-Specifies the degree to which multiple transport connections to the -same peer are accepted by the service.

+Specifies the degree to which the service allows multiple transport +connections to the same peer.

If type [node()] then a connection is rejected if another already @@ -831,40 +831,60 @@ outgoing requests.

-{share_peers, boolean()} +{share_peers, boolean() | [node()] | evaluable()}

-Specifies whether or not peer connections on the local Erlang node -are shared with services on visible nodes (as returned by &nodes;). -Peers shared from remote nodes become available in the candidates list -passed as the second argument to &app_pick_peer; callbacks.

+Specifies nodes to which peer connections established on the local +Erlang node are communicated. +Shared peers become available in the remote candidates list passed to +&app_pick_peer; callbacks on remote nodes whose services are +configured to use them: see use_shared_peers below.

-Defaults to false.

+If false then peers are not shared. +If [node()] then peers are shared with the specified list of +nodes. +If evaluable() then peers are shared with the nodes returned +by the specified function, evaluated whenever a peer connection +becomes available or a remote service requests information about local +connections. +The value true is equivalent to fun &nodes;. +The value node() in a node list is ignored, so a collection of +services can all be configured to share with the same list of +nodes.

-

-Peers are only shared with other services of the same name. -Since the value of the &application_opt; alias is the handle -for identifying a peer, both local and remote, as a candidate for an -outgoing request, services that share peers should use the same -aliases for identifying their supported applications.

-
+Defaults to false.

-Services that share peers can do so in order to distribute the -implementation of a Diameter node across multiple Erlang nodes, in -which case the participating services should typically be configured -with identical &capabilities;.

+Peers are only shared with services of the same name for the purpose +of sending outgoing requests. +Since the value of the &application_opt; alias, passed to +&call;, is the handle for identifying a peer as a suitable +candidate, services that share peers must use the same aliases to +identify their supported applications. +They should typically also configure identical &capabilities;, since +by sharing peer connections they are distributing the implementation +of a single Diameter node across multiple Erlang nodes.

-{use_shared_peers, boolean()} +{use_shared_peers, boolean() | [node()] | evaluable()}

-Specifies whether or not the service makes use of peer connections -shared by identically named services on other Erlang nodes.

+Specifies nodes from which communicated peers are made available in +the remote candidates list of &app_pick_peer; callbacks.

+ +

+If false then remote peers are not used. +If [node()] then only peers from the specified list of nodes +are used. +If evaluable() then only peers returned by the specified +function are used, evaluated whenever a remote service communicates +information about an available peer connection. +The value true is equivalent to fun &nodes;. +The value node() in a node list is ignored.

Defaults to false.

@@ -874,6 +894,15 @@ Defaults to false.

A service that does not use shared peers will always pass the empty list as the second argument of &app_pick_peer; callbacks.

+ + +

+Sending a request over a peer connection on a remote node is less +efficient than sending it over a local connection. +It may be preferable to make use of the &service_opt; +restrict_connections and maintain a dedicated connection on +each node from which requests are sent.

+
diff --git a/lib/diameter/doc/src/diameter_app.xml b/lib/diameter/doc/src/diameter_app.xml index d094e1bade..d4fb792787 100644 --- a/lib/diameter/doc/src/diameter_app.xml +++ b/lib/diameter/doc/src/diameter_app.xml @@ -37,7 +37,7 @@ under the License. -%REV% + diameter_app.xml @@ -297,9 +297,9 @@ The return values false and {false, State} (that is,

-RemoteCandidates is the empty list if the service has been -configured with the (default) &mod_service_opt; -{use_shared_peers, false}.

+The &mod_service_opt; use_shared_peers determines whether or +not a service uses peers shared from other nodes. +If not then RemoteCandidates is the empty list.

-- cgit v1.2.3