Sophie

Sophie

distrib > Fedora > 17 > x86_64 > by-pkgid > 675c8c8167236dfcf8d66da674f931e8 > files > 111

erlang-doc-R15B-03.3.fc17.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns:fn="http://www.w3.org/2005/02/xpath-functions">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../otp_doc.css" type="text/css">
<title>Erlang -- Distributed Erlang</title>
</head>
<body bgcolor="white" text="#000000" link="#0000ff" vlink="#ff00ff" alink="#ff0000"><div id="container">
<script id="js" type="text/javascript" language="JavaScript" src="../js/flipmenu/flipmenu.js"></script><script id="js2" type="text/javascript" src="../js/erlresolvelinks.js"></script><script language="JavaScript" type="text/javascript">
            <!--
              function getWinHeight() {
                var myHeight = 0;
                if( typeof( window.innerHeight ) == 'number' ) {
                  //Non-IE
                  myHeight = window.innerHeight;
                } else if( document.documentElement && ( document.documentElement.clientWidth ||
                                                         document.documentElement.clientHeight ) ) {
                  //IE 6+ in 'standards compliant mode'
                  myHeight = document.documentElement.clientHeight;
                } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
                  //IE 4 compatible
                  myHeight = document.body.clientHeight;
                }
                return myHeight;
              }

              function setscrollpos() {
                var objf=document.getElementById('loadscrollpos');
                 document.getElementById("leftnav").scrollTop = objf.offsetTop - getWinHeight()/2;
              }

              function addEvent(obj, evType, fn){
                if (obj.addEventListener){
                obj.addEventListener(evType, fn, true);
                return true;
              } else if (obj.attachEvent){
                var r = obj.attachEvent("on"+evType, fn);
                return r;
              } else {
                return false;
              }
             }

             addEvent(window, 'load', setscrollpos);

             //--></script><div id="leftnav"><div class="innertube">
<img alt="Erlang logo" src="../erlang-logo.png"><br><small><a href="users_guide.html">User's Guide</a><br><a href="../pdf/otp-system-documentation-5.9.3.1.pdf">PDF</a><br><a href="../index.html">Top</a></small><p><strong>Erlang Reference Manual</strong><br><strong>User's Guide</strong><br><small>Version 5.9.3.1</small></p>
<br><a href="javascript:openAllFlips()">Expand All</a><br><a href="javascript:closeAllFlips()">Contract All</a><p><small><strong>Chapters</strong></small></p>
<ul class="flipMenu" imagepath="../js/flipmenu">
<li id="no" title="Introduction" expanded="false">Introduction<ul>
<li><a href="introduction.html">
              Top of chapter
            </a></li>
<li title="Purpose"><a href="introduction.html#id73748">Purpose</a></li>
<li title="Prerequisites"><a href="introduction.html#id66106">Prerequisites</a></li>
<li title="Document Conventions"><a href="introduction.html#id67296">Document Conventions</a></li>
<li title="Complete List of BIFs"><a href="introduction.html#id68121">Complete List of BIFs</a></li>
<li title="Reserved Words"><a href="introduction.html#id60679">Reserved Words</a></li>
<li title="Character Set"><a href="introduction.html#id61758">Character Set</a></li>
</ul>
</li>
<li id="no" title="Data Types" expanded="false">Data Types<ul>
<li><a href="data_types.html">
              Top of chapter
            </a></li>
