Distributed Applications

Ulf Wiger <>
Mon Dec 2 18:30:27 CET 2002


I decided to make my own example and see if I could make it
work on my workstation. It worked, but I was once again
reminded how much work it is to build a system from scratch.
Good grief! Someone really needs to design a tool that takes
care of beginners.

I've included my toy example, where I've written my own
erlyhack_app and erlyhack_map_app (I'm not going to ask
where those names came from). The tar file is called
dist_ac.tgz just to create some confusion.  (:

It unpacks into

dist_ac/
  releases/
    1.0/
       hack.boot
       hack.rel
       hack.script
       sys.config
  lib/
    erlyhack_app-0.01.02/
      src/
        app1.erl
        server1.erl
        super1.erl
      ebin/
        erlyhack_app.app
        ... *.beam
    erlyhack_map_app-0.01.01/
      src/
        app2.erl
        server2.erl
        super2.erl
      ebin/
        erlyhack_map_app.app
        ... *.beam

I cd:ed into dist_ac/releases/1.0, started an erlang shell
and typed

  Path = ["/home/..../dist_ac/lib/*/ebin"].
  systools:make_script("hack", [local, {path, Path}]).

Then systools went on and did its thing, creating
hack.script and hack.boot files.

(A small note: In the sys.config file, you will find the
kernel environment variables that you need to set. Instead
of hacking the .app file, one writes a .config and
identifies it from the command line using -config Filename.

You must change the node names in sys.config to be able to
run the example.)


I then put myself right under dist_ac and started two
xterms, and in them I wrote the following commands:

erl -sname n1 -boot releases/1.0/hack -config \
releases/1.0/sys

erl -sname n2 -boot releases/1.0/hack -config \
releases/1.0/sys

Starting n1 first, I got the following output:

...
=PROGRESS REPORT==== 2-Dec-2002::18:12:29 ===
         application: sasl
          started_at: 
server1 starting.

=PROGRESS REPORT==== 2-Dec-2002::18:12:29 ===
          supervisor: {local,super1}
             started: [{pid,<0.53.0>},
                       {name,server},
                       {mfa,{server1,start_link,[]}},
                       {restart_type,permanent},
                       {shutdown,10000},
                       {child_type,worker}]

=PROGRESS REPORT==== 2-Dec-2002::18:12:29 ===
         application: erlyhack_app
          started_at: 
server2 starting.

=PROGRESS REPORT==== 2-Dec-2002::18:12:29 ===
          supervisor: {local,super2}
             started: [{pid,<0.58.0>},
                       {name,server},
                       {mfa,{server2,start_link,[]}},
                       {restart_type,permanent},
                       {shutdown,10000},
                       {child_type,worker}]

=PROGRESS REPORT==== 2-Dec-2002::18:12:29 ===
         application: erlyhack_map_app
          started_at: 


********

Then starting n2, I got the following output:

=PROGRESS REPORT==== 2-Dec-2002::18:12:36 ===
         application: sasl
          started_at: 
server1 starting.

=PROGRESS REPORT==== 2-Dec-2002::18:12:36 ===
          supervisor: {local,super1}
             started: [{pid,<0.54.0>},
                       {name,server},
                       {mfa,{server1,start_link,[]}},
                       {restart_type,permanent},
                       {shutdown,10000},
                       {child_type,worker}]

=PROGRESS REPORT==== 2-Dec-2002::18:12:36 ===
         application: erlyhack_app
          started_at: 
server2 starting.

=PROGRESS REPORT==== 2-Dec-2002::18:12:36 ===
          supervisor: {local,super2}
             started: [{pid,<0.59.0>},
                       {name,server},
                       {mfa,{server2,start_link,[]}},
                       {restart_type,permanent},
                       {shutdown,10000},
                       {child_type,worker}]

=PROGRESS REPORT==== 2-Dec-2002::18:12:36 ===
         application: erlyhack_map_app
          started_at: 



****
and at the same time in n1:

=INFO REPORT==== 2-Dec-2002::18:12:36 ===
    application: erlyhack_map_app
    exited: stopped
    type: permanent


Perhaps you can compare my files with yours and find out
what you've done wrong?

/Uffe
-- 
Ulf Wiger, Senior Specialist,
   / / /   Architecture & Design of Carrier-Class Software
  / / /    Strategic Product & System Management
 / / /     Ericsson Telecom AB, ATM Multiservice Networks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dist_ac.tgz
Type: application/octet-stream
Size: 7230 bytes
Desc: dist_ac.tgz
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20021202/0f2382fd/attachment.obj>


More information about the erlang-questions mailing list