Intro to Distributed Erlang (screencast)

On March 27, 2012, in Erlang, by bryanhunter

Here’s an introduction to distribution in Erlang. This screencast demonstrates creating three Erlang nodes on a Windows box and one on a Linux box and then connecting them using the one-liner “net_adm:ping” to form a mighty compute cluster.

Topics covered:

  • Using erl to start an Erlang node (an instance of the Erlang runtime system).
  • How to use net_adm:ping to connect four Erlang nodes (three on Windows, one on Linux).
  • Using rpc:call to RickRoll a Linux box from an Erlang node running on a Windows box.
  • Using nl to load (deploy) a module from one node to all connected nodes.



For a deeper dive into distributed Erlang here’s the official reference (http://www.erlang.org/doc/reference_manual/distributed.html)



Special treat: If you ever wondered how I talk when I’m very sleepy here’s your big chance. :)

 

Tagged with:  
  • Jeff Bell

    Nice video. Big fan of OJ and now I’ve found another Erlang Evangalist! Keep em coming!

  • Anonymous

    Love it! Thanks for getting this out there. I would like to see the Rick-roll replace Hello World as the canonical language intro.

  • Pingback: Intro to Distributed Erlang (screencast) « Another Word For It

  • Uttam [ India ]

    Love to watch, quite simple and understandable. Expecting more topics…… Thanks

  • Ian Felton

    It was interesting what happend when you have a hyphen in your computer name.

    • Anonymous

      Thanks for the comment Ian. Yep, if your computer name or node name has a hyphen you will need to wrap the atom you are passing to net_adm:ping with single quotes.

      This fails:
      (dog@ishmael)1> net_adm:ping(atom-smasher@ishmael).
      ** exception error: bad argument in an arithmetic expression
      in operator -/2
      called as atom – smasher@ishmael

      This works:
      (dog@ishmael)2> net_adm:ping(‘atom-smasher@ishmael’).
      pong

      Why?

      “An atom is a literal, a constant with name. An atom should be enclosed in single quotes (‘) if it does not begin with a lower-case letter or if it contains other characters than alphanumeric characters, underscore (_), or @.”
      -from http://www.erlang.org/doc/reference_manual/data_types.html#id66276

  • http://twitter.com/ToJans Tom * suǝssuɐſ

    Hey Bryan,

    I just got to your site by googling for CQRS/Erlang… I am looking forward to furhter screencasts, as this is great material!