<li title="Terms"><a href="data_types.html#id63330">Terms</a></li>
<li title="Number"><a href="data_types.html#id68697">Number</a></li>
<li title="Atom"><a href="data_types.html#id62285">Atom</a></li>
<li title="Bit Strings and Binaries"><a href="data_types.html#id68011">Bit Strings and Binaries</a></li>
<li title="Reference"><a href="data_types.html#id58120">Reference</a></li>
<li title="Fun"><a href="data_types.html#id67499">Fun</a></li>
<li title="Port Identifier"><a href="data_types.html#id69290">Port Identifier</a></li>
<li title="Pid"><a href="data_types.html#id60853">Pid</a></li>
<li title="Tuple"><a href="data_types.html#id73719">Tuple</a></li>
<li title="List"><a href="data_types.html#id73198">List</a></li>
<li title="String"><a href="data_types.html#id68626">String</a></li>
<li title="Record"><a href="data_types.html#id65682">Record</a></li>
<li title="Boolean"><a href="data_types.html#id67471">Boolean</a></li>
<li title="Escape Sequences"><a href="data_types.html#id73885">Escape Sequences</a></li>
<li title="Type Conversions"><a href="data_types.html#id69219">Type Conversions</a></li>
</ul>
</li>
<li id="no" title="Pattern Matching" expanded="false">Pattern Matching<ul>
<li><a href="patterns.html">
              Top of chapter
            </a></li>
<li title="Pattern Matching"><a href="patterns.html#id68202">Pattern Matching</a></li>
</ul>
</li>
<li id="no" title="Modules" expanded="false">Modules<ul>
<li><a href="modules.html">
              Top of chapter
            </a></li>
<li title="Module Syntax"><a href="modules.html#id68326">Module Syntax</a></li>
<li title="Module Attributes"><a href="modules.html#id68358">Module Attributes</a></li>
<li title="Comments"><a href="modules.html#id74337">Comments</a></li>
<li title="The module_info/0 and module_info/1 functions"><a href="modules.html#id74350">The module_info/0 and module_info/1 functions</a></li>
</ul>
</li>
<li id="no" title="Functions" expanded="false">Functions<ul>
<li><a href="functions.html">
              Top of chapter
            </a></li>
<li title="Function Declaration Syntax"><a href="functions.html#id74609">Function Declaration Syntax</a></li>
<li title="Function Evaluation"><a href="functions.html#id74724">Function Evaluation</a></li>
<li title="Tail recursion"><a href="functions.html#id74875">Tail recursion</a></li>
<li title="Built-In Functions, BIFs"><a href="functions.html#id74908">Built-In Functions, BIFs</a></li>
</ul>
</li>
<li id="no" title="Types and Function Specifications" expanded="false">Types and Function Specifications<ul>
<li><a href="typespec.html">
              Top of chapter
            </a></li>
<li title="Introduction of Types"><a href="typespec.html#id75024">Introduction of Types</a></li>
<li title="Types and their Syntax"><a href="typespec.html#id75072">Types and their Syntax</a></li>
<li title="Type declarations of user-defined types"><a href="typespec.html#id75688">Type declarations of user-defined types</a></li>
<li title="Type information in record declarations"><a href="typespec.html#id75770">Type information in record declarations</a></li>
<li title="Specifications for functions"><a href="typespec.html#id75847">Specifications for functions</a></li>
</ul>
</li>
<li id="no" title="Expressions" expanded="false">Expressions<ul>
<li><a href="expressions.html">
              Top of chapter
            </a></li>
