AppLogic 2.7/2.8 Documentation The latest production release is AppLogic 3.0.30
SLA: Controller - Example
Introduction
This is a step-by-step example for setting up a LampX4 application to use the SLA controller. The steps outlined in this topic can be used to add dynamic scaling of appliances to any application.
SLA only works with MON appliances of version 1.1.3 and above. To verify the version of any MON appliance in your application, right-click on the appliance and select view class.
Preparing The Grid
The SLA appliance must be able to authenticate on the grid on which it is running. To ensure this, create a public/private key pair in openssh format without a passphrase. Create a user on the grid whose public key corresponds to the generated public key. To do this, follow steps 1-3 below.
1. Use the PuTTY Key Generator (available here), to generate a key. Do not enter a passphrase.
2. Export the private key in openssh format to a file named grid.private.key. It will look something like this:
-----BEGIN RSA PRIVATE KEY-----
MIICWwIBAAKBgQC1dXZ8vewm32WeHIbYhsbY3e5WI6BfvAC0YR5dXqzUVqPnniKd
gMWR3lReoxo8m49b9gL3Vkbb9l5gDAmcXO9NiYw1rWkTFdxvIBmwhuDkinRFfgnR
Sa1SiaLZ2FD0zGsf4pxIC73ke+qv8IhoNJkHW/QXviMG9RQB+HO1thf9zwIBJQKB
gQCOOXiLSMACysVEkuY7AdofmTBtByqr5mFqyKkYv9ORq7Dl+Hv+6GOAKsyBhsGJ
cwGo8UCYWGENRI8or30nhxxr4D9dU9XgwXrZBMSmWesUzd2tYVbbSVfhgnCX/5tN
+O2ffCHiWpDwCYKnv5AeBUpNxzDTUSTiEa6q+HJm6/i7hQJBAPJ+jMA2UecfAwuS
2ztowizyZLrwD/SaShM0MfE7fp1fAoyKn38TsyVMRE+VPGUMAJXTsKyW4Gubq18l
CprcIL0CQQC/kK1wlKJs2hCS22IoMbhfratG6Ls1SqIfdRIcjRuHhKohn85fvE6I
Ryusir7jSLUx6u+GtV5hQTXX6NhYGP97AkA6/DATFCHCmNc6KqQHiC87XY4foi1l
Au9sdHrZ0DOOEDENbdPE9vQ5gUEMcGii9RTmLJLCMomdomf0jHgzgacZAkAZ4x5b
Ulsjd2oGAfiB+OGQY5OvoujdsCO/D9ID27ecsRASYbQaxmt6MyGT22XnXNo3LZX9
cnSJrt3DOyQnlKznAkEAoohf8gEZ2oGoCddod+DjLMNLBjmM/2Z+4G+VC3eDbOpr
9T1libLcXZl/HeISHIx1n518z85eppZMQs6Xb3fHeQ==
-----END RSA PRIVATE KEY-----
3. Create a user on the grid whose public key corresponds to the generated public key. The user name is irrelevant.
- Open a 3T shell on the grid (use ssh or the webshell from the AppLogic Dashboard)
- Copy and paste the public key from the PuTTY Key Generator into the user create command like this:
user create sla@my_domain.com pwd=- sshkey="ssh-rsa AAAAB3NzaC1yc2EAA ... v0F74jBvUUAfhztbYX/c8="
Preparing the Application to use SLA
Provision an instance of LampX4 using two available IP addresses and the proper netmask, gateway and dns for your grid. For example:
app provision LampX4 appname --skipstart in_ip=1.2.3.216 out_ip=1.2.3.217 netmask=255.255.255.0 gateway=1.2.3.1 dns1=1.2.3.90 dns2=1.2.3.91
Incorporate the SLA appliance as shown in the diagram below. Name the SLA appliance sla.
4. Set the usr gateway properties to forward tcp traffic on port 8080 to the aux terminal:
- Set
l3_accept_proto to tcp
- Set
l3_accept_port to 8080
5. Create a 10MB volume to hold the private key file and temporary files. Right-click on a blank area of the canvas and select Manage Volumes. Click add to create a new volume and provide the following volume information:
- Name:
sla_config
- Size:
10M
- Filesystem:
ext3
6. Configure the sla instance settings:
- Set start order to
30 in the Attributes tab. sla must start after net.
- Set the config volume to
sla_config in the User Volumes tab.
- Set properties in the Property Values tab. For example:
- Set
appliance_group to main.srv.srv
- Set
grid_ctl_ip to the IP address of the grid controller
- Set
port_no to 8080
- Set
username and password
7. Configure the SLA instance with the private key.
- scp grid.private.key controllerhost:/vol/appname/sla_config/
8. Start the application
9. Point a browser at port 8080 of the application IP (the in_ip property of LampX4) to bring up the web interface for SLA (for example, http://1.2.3.216:8080/) .
10. Using the SLA GUI, define a policy by selecting counter entity, counter name, start value, stop value and period. Click the Commit button to commit the policy for enforcement.
The SLA appliance will now enforce this policy by starting and stopping web servers in srv in accordance with the policy.
-- StephenQ - 14 Dec 2007
Copyright © CA 2005-2011. All Rights Reserved.