Where Dynamicity Meets the Cloud

How To Start Rio on Amazon EC2

April 28th, 2008 by jeje, posted in Uncategorized

Finally, here is a Rio AMI allowing you to instantly start Rio instances on Amazon EC2.

Before you run anything, the prerequisites are:

This AMI allow you to run two kind of profiles:

  • a monitor one: this is basically Rio monitor and a cybernode running in the same EC2 instance but within two distinct JVMs,
  • a cybernode one: this is a Rio cybernode which joins a previously started monitor, using Unicast because Multicast is not available on Amazon EC2.

In order to start the monitor instance:

  1. create a file named master.config whose content is
    MASTER_HOST=master,MAX_MONITORS=3,YUM_PACKAGES=mencoder
  2. run the following command:
    ec2run ami-3d7a9f54 -g YOUR_SECURITY_GROUP -k YOUR_KEY_PAIR -f master.config
  3. ssh to your instance
    ssh -i YOUR_SSH_ID root@PUBLIC_IP_OF_YOUR_MONITOR_INSTANCE
  4. (optional) check that Rio is running fine by executing jps. You should see an output similar to the one below:
    [root@domU-12-31-38-00-90-E6 ~]# jps
    1322 ServiceStarter
    1357 Jps
    1323 ServiceStarter
    [root@domU-12-31-38-00-90-E6 ~]# rio list cybernode
    total 1
    discovery time 301 millis, timeout used 5000
    [1]   Cybernode   rio   10.252.151.20
    No contained services

In order to start a cybernode instance:

  1. run the following command:
    ec2run ami-3d7a9f54 -g elastic-grid -k eg-gsg-keypair -d MASTER_HOST=domU-12-31-38-00-95-03.compute-1.internal,MAX_MONITORS=3,YUM_PACKAGES=mencoder
  2. ssh to your instance
    ssh -i YOUR_SSH_ID root@PUBLIC_IP_OF_YOUR_CYBERNODE_INSTANCE
  3. (optional) check that Rio is running fine by executing jps. You should see an output similar to the one below:
    [root@domU-12-31-38-00-95-03 ~]# jps
    1217 ServiceStarter
    1280 Jps