<li title="Expression Evaluation"><a href="expressions.html#id76067">Expression Evaluation</a></li>
<li title="Terms"><a href="expressions.html#id76110">Terms</a></li>
<li title="Variables"><a href="expressions.html#id76122">Variables</a></li>
<li title="Patterns"><a href="expressions.html#id76253">Patterns</a></li>
<li title="Match"><a href="expressions.html#id76372">Match</a></li>
<li title="Function Calls"><a href="expressions.html#id76431">Function Calls</a></li>
<li title="If"><a href="expressions.html#id76631">If</a></li>
<li title="Case"><a href="expressions.html#id76696">Case</a></li>
<li title="Send"><a href="expressions.html#id76761">Send</a></li>
<li title="Receive"><a href="expressions.html#id76844">Receive</a></li>
<li title="Term Comparisons"><a href="expressions.html#id77009">Term Comparisons</a></li>
<li title="Arithmetic Expressions"><a href="expressions.html#id77270">Arithmetic Expressions</a></li>
<li title="Boolean Expressions"><a href="expressions.html#id77776">Boolean Expressions</a></li>
<li title="Short-Circuit Expressions"><a href="expressions.html#id77931">Short-Circuit Expressions</a></li>
<li title="List Operations"><a href="expressions.html#id78047">List Operations</a></li>
<li title="Bit Syntax Expressions"><a href="expressions.html#id78116">Bit Syntax Expressions</a></li>
<li title="Fun Expressions"><a href="expressions.html#id78658">Fun Expressions</a></li>
<li title="Catch and Throw"><a href="expressions.html#id78840">Catch and Throw</a></li>
<li title="Try"><a href="expressions.html#id78986">Try</a></li>
<li title="Parenthesized Expressions"><a href="expressions.html#id79344">Parenthesized Expressions</a></li>
<li title="Block Expressions"><a href="expressions.html#id79376">Block Expressions</a></li>
<li title="List Comprehensions"><a href="expressions.html#id79401">List Comprehensions</a></li>
<li title="Bit String Comprehensions"><a href="expressions.html#id79541">Bit String Comprehensions</a></li>
<li title="Guard Sequences"><a href="expressions.html#id79673">Guard Sequences</a></li>
<li title="Operator Precedence"><a href="expressions.html#id80211">Operator Precedence</a></li>
</ul>
</li>
<li id="no" title="The Preprocessor" expanded="false">The Preprocessor<ul>
<li><a href="macros.html">
              Top of chapter
            </a></li>
<li title="File Inclusion"><a href="macros.html#id80530">File Inclusion</a></li>
<li title="Defining and Using Macros"><a href="macros.html#id80659">Defining and Using Macros</a></li>
<li title="Predefined Macros"><a href="macros.html#id80782">Predefined Macros</a></li>
<li title="Macros Overloading"><a href="macros.html#id80850">Macros Overloading</a></li>
<li title="Flow Control in Macros"><a href="macros.html#id80919">Flow Control in Macros</a></li>
<li title="Stringifying Macro Arguments"><a href="macros.html#id81056">Stringifying Macro Arguments</a></li>
</ul>
</li>
<li id="no" title="Records" expanded="false">Records<ul>
<li><a href="records.html">
              Top of chapter
            </a></li>
<li title="Defining Records"><a href="records.html#id81178">Defining Records</a></li>
<li title="Creating Records"><a href="records.html#id81209">Creating Records</a></li>
<li title="Accessing Record Fields"><a href="records.html#id81264">Accessing Record Fields</a></li>
<li title="Updating Records"><a href="records.html#id81303">Updating Records</a></li>
<li title="Records in Guards"><a href="records.html#id81336">Records in Guards</a></li>
<li title="Records in Patterns"><a href="records.html#id81368">Records in Patterns</a></li>
<li title="Nested records"><a href="records.html#id81395">Nested records</a></li>
<li title="Internal Representation of Records"><a href="records.html#id81430">Internal Representation of Records</a></li>
</ul>
</li>
<li id="no" title="Errors and Error Handling" expanded="false">Errors and Error Handling<ul>
<li><a href="errors.html">
              Top of chapter
            </a></li>
<li title="Terminology"><a href="errors.html#id81550">Terminology</a></li>
<li title="Exceptions"><a href="errors.html#id81678">Exceptions</a></li>
<li title="Handling of Run-Time Errors in Erlang"><a href="errors.html#id81851">Handling of Run-Time Errors in Erlang</a></li>
<li title="Exit Reasons"><a href="errors.html#id81913">Exit Reasons</a></li>
</ul>
</li>
<li id="no" title="Processes" expanded="false">Processes<ul>
<li><a href="processes.html">
              Top of chapter
            </a></li>
