Resin 4 Script for cloud EC2 video for JavaOne

From Resin 4.0 Wiki

(Difference between revisions)
Jump to: navigation, search
(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:
# Created triad0 server. m1.small.  
+
* Create new key pair
# Install Resin via yum
+
* Create Security Group
## See Getting Started Guide
+
** Setup the following inbound rules for the security group
# Install emacs  
+
<pre>
## <code>$ sudo yum install emacs</code>
+
Port range        Source
# Create an admin_password and a system_key too.
+
6800 - 6899 sg-fa790492 (demo)
## <code>$ resinctl generate-password admin faconbacon7</code>
+
22 (SSH)         0.0.0.0/0
# Edit /etc/resin/resin.properties
+
8080 (HTTP*) 0.0.0.0/0
## <code>$ sudo emacs /etc/resin/resin.properties</code>
+
8443 (HTTPS*) 0.0.0.0/0
 
+
</pre>
 
+
* Create server named triad0 server.  
admin_user : admin
+
** Use Amazon Linux
admin_password : {SSHA}x18npiJhbmK85geKdC5l8Xr7fIT+uxce
+
** Make it an m1.small
 +
* Connect to new server
 +
** <code>$ ssh -i resin2.pem ec2-user@ec2-174-129-113-134.compute-1.amazonaws.com</code>
 +
* Create three new dynamic IP addresses
 +
* Install Resin via yum
 +
** See Getting Started Guide
 +
<pre>
 +
rpm --import http://caucho.com/download/rpm/RPM-GPG-KEY-caucho
 +
unix# yum install http://caucho.com/download/rpm/4.0.31/x86_64/resin-pro-4.0.31-1.x86_64.rpm
 +
</pre>
 +
* 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}aF8k/6ZWcvzmMJ9jTWNHGxi+0Uc+3w6r
+
admin_password : {SSHA}x18aaaahbmK85geKdC5l8Xr7fIT+uxce
 +
</pre>
  
Properties for triad0:
+
* 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 41:
 
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 : changeme
+
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 48:
 
admin_user : admin
 
admin_user : admin
 
admin_password : {SSHA}generatethispasswordwithREsinCTL/XJCE
 
admin_password : {SSHA}generatethispasswordwithREsinCTL/XJCE
 +
</pre>
  
TODO Talk about how to configure Amazon Security Group
 
  
Note that remote_admin_enable is needed for ext: discovery.
+
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>
  
Table:
+
<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>
  
5) Install the license file
+
* Install the license file
 
+
* Clone triad0 then make triad1 and triad2 from the clone
6) 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.
7) Assign the triad servers the correct Elastic IPs
+
* Go to resin-admin of triad0 and see if it sees triad1 and triad2
 
+
8) Modify home_server for triad1 and triad2 to app-1 and app-2 respectively.
+
 
+
9) 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 the elastic servers properties file
  
10) Create another clone called elastic1
+
<pre>
 
+
Add this
+
 
elastic_server : true   
 
elastic_server : true   
 +
# home_server :  (comment it out)
 +
</pre>
  
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
+
* Go to resin-admin of triad0 and see if it sees the elastic server
 +
* Clone and spin up another elastic server
 +
* Go to <code>resin-admin</code> of triad0 and see if it sees the elastic server
 +
* Try to deploy a small war file to all remotely
  
 +
<pre>
 
ssh -i resin2.pem ec2-user@23.21.121.216
 
ssh -i resin2.pem ec2-user@23.21.121.216
 
ssh -i resin2.pem ec2-user@23.21.195.83
 
ssh -i resin2.pem ec2-user@23.21.195.83
 +
</pre>

Latest revision as of 00:00, 19 September 2012

  • 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)	         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 -i resin2.pem ec2-user@ec2-174-129-113-134.compute-1.amazonaws.com
  • Create three new dynamic IP addresses
  • Install Resin via yum
    • See Getting Started Guide
rpm --import http://caucho.com/download/rpm/RPM-GPG-KEY-caucho
unix# yum install http://caucho.com/download/rpm/4.0.31/x86_64/resin-pro-4.0.31-1.x86_64.rpm
  • 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 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@23.21.121.216
ssh -i resin2.pem ec2-user@23.21.195.83
Personal tools
TOOLBOX
LANGUAGES