Here is below a real session with some real values:

  1. Start the monitor instance:
    eg@eg-devel-desktop:~/.ec2$ ec2run ami-3d7a9f54 -g elastic-grid -k eg-gsg-keypair -f master.config
    RESERVATION     r-a4e51ecd      154066937112    elastic-grid
    INSTANCE        i-8a1bd9e3      ami-3d7a9f54                    pending eg-gsg-keypair  0               m1.small        2008-04-27T17:13:56+0000        us-east-1baki-a71cf9ce     ari-a51cf9cc
  2. Establish an SSH connection to the monitor instance:
    RESERVATION     r-a4e51ecd      154066937112    elastic-grid
    INSTANCE        i-8a1bd9e3      ami-3d7a9f54    ec2-75-101-223-80.compute-1.amazonaws.com       domU-12-31-38-00-90-E6.compute-1.internal       running eg-gsg-keypair     0               m1.small        2008-04-27T17:13:56+0000        us-east-1b      aki-a71cf9ce    ari-a51cf9cc
    eg@eg-devel-desktop:~/.ec2$ ssh -i id_rsa-eg-gsg-keypair root@ec2-75-101-223-80.compute-1.amazonaws.com
    The authenticity of host 'ec2-75-101-223-80.compute-1.amazonaws.com (75.101.223.80)' can't be established.
    RSA key fingerprint is 2d:d4:f7:e7:2b:05:ad:cd:94:28:1e:21:9f:d3:07:a5.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added 'ec2-75-101-223-80.compute-1.amazonaws.com,75.101.223.80' (RSA) to the list of known hosts.__|  __|_  )  Fedora 8
    _|  (     /    32-bit
    ___|\___|___|
    Welcome to an EC2 Public Image
    Base
  3. Ensure Rio is running:
    [root@domU-12-31-38-00-90-E6 ~]# jps
    1322 ServiceStarter
    1357 Jps
    1323 ServiceStarter
    [root@domU-12-31-38-00-90-E6 ~]# rio list cybernode
    total 1
    discovery time 301 millis, timeout used 5000
    [1]   Cybernode   rio   10.252.151.20
    No contained services
  4. Start the cybernode instance:
    eg@eg-devel-desktop:~/.ec2$ ec2run ami-3d7a9f54 -g elastic-grid -k eg-gsg-keypair -d MASTER_HOST=domU-12-31-38-00-90-E6.compute-1.internal,MAX_MONITORS=3,YUM_PACKAGES=mencoder
    RESERVATION     r-b3e51eda      154066937112    elastic-grid
    INSTANCE        i-991bd9f0      ami-3d7a9f54                    pending eg-gsg-keypair  0               m1.small        2008-04-27T17:18:20+0000        us-east-1baki-a71cf9ce     ari-a51cf9cc
  5. Establish an SSH connection to the cybernode instance:
    eg@eg-devel-desktop:~/.ec2$ ec2din
    RESERVATION     r-a4e51ecd      154066937112    elastic-grid
    INSTANCE        i-8a1bd9e3      ami-3d7a9f54    ec2-75-101-223-80.compute-1.amazonaws.com       domU-12-31-38-00-90-E6.compute-1.internal       running eg-gsg-keypair     0               m1.small        2008-04-27T17:13:56+0000        us-east-1b      aki-a71cf9ce    ari-a51cf9cc
    RESERVATION     r-b3e51eda      154066937112    elastic-grid
    INSTANCE        i-991bd9f0      ami-3d7a9f54    ec2-72-44-52-233.compute-1.amazonaws.com        domU-12-31-38-00-95-03.compute-1.internal       running eg-gsg-keypair     0               m1.small        2008-04-27T17:18:20+0000        us-east-1b      aki-a71cf9ce    ari-a51cf9cc
    eg@eg-devel-desktop:~/.ec2$ ssh -i id_rsa-eg-gsg-keypair root@ec2-72-44-52-233.compute-1.amazonaws.com
    The authenticity of host 'ec2-72-44-52-233.compute-1.amazonaws.com (72.44.52.233)' can't be established.
    RSA key fingerprint is 2d:d4:f7:e7:2b:05:ad:cd:94:28:1e:21:9f:d3:07:a5.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added 'ec2-72-44-52-233.compute-1.amazonaws.com,72.44.52.233' (RSA) to the list of known hosts.
    __|  __|_  )  Fedora 8
    _|  (     /    32-bit
    ___|\___|___|
    Welcome to an EC2 Public Image
    Base
  6. Ensure Rio is running:
    [root@domU-12-31-38-00-95-03 ~]# jps
    1217 ServiceStarter
    1280 Jps
  7. Ensure that the monitor cybernode see the newly started cybernode
    [root@domU-12-31-38-00-90-E6 ~]# rio list cybernode
    total 2
    discovery time 229 millis, timeout used 5000
    [1]   Cybernode   rio   10.252.151.20
    No contained services
    [2]   Cybernode   <?>   10.252.154.241
    No contained services
  8. After a video conversion opstring is deployed:
    [root@domU-12-31-38-00-90-E6 ~]# rio list cybernode
    total 2
    discovery time 300 millis, timeout used 5000
    [1]   Cybernode   <?>   10.252.151.20
    Video Converter    rio                           8 seconds
    [2]   Cybernode   <?>   10.252.154.241
    Video Converter    rio                           9 seconds

This concludes this small how-to run Rio on Amazon EC2.


Eco Technology

Elastic Grid, LLC. has adopted as a mantra the idea that any viable business can be done while helping others. So Elastic Grid, LLC. commits to give a percentage of all its benefits for non-profits organizations. Additionally Elastic Grid products will enable users to easily give extra money to those organizations and provide discounts to our customers helping them.

We Can Help

Our cloud-computing services can help you in your next project. Contact Us