<li title="Processes"><a href="processes.html#id82387">Processes</a></li>
<li title="Process Creation"><a href="processes.html#id82400">Process Creation</a></li>
<li title="Registered Processes"><a href="processes.html#id82449">Registered Processes</a></li>
<li title="Process Termination"><a href="processes.html#id82560">Process Termination</a></li>
<li title="Message Sending"><a href="processes.html#id82650">Message Sending</a></li>
<li title="Links"><a href="processes.html#id82679">Links</a></li>
<li title="Error Handling"><a href="processes.html#id82744">Error Handling</a></li>
<li title="Monitors"><a href="processes.html#id82854">Monitors</a></li>
<li title="Process Dictionary"><a href="processes.html#id82946">Process Dictionary</a></li>
</ul>
</li>
<li id="loadscrollpos" title="Distributed Erlang" expanded="true">Distributed Erlang<ul>
<li><a href="distributed.html">
              Top of chapter
            </a></li>
<li title="Distributed Erlang System"><a href="distributed.html#id83013">Distributed Erlang System</a></li>
<li title="Nodes"><a href="distributed.html#id83044">Nodes</a></li>
<li title="Node Connections"><a href="distributed.html#id83114">Node Connections</a></li>
<li title="epmd"><a href="distributed.html#id83164">epmd</a></li>
<li title="Hidden Nodes"><a href="distributed.html#id83184">Hidden Nodes</a></li>
<li title="C Nodes"><a href="distributed.html#id83230">C Nodes</a></li>
<li title="Security"><a href="distributed.html#id83254">Security</a></li>
<li title="Distribution BIFs"><a href="distributed.html#id83364">Distribution BIFs</a></li>
<li title="Distribution Command Line Flags"><a href="distributed.html#id83662">Distribution Command Line Flags</a></li>
<li title="Distribution Modules"><a href="distributed.html#id83799">Distribution Modules</a></li>
</ul>
</li>
<li id="no" title="Compilation and Code Loading" expanded="false">Compilation and Code Loading<ul>
<li><a href="code_loading.html">
              Top of chapter
            </a></li>
<li title="Compilation"><a href="code_loading.html#id84002">Compilation</a></li>
<li title="Code Loading"><a href="code_loading.html#id84112">Code Loading</a></li>
<li title="Code Replacement"><a href="code_loading.html#id84159">Code Replacement</a></li>
<li title="Running a function when a module is loaded"><a href="code_loading.html#id84234">Running a function when a module is loaded</a></li>
</ul>
</li>
<li id="no" title="Ports and Port Drivers" expanded="false">Ports and Port Drivers<ul>
<li><a href="ports.html">
              Top of chapter
            </a></li>
<li title="Ports"><a href="ports.html#id84374">Ports</a></li>
<li title="Port Drivers"><a href="ports.html#id84409">Port Drivers</a></li>
<li title="Port BIFs"><a href="ports.html#id84449">Port BIFs</a></li>
</ul>
</li>
</ul>
</div></div>
<div id="content">
<div class="innertube">
<h1>12 Distributed Erlang</h1>
  

  <h3><a name="id83013">12.1 
        Distributed Erlang System</a></h3>
    
    <p>A <strong>distributed Erlang system</strong> consists of a number of
      Erlang runtime systems communicating with each other. Each such
      runtime system is called a <strong>node</strong>. Message passing between
      processes at different nodes, as well as links and monitors, are
      transparent when pids are used. Registered names, however, are
      local to each node. This means the node must be specified as well
      when sending messages etc. using registered names.</p>
    <p>The distribution mechanism is implemented using TCP/IP sockets.
      How to implement an alternative carrier is described in <strong>ERTS User's Guide</strong>.</p>
  

  <h3><a name="id83044">12.2 
        Nodes</a></h3>
    
    <p>A <strong>node</strong> is an executing Erlang runtime system which has
      been given a name, using the command line flag <span class="code">-name</span>
      (long names) or <span class="code">-sname</span> (short names).</p>
    <p>The format of the node name is an atom <span class="code">name@host</span> where
      <span class="code">name</span> is the name given by the user and <span class="code">host</span> is
      the full host name if long names are used, or the first part of
      the host name if short names are used. <span class="code">node()</span> returns
      the name of the node. Example:</p>
    <div class="example"><pre>
