Resin 4 Script for cloud EC2 video for JavaOne

From Resin 4.0 Wiki

Revision as of 00:00, 19 September 2012 by Rick (Talk | contribs)
Jump to: navigation, search
  • Create Security Group
    • Setup the following inbound rules for the security group
Port range         Source
6800 - 6899	 sg-fa790492 (demo)
22 (SSH)	         0.0.0.0/0
8080 (HTTP*)	 0.0.0.0/0	
8443 (HTTPS*)	 0.0.0.0/0	
  • Create server named triad0 server.
    • Use Amazon Linux
    • Make it an m1.small
  • Connect to new server
    • $ ssh ec2_user TODO
  • Create three new dynamic IP addresses
  • Install Resin via yum
    • See Getting Started Guide
  • 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/resin.properties
    • $ sudo emacs /etc/resin/resin.properties
elastic_cloud_enable : true
home_cluster : app
home_server : app-0
app.https         : 8443
remote_admin_enable : true
app_servers : ext:23.21.106.227 ext:23.21.121.216 ext:23.21.195.83
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:23.21.106.227 ext:23.21.121.216 ext:23.21.195.83

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:23.21.106.227 
triad1 = app-1 = ext:23.21.121.216 
triad2 = app-2 = ext:23.21.195.83
https://23.21.106.227:8443
https://23.21.121.216:8443
https://23.21.195.83:8443
  • 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

https://23.21.106.227:8443/resin-admin/

  • Create another clone called elastic1
  • Modify its

Add this elastic_server : true

Remove home_server (comment it out)


11) Go to resin-admin of triad0 and see if it sees the elastic server

12) Clone and spin up another elastic server

13) Go to resin-admin of triad0 and see if it sees the elastic server

14) Try to deploy a small war file to all remotely

ssh -i resin2.pem ec2-user@23.21.121.216 ssh -i resin2.pem ec2-user@23.21.195.83

Personal tools
TOOLBOX
LANGUAGES