Resin 4 Script for cloud EC2 video for JavaOne

From Resin 4.0 Wiki

Jump to: navigation, search
  • Create new key pair
  • Create Security Group
    • Setup the following inbound rules for the security group
Port range         Source
6800 - 6899	 sg-fa790492 (demo)
22 (SSH)
8080 (HTTP*)	
8443 (HTTPS*)	
  • Create server named triad0 server.
    • Use Amazon Linux
    • Make it an m1.small
  • Connect to new server
    • $ ssh -i resin2.pem
  • Create three new dynamic IP addresses
  • Install Resin via yum
    • See Getting Started Guide
rpm --import
unix# yum install
  • Install emacs
    • $ sudo yum install emacs
  • Create an admin_password and a system_key too.
    • $ resinctl generate-password admin faconbacon7
admin_user : admin
admin_password : {SSHA}x18aaaahbmK85geKdC5l8Xr7fIT+uxce
  • Edit /etc/resin/
    • $ sudo emacs /etc/resin/
elastic_cloud_enable : true
home_cluster : app
home_server : app-0
app.https         : 8443
remote_admin_enable : true
app_servers : ext: ext: ext:
cluster_system_key : changeme999
# Only if you want admin enabled
web_admin_enable : true
web_admin_external : true
web_admin_ssl : true
admin_user : admin
admin_password : {SSHA}generatethispasswordwithREsinCTL/XJCE

Note the following:

  • remote_admin_enable is needed for ext: discovery.
  • home_server is needed to identify the server so it knows its config and ip
  • elastic_cloud_enable is needed for elastic servers to join cluster
  • home_cluster specifies the name of the cluster.
  • app_servers
app_servers : ext: ext: ext:

The above configures three application servers under the public key addresses. The app in app_servers refers to the cluster name.

triad0 = app-0 = ext: 
triad1 = app-1 = ext: 
triad2 = app-2 = ext:
  • Install the license file
  • Clone triad0 then make triad1 and triad2 from the clone
  • Assign the triad servers the correct Elastic IPs
  • Modify home_server for triad1 and triad2 to app-1 and app-2 respectively.
  • Go to resin-admin of triad0 and see if it sees triad1 and triad2

  • Create another clone called elastic1
    • Modify the elastic servers properties file
elastic_server : true  
# home_server :  (comment it out)

  • Go to resin-admin of triad0 and see if it sees the elastic server
  • Clone and spin up another elastic server
  • Go to resin-admin of triad0 and see if it sees the elastic server
  • Try to deploy a small war file to all remotely
ssh -i resin2.pem ec2-user@
ssh -i resin2.pem ec2-user@
Personal tools