Migrating an N-Tier Application Containing Data

Overview

This section uses an application called RollerWeBlog to describe the CloudCenter process to migrate a three-tier Java web application with data running at the customer's location.

Migration Guidelines

  • Services:
    • CloudCenter does not provide out-of-box mapping for any cloud-specific service to an alternate service in another environment.
    • If using cloud-specific services (such as ELB or RDS), then the author/owner of the Application Profile must be aware that are making a decision to lock that Application Profile to a particular cloud (for example, AWS).
    • However, you can create a custom service definition and include the scripts required to detect whether it was being deployed in AWS or in VMWare or another cloud and then connect that application to either the ELB or their F5 load balancer.
  • DNS
    • CloudCenter does not inherently update the DNS to point to a migrated deployment.
    • However, you can configure the migration process to include any scripts required to change the DNS mapping in your environment.
    • See CloudCenter External URL for additional context.

Process

To migrate an N-tier application with data, follow this process:

  1. Back up the data for the RollerWeBlog application. For this example:
    • The data backup file is called dbbkup.sql.
    • The RollerWeBlog application runs on a different cloud than CloudCenter.
  2. Identify the relevant Key ComponentsParameters and Macros , and Configuration Files for this application.
  3. Modify the Configuration File  (or properties file) to include CloudCenter-defined system macros to automatically plug in the appropriate values for parameters defined in the configuration file. Alternately, you can pass these  parameters as arguments to install or configuration scripts.
    • The RollerWeBlog application configuration file changes:

      ../WEB-INF/classes/myconfig-file
      installation.type=auto
      mediafiles.storage.dir=/usr/local/rollerdata/mediafiles
      search.index.dir=/usr/local/rollerdata/searchindex
      log4j.appender.roller.File=/usr/local/rollerdata/roller.log
      database.configurationType=jdbc
      database.jdbc.driverClass=com.mysql.jdbc.Driver
      database.jdbc.connectionURL=jdbc:mysql://%DB_TIER_IP%:3306/rollerdb?
      autoReconnect=true&useUnicode=true&characterEncoding=utf-8&mysqlEncoding=utf8
      database.jdbc.username=scott
      database.jdbc.password=tiger
      mail.configurationType=properties
      mail.hostname=smtp-server.example.com
      mail.username=scott
      mail.password=tiger
    • Prior to the macro substitution, the configuration file had the following description in the highlighted area:
      database.jdbc.connectionURL=jdbc:mysql://localhost:3306/rollerdb?
      Effectively, the localhost IP address is replaced by a dynamically generated private IP address (database tier) during runtime using %DB_TIER_IP%.
    • In Application Profiles, users can define parameters to pass as arguments to the username and password field. Optionally, users can also include default values in scripts.
  4. After modifying the configuration files with system macros, create a .war application package and include the updated configuration file.
  5. Upload the application data (packages, configuration files, backup data, SQL script, and other scripts) to your shared directory in the Artifact Repository .
  6. Create an application directory under /storage/app/<application name> and upload the application data to the newly created directory.
  7. If the application requires certain parameters to be defined or overridden (administrator, username, and password), include them in the Topology Modeler's Global Parameters section.
  8. Define the application architecture and services using the Topology Modeler. For the RollerWeBlog example, use Tomcat as the web server, MySQL as the database, and NginX as the load balancer. For each tier, use the Properties panel to provide additional details. For example:
    • MySQL tier: Parameters, username, password, the path for the database script that has the backup data from a previous environment, and so forth.
    • RollerWeBlog tier: Define the path for the application binary file (roller.war) and the configuration file.
    • Similarly, provide the dependent details for the Tomcat and NginX tiers as well.
  9. Save the Java web app profile. Access your new application from the Apps tab and verify your changes for each tier. The application is now ready for deployment.
  10. Submit the application for deployment. The CCM sends the application package information (JSON package) to the CCO.
  11. View the deployment progress in the Status field.
  12. SSH or VNC to the cloud VM for additional troubleshooting access or to run additional commands and scripts.
  13. Once the deployment is complete, click the Access link to open the IP address for this application. You may need to specify the full path in the context of the application in the  Topology Modeler's Basic Information pane.
  14. Use the full path URL to access the migrated RollerWeBlog application.

 

 

  • No labels