r3 - 25 Oct 2007 - 17:08:39 - StephenQYou are here: Wiki >  AppLogic23 Web > CatDynBckExample
ALERT! AppLogic 2.3 Beta Documentation The latest production release is AppLogic 3.0.30

BCK: Backup Enabler - Example


Introduction

This is a step-by-step example for setting up a LampX4 application to use the BCK backup enabler. The steps outlined in this topic can be used to add backup and restore capabilities to any application.

Preparing The Grid

The BCK 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 bck@my_domain.com pwd=- sshkey="ssh-rsa AAAAB3NzaC1yc2EAA   ...    v0F74jBvUUAfhztbYX/c8="

Preparing the Application to use BCK

Provision an instance of LampX4 and connect the BCK appliance as shown in the diagram below. Name the BCK appliance bck.

bck_LampX4 app

4. 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

5. Create a small volume to hold the BCK 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 bck_config
  • Size 1M
  • Filesystem ext2

6. Configure the BCK instance settings:

  • Set start order to 30 in the Attributes tab. bck should start after net.
  • Set the config volume to mig_config in the User Volumes tab.
  • Set properties in the Property Values tab. Using S3 for example:
    • Set backup_service to S3
    • Set backup_user_id to your S3 user Access Key ID
    • Set backup_user_auth to your S3 user Secret Access Key
    • Set backup_container_id to the name of an S3 bucket. BCK will try to create this bucket if it does not exist. Note, however, that the S3 bucket namespace is shared among all users. Preferably, you should create this bucket yourself using a 3rd party tool such as aws to ensure that it belongs to your S3 account.
    • Set gui_ip to in_ip of the application (re-direct the property to the assembly)
    • Set gui_port_no to 8080
    • Set gui_username and gui_password
    • Set grid_ctl_ip to the IP address of the grid controller
    • Set grid_ip1 and grid_ip2 to unused IP addresses available on the grid
    • Set grid_netmask to the netmask of the application (re-direct the property to the assembly)
    • Set grid_gateway to the gateway of the application (re-direct the property to the assembly)
    • Set grid_dns1 to dns1 of the application (re-direct the property to the assembly)
    • Set grid_dns2 to dns2 of the application (re-direct the property to the assembly)

7. Configure the BCK instance with the 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 bck.ctl appliance. If the BCK appliance is named bck: ssh main.bck.ctl.
  • Change directory to the root of the bck_config volume: cd /mnt/config
  • Use scp to copy the grid.private.key file from step 2 to the current directory:
    • scp user@remote_host:./path_to_file/grid.private.key grid.private.key
  • Set the correct owner, group and mode for these files:
    • chown nobody grid.private.key
    • chgrp nobody grid.private.key
    • chmod 600 grid.private.key
  • Re-start the BCK appliance or manually execute the BCK start-up script: /var/www/html/.rc.local.

8. Point a browser at port 8080 of the application IP (the in_ip property of LampX4) to bring up the web interface for the BCK (for example, http://1.2.3.216:8080/) . Now you can backup the application.

-- StephenQ - 25 Oct 2007

 
Copyright © CA 2005-2011. All Rights Reserved.
%