% <span class="bold_code">erl -name dilbert</span>
(dilbert@uab.ericsson.se)1&gt; <span class="bold_code">node().</span>
'dilbert@uab.ericsson.se'

% <span class="bold_code">erl -sname dilbert</span>
(dilbert@uab)1&gt; <span class="bold_code">node().</span>
dilbert@uab</pre></div>
    <div class="note">
<div class="label">Note</div>
<div class="content"><p>
      <p>A node with a long node name cannot communicate with a node
        with a short node name.</p>
    </p></div>
</div>
  

  <h3><a name="id83114">12.3 
        Node Connections</a></h3>
    
    <p>The nodes in a distributed Erlang system are loosely connected.
      The first time the name of another node is used, for example if
      <span class="code">spawn(Node,M,F,A)</span> or <span class="code">net_adm:ping(Node)</span> is called,
      a connection attempt to that node will be made.</p>
    <p>Connections are by default transitive. If a node A connects to
      node B, and node B has a connection to node C, then node A will
      also try to connect to node C. This feature can be turned off by
      using the command line flag <span class="code">-connect_all false</span>, see
      <span class="code">erl(1)</span>.</p>
    <p>If a node goes down, all connections to that node are removed.
      Calling <span class="code">erlang:disconnect_node(Node)</span> will force disconnection
      of a node.</p>
    <p>The list of (visible) nodes currently connected to is returned by
      <span class="code">nodes()</span>.</p>
  

  <h3><a name="id83164">12.4 
        epmd</a></h3>
    
    <p>The Erlang Port Mapper Daemon <strong>epmd</strong> is automatically
      started at every host where an Erlang node is started. It is
      responsible for mapping the symbolic node names to machine
      addresses. See <span class="code">epmd(1)</span>.</p>
  

  <h3><a name="id83184">12.5 
        Hidden Nodes</a></h3>
    
    <p>In a distributed Erlang system, it is sometimes useful to
      connect to a node without also connecting to all other nodes.
      An example could be some kind of O&amp;M functionality used to
      inspect the status of a system without disturbing it. For this
      purpose, a <strong>hidden node</strong> may be used.</p>
    <p>A hidden node is a node started with the command line flag
      <span class="code">-hidden</span>. Connections between hidden nodes and other nodes
      are not transitive, they must be set up explicitly. Also, hidden
      nodes does not show up in the list of nodes returned by
      <span class="code">nodes()</span>. Instead, <span class="code">nodes(hidden)</span> or
      <span class="code">nodes(connected)</span> must be used. This means, for example,
      that the hidden node will not be added to the set of nodes that
      <span class="code">global</span> is keeping track of.</p>
    <p>This feature was added in Erlang 5.0/OTP R7.</p>
  

  <h3><a name="id83230">12.6 
        C Nodes</a></h3>
    
    <p>A <strong>C node</strong> is a C program written to act as a hidden node
      in a distributed Erlang system. The library <strong>Erl_Interface</strong>
      contains functions for this purpose. Refer to the documentation
      for Erl_Interface and <strong>Interoperability Tutorial</strong> for more
      information about C nodes.</p>
  

  <h3><a name="id83254">12.7 
        Security</a></h3>
    
    <p>Authentication determines which nodes are allowed to communicate
      with each other. In a network of different Erlang nodes, it is
      built into the system at the lowest possible level. Each node has
      its own <strong>magic cookie</strong>, which is an Erlang atom.</p>
    <p>When a nodes tries to connect to another node, the magic cookies
      are compared. If they do not match, the connected node rejects
      the connection.</p>
    <p>At start-up, a node has a random atom assigned as its magic
      cookie and the cookie of other nodes is assumed to be
      <span class="code">nocookie</span>. The first action of the Erlang network
      authentication server (<span class="code">auth</span>) is then to read a file named
      <span class="code">$HOME/.erlang.cookie</span>. If the file does not exist, it is
      created. The UNIX permissions mode of the file is set to octal
      400 (read-only by user) and its contents are a random string. An
      atom <span class="code">Cookie</span> is created from the contents of the file and
      the cookie of the local node is set to this using
      <span class="code">erlang:set_cookie(node(), Cookie)</span>. This also makes
      the local node assume that all other nodes have the same cookie
      <span class="code">Cookie</span>.</p>
    <p>Thus, groups of users with identical cookie files get Erlang
      nodes which can communicate freely and without interference from
      the magic cookie system. Users who want run nodes on separate
      file systems must make certain that their cookie files are
      identical on the different file systems.</p>
    <p>For a node <span class="code">Node1</span> with magic cookie <span class="code">Cookie</span> to be
      able to connect to, or accept a connection from, another node
      <span class="code">Node2</span> with a different cookie <span class="code">DiffCookie</span>,
      the function <span class="code">erlang:set_cookie(Node2, DiffCookie)</span> must
      first be called at <span class="code">Node1</span>. Distributed systems with
      multiple user IDs can be handled in this way.</p>
    <p>The default when a connection is established between two nodes,
      is to immediately connect all other visible nodes as well. This
      way, there is always a fully connected network. If there are
      nodes with different cookies, this method might be inappropriate
      and the command line flag <span class="code">-connect_all false</span> must be set,
      see <span class="bold_code"><a href="javascript:erlhref('../../','erts','erl.html');">erl(1)</a></span>.</p>
    <p>The magic cookie of the local node is retrieved by calling
      <span class="code">erlang:get_cookie()</span>.</p>
  

  <h3><a name="id83364">12.8 
        Distribution BIFs</a></h3>
    
    <p>Some useful BIFs for distributed programming, see
      <span class="code">erlang(3)</span> for more information:</p>
    <table border="1" cellpadding="2" cellspacing="0">
