Resin 4 Script for cloud EC2 video for JavaOne
From Resin 4.0 Wiki
(Difference between revisions)
(Created page with "# Created triad0 server. m1.small. # Install Resin via yum ## See Getting Started Guide # Install emacs ## <code>$ sudo yum install emacs</code> # Create an admin_password a...") |
|||
Line 1: | Line 1: | ||
− | + | * Create Security Group | |
− | + | ** Setup the following inbound rules for the security group | |
− | + | <pre> | |
− | + | 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 | |
− | + | </pre> | |
− | + | * Create server named triad0 server. | |
− | + | ** Use Amazon Linux | |
+ | ** Make it an m1.small | ||
+ | * Connect to new server | ||
+ | ** <code>$ ssh ec2_user TODO</code> | ||
+ | * Create three new dynamic IP addresses | ||
+ | * Install Resin via yum | ||
+ | ** See Getting Started Guide | ||
+ | * Install emacs | ||
+ | ** <code>$ sudo yum install emacs</code> | ||
+ | * Create an admin_password and a system_key too. | ||
+ | ** <code>$ resinctl generate-password admin faconbacon7</code> | ||
+ | <pre> | ||
admin_user : admin | admin_user : admin | ||
− | admin_password : {SSHA} | + | admin_password : {SSHA}x18aaaahbmK85geKdC5l8Xr7fIT+uxce |
− | + | </pre> | |
− | + | * Edit /etc/resin/resin.properties | |
− | + | ** <code>$ sudo emacs /etc/resin/resin.properties</code> | |
− | + | <pre> | |
− | + | ||
− | + | ||
elastic_cloud_enable : true | elastic_cloud_enable : true | ||
home_cluster : app | home_cluster : app | ||
Line 24: | Line 33: | ||
remote_admin_enable : true | remote_admin_enable : true | ||
app_servers : ext:23.21.106.227 ext:23.21.121.216 ext:23.21.195.83 | app_servers : ext:23.21.106.227 ext:23.21.121.216 ext:23.21.195.83 | ||
− | cluster_system_key : | + | cluster_system_key : changeme999 |
− | + | ||
# Only if you want admin enabled | # Only if you want admin enabled | ||
web_admin_enable : true | web_admin_enable : true | ||
Line 32: | Line 40: | ||
admin_user : admin | admin_user : admin | ||
admin_password : {SSHA}generatethispasswordwithREsinCTL/XJCE | admin_password : {SSHA}generatethispasswordwithREsinCTL/XJCE | ||
+ | </pre> | ||
− | |||
− | Note | + | Note the following: |
+ | * <code>remote_admin_enable</code> is needed for ext: discovery. | ||
+ | * <code>home_server</code> is needed to identify the server so it knows its config and ip | ||
+ | * <code>elastic_cloud_enable</code> is needed for elastic servers to join cluster | ||
+ | * <code>home_cluster</code> specifies the name of the cluster. | ||
+ | * <code>app_servers</code> | ||
+ | <pre> | ||
+ | app_servers : ext:23.21.106.227 ext:23.21.121.216 ext:23.21.195.83 | ||
+ | </pre> | ||
− | + | The above configures three application servers under the public key addresses. | |
+ | The <code>app</code> in <code>app_servers</code> refers to the cluster name. | ||
+ | <pre> | ||
triad0 = app-0 = ext:23.21.106.227 | triad0 = app-0 = ext:23.21.106.227 | ||
triad1 = app-1 = ext:23.21.121.216 | triad1 = app-1 = ext:23.21.121.216 | ||
triad2 = app-2 = ext:23.21.195.83 | triad2 = app-2 = ext:23.21.195.83 | ||
+ | </pre> | ||
+ | <pre> | ||
https://23.21.106.227:8443 | https://23.21.106.227:8443 | ||
https://23.21.121.216:8443 | https://23.21.121.216:8443 | ||
https://23.21.195.83:8443 | https://23.21.195.83:8443 | ||
+ | </pre> | ||
− | + | * 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/ | https://23.21.106.227:8443/resin-admin/ | ||
− | + | * Create another clone called elastic1 | |
− | + | * Modify its | |
− | + | ||
Add this | Add this | ||
elastic_server : true | elastic_server : true |
Revision as of 00:00, 19 September 2012
- 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