AppLogic 2.7/2.8 Documentation The latest production release is AppLogic 3.0.30
MIG: Self-Migration Enabler - Example
Introduction
This is a step-by-step example for setting up a LampX4 application to use the MIG self-migration enabler on two grids. The steps outlined in this topic can be used to add self-migration and snapshot capabilities to any application.
Preparing The Grids
The MIG appliance must be able to authenticate on any grid to which it will migrate. To ensure this, create a public/private key pair in openssh format without a passphrase. Create a user on each 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 private.key. It will look 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 each grid whose public key corresponds to the generated public key. The user name is irrelevant.
- Open a 3T shell on the first 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 mig@my_domain.com pwd=- sshkey="ssh-rsa AAAAB3NzaC1yc2EAA ... v0F74jBvUUAfhztbYX/c8="
- Repeat on the second grid.
Each grid must be able to authenticate on the other. To ensure this, create a user on each grid whose public key corresponds to the public key of the other grid by following steps 4-7 below.
4. Open a 3T shell to each grid.
5. On the first grid execute grid info --verbose. The public key of the grid is displayed.
6. On the second grid create a new user whose public key is the public key of the first grid.
7. Repeat step 6 to create a user on first grid whose public key is the public key of the second grid.
You can now migrate manually between the two grids.
Preparing The Application to use MIG
Provision an instance of LampX4 and connect the MIG appliance as shown in the diagram below. Name the MIG appliance mig.
8. Set the INSSL 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
9. Create a small volume to hold the MIG configuration data. 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
mig_config
- Size
1M
- Filesystem
ext2
10. Configure the MIG instance settings:
- Set start order to
30 in the Attributes tab. mig must start after net.
- Set the config volume to
mig_config in the User Volumes tab.
- Set a
username and password in the Property Values tab.
11. Create an ASCII text file named grid.info according to the following example. Be certain to use the correct IP's for your application on each of the two grids.
grid my_grid_one
{
controller = grid_one.my_domain.net
location = Los Angeles
MIG_ip = 1.2.3.216:8080
app_config = "in_ip=1.2.3.216 out_ip=1.2.3.217 netmask=1.2.3.0 gateway=1.2.3.1"
MigHelper_config = "in_ip=1.2.3.214 out_ip=1.2.3.215 netmask=1.2.3.0 gateway=1.2.3.1"
}
grid my_grid_two
{
controller = grid_two.my_domain.net
location = Houston
MIG_ip = 1.2.3.212:8080
app_config = "in_ip=1.2.3.212 out_ip=1.2.3.213 netmask=1.2.3.0 gateway=1.2.3.1"
MigHelper_config = "in_ip=51.2.3.214 out_ip=1.2.3.215 netmask=1.2.3.0 gateway=1.2.3.1"
}
The app_config entry can be empty (app_config = "") if there is no configuration difference in the application between the two grids. To work from a copy of the template file sample.grid.info, see the next step.
12. Configure the MIG instance with the grid information and private key.
- Start the application.
- Open a 3T shell to the grid on which the application is running.
- Set the current application:
ca appname.
- ssh to the mig.ctl appliance. If the MIG appliance is named mig:
ssh main.mig.ctl.
- Change directory to the root of the
mig_config volume: cd /mnt/config
- If you want to work from a copy of the template file
sample.grid.info:
- Copy the template file to the current directory and edit it:
cp /var/www/html/sample.grid.info grid.info
- Otherwise, use scp to copy the
grid.info file from step 11 to the current directory: scp user@remote_host:./path_to_file/file_name grid.info
- Use scp to copy the
private.key file to this directory.
- Set the correct owner, group and mode for these files:
-
chown root grid.info
-
chgrp root grid.info
-
chmod 644 grid.info
-
chown nobody private.key
-
chgrp nobody private.key
-
chmod 600 private.key
- Re-start the MIG applicance or manually execute the MIG start-up script:
/var/www/html/.rc.local.
13. Point a browser at port 8080 of the application IP (the in_ip property of LampX4) to bring up the web interface for the MIG (for example, http://1.2.3.216:8080/) . Now you can migrate or snapshot the application.
Note: if you modify the grid.info file while the appliance is running, you will need to re-start the MIG appliance or manually execute the start-up script in order for the changes to take effect. This script is /var/www/html/.rc.local.
-- StephenQ - 12 Sep 2007
Copyright © CA 2005-2011. All Rights Reserved.