<tr>
        <td align="left" valign="middle"><span class="code">erlang:disconnect_node(Node)</span></td>
        <td align="left" valign="middle">Forces the disconnection of a node.</td>
      </tr>
<tr>
        <td align="left" valign="middle"><span class="code">erlang:get_cookie()</span></td>
        <td align="left" valign="middle">Returns the magic cookie of the current node.</td>
      </tr>
<tr>
        <td align="left" valign="middle"><span class="code">is_alive()</span></td>
        <td align="left" valign="middle">Returns <span class="code">true</span> if the runtime system is a node and can connect to other nodes, <span class="code">false</span> otherwise.</td>
      </tr>
<tr>
        <td align="left" valign="middle"><span class="code">monitor_node(Node, true|false)</span></td>
        <td align="left" valign="middle">Monitor the status of <span class="code">Node</span>. A message<span class="code">{nodedown, Node}</span> is received if the connection to it is lost.</td>
      </tr>
<tr>
        <td align="left" valign="middle"><span class="code">node()</span></td>
        <td align="left" valign="middle">Returns the name of the current node. Allowed in guards.</td>
      </tr>
<tr>
        <td align="left" valign="middle"><span class="code">node(Arg)</span></td>
        <td align="left" valign="middle">Returns the node where <span class="code">Arg</span>, a pid, reference, or port, is located.</td>
      </tr>
<tr>
        <td align="left" valign="middle"><span class="code">nodes()</span></td>
        <td align="left" valign="middle">Returns a list of all visible nodes this node is connected to.</td>
      </tr>
<tr>
        <td align="left" valign="middle"><span class="code">nodes(Arg)</span></td>
        <td align="left" valign="middle">Depending on <span class="code">Arg</span>, this function  can return a list not only of visible nodes, but also hidden nodes and previously known nodes, etc.</td>
      </tr>
<tr>
        <td align="left" valign="middle"><span class="code">set_cookie(Node, Cookie)</span></td>
        <td align="left" valign="middle">Sets the magic cookie used when connecting to <span class="code">Node</span>. If <span class="code">Node</span> is the current node, <span class="code">Cookie</span> will be used when connecting to all new nodes.</td>
      </tr>
<tr>
        <td align="left" valign="middle"><span class="code">spawn[_link|_opt](Node, Fun)</span></td>
        <td align="left" valign="middle">Creates a process at a remote node.</td>
      </tr>
<tr>
        <td align="left" valign="middle"><span class="code">spawn[_link|opt](Node, Module, FunctionName, Args)</span></td>
        <td align="left" valign="middle">Creates a process at a remote node.</td>
      </tr>
</table>
<em>Table
        12.1:
         
        Distribution BIFs.</em>
  

  <h3><a name="id83662">12.9 
        Distribution Command Line Flags</a></h3>
    
    <p>Examples of command line flags used for distributed programming,
      see <span class="code">erl(1)</span> for more information:</p>
    <table border="1" cellpadding="2" cellspacing="0">
<tr>
        <td align="left" valign="middle"><span class="code">-connect_all false</span></td>
        <td align="left" valign="middle">Only explicit connection set-ups will be used.</td>
      </tr>
<tr>
        <td align="left" valign="middle"><span class="code">-hidden</span></td>
        <td align="left" valign="middle">Makes a node into a hidden node.</td>
      </tr>
<tr>
        <td align="left" valign="middle"><span class="code">-name Name</span></td>
        <td align="left" valign="middle">Makes a runtime system into a node, using long node names.</td>
      </tr>
<tr>
        <td align="left" valign="middle"><span class="code">-setcookie Cookie</span></td>
        <td align="left" valign="middle">Same as calling <span class="code">erlang:set_cookie(node(), Cookie)</span>.</td>
      </tr>
<tr>
        <td align="left" valign="middle"><span class="code">-sname Name</span></td>
        <td align="left" valign="middle">Makes a runtime system into a node, using short node names.</td>
      </tr>
</table>
<em>Table
        12.2:
         
        Distribution Command Line Flags.</em>
  

  <h3><a name="id83799">12.10 
        Distribution Modules</a></h3>
    
    <p>Examples of modules useful for distributed programming:</p>
    <p>In Kernel:</p>
    <table border="1" cellpadding="2" cellspacing="0">
<tr>
        <td align="left" valign="middle"><span class="code">global</span></td>
        <td align="left" valign="middle">A global name registration facility.</td>
      </tr>
<tr>
        <td align="left" valign="middle"><span class="code">global_group</span></td>
        <td align="left" valign="middle">Grouping nodes to global name registration groups.</td>
      </tr>
<tr>
        <td align="left" valign="middle"><span class="code">net_adm</span></td>
        <td align="left" valign="middle">Various Erlang net administration routines.</td>
      </tr>
<tr>
        <td align="left" valign="middle"><span class="code">net_kernel</span></td>
        <td align="left" valign="middle">Erlang networking kernel.</td>
      </tr>
</table>
<em>Table
        12.3:
         
        Kernel Modules Useful For Distribution.</em>
    <p>In STDLIB:</p>
    <table border="1" cellpadding="2" cellspacing="0"><tr>
        <td align="left" valign="middle"><span class="code">slave</span></td>
        <td align="left" valign="middle">Start and control of slave nodes.</td>
      </tr></table>
<em>Table
        12.4:
         
        STDLIB Modules Useful For Distribution.</em>
  
</div>
<div class="footer">
<hr>
<p>Copyright © 2003-2012 Ericsson AB. All Rights Reserved.</p>
</div>
</div>
</div></body>
</html>