Cloud Erlang

3,875 views
3,675 views

Published on

You normally think of virtualization as virtualization at the operating system level. But with Erlang, you can do virtualization at application level.

Published in: Technology, News & Politics

Cloud Erlang

  1. 1. Erlang:Bring cloud to your application Ngoc Dao
  2. 2. Normally, you bringyour application → cloudErlang lets you bringcloud → your application
  3. 3. Normally,cloud is at OS levelErlang lets you create and controlcloud at application level,your application
  4. 4. It’s because Erlang feels like an OSYou can control the OS in your application
  5. 5. ps → pman:start().
  6. 6. top → etop:start().
  7. 7. applications → applications appmon:start(). webtool:start(). observer:start().
  8. 8. “We are dropping appmon, and replacing it with observer instead.”
  9. 9. observer:start().
  10. 10. webtool alternative: BigWig
  11. 11. debugger:start().
  12. 12. Let’s create a cloud
  13. 13. Guest Guestmachine machine mynode1 mynode2 Erlang process Erlang process Erlang process Erlang process Erlang process Erlang process … … Host machine
  14. 14. Create 2 nodes$ erl -sname mynode1 -setcookie mypassword1 -detached$ erl -sname mynode2 -setcookie mypassword2 -detached
  15. 15. Check if the nodes are on$ ps aux Host machine Guest[output] machineepmd -daemonbeam.smp ... -sname mynode1 -setcookie mypassword1 -noshell -noinputbeam.smp ... -sname mynode2 -setcookie mypassword2 -noshell -noinput Guest machine
  16. 16. Guest Guestmachine machine mynode1 mynode2 Erlang process Erlang process Erlang process Erlang process Erlang process Erlang process … … epmd Host machine
  17. 17. Login to mynode1$ erl -sname mynode3 -setcookie mypassword1 -remsh mynode1@ngocFrom here, to stop mynode1:init:stop(). or q().To quit without stoping mynode1:Ctrl+C
  18. 18. More topics• Deploy code to nodes• Connect nodes together• Hot code swap

×