Skip to content

End 2 End Remote Test Environment Setup

Sergei Pogrebnyak edited this page Mar 1, 2018 · 7 revisions

So far our development was done against a local dev installation. This is the recommended method because it is the simplest to get started. Once you get more comfortable you can perform the same development process against a remote host.

Let's test our template on a remote host which will represent our Test environment.

Configure Mirror Repositories

We installed Command Central on a local box with access to the Internet for easy access to all required products and fixes.

If the target remote host does not have access to the Internet, but it has access to the Command Central server, setup mirror repositories for products and fixes on the Command Central server.

Note: The Command Central server you installed in this tutorial should already have mirror repositories configured for products-10.1 and fixes-10.1.

Configure remote hosts access Credentials

To allow remote bootstrap you need to configure a set of:

  1. Credentials for remote hosts. This is required.

  2. Credentials with a custom strong Administrator password. This is optional but strongly recommended for production environments.

Use Command Central Web UI and open the UI for the CCE instance. Then select Configuration. Here's a shortcut Credentials configuration Add a new REMOTE credentials alias of type username and password for SSH access of your remote test machines.

Download bootstrap installers for remote hosts OS and version

The seed installer used to bootstrap Command Central itself is automatically saved in the bootstrap installer list. This enables you to bootstrap remote installations of the same version and operating system as the Command Central server.

Download additional Command Central bootstrap installers for your desired version and target OS from the Software AG Software Download Center on Empower and copy them to ${CCE_HOME}/profiles/CCE/data/installers/ folder.

Make sure that you have a bootstrap installer for your remote OS and target version:

[user@linuxbox tutorial]$ sagcc list provisioning bootstrap installers
Name                         Version Platform  Size(MB)        
cc-def-10.1-fix5-lnxamd64.sh    10.1 lnxamd64      1104
cc-def-9.12-fix17-w64.zip       9.12 w64            675

Enable Remote Bootstrap

Command Central requires SSH access to the remote hosts to allow the remote bootstrap process.

Extend the template by providing additional configuration for nodes:/default:/default: section with the use of typical variables for remote system SSH connection:

environments:
  default:
    ### Remote system SSH access
    os.credentials: ${}                     # remote machine SSH credentials
    os.port:        22                      # remote machine SSH port
    spm.credentials: DEFAULT_ADMINISTRATOR  # credentials for remote SPM

nodes:
  default:
    default:
      port: ${spm.port}
      secure: false
      credentials: ${spm.credentials}       # credentials for SPM Administrator password
      bootstrapInfo:
        installDir: ${install.dir}
        installer: ${cc.installer}          # cc installer that can be found in cc_home/profiles/CCE/data/installers.
        port: ${os.port}                    # remote host SSH port
        credentials: ${os.credentials}      # remote host credentials

Map Layers to Remote Host

All our current layers are mapped to the same spm.alias node which is explicitly assigned to localhost. To allow layers provisioning onto any remote host we need to add a new mapping to the provision section and map the layers to a remote machine. Normally this is done by introducing server environment.type and a variable like spm.host.

environments:
  server:
    os.credentials:  ${}                           # remote machine SSH credentials
    os.port:         22                            # remote machine SSH port
    spm.alias:       ${}                           # remote node alias
    spm.host:        ${}                           # remote machine hostname

provision:
  default:                                         # default environment type
    management:  ${spm.alias}                      # management layer
    messaging:   ${spm.alias}                      # messaging layer
    integration: ${spm.alias}                      # integration layer
  server:                                          ### new environment type
    management:  ${spm.alias}                      # management layer
    messaging:   ${spm.alias}                      # messaging layer
    integration: ${spm.alias}                      # integration layer

The complete template should now look like this:

alias: tutorial
description: How to install and update main products
version: 0.9
changes:
  - 0.1 Initial draft
  - 0.2 Added input parameters
  - 0.3 Added local node bootstrap
  - 0.4 Added products/plugins installation
  - 0.5 Added fix installation
  - 0.6 Added main products and fix installation
  - 0.7 Added licenses and runtime instances
  - 0.8 Added configurations
  - 0.9 Added remote server environment support

environments:
  default:
    install.dir:  ${}                              # SPM installation directory
    spm.port:     8192                             # SPM connection port
    spm.alias:    dev${spm.port}                   # SPM alias
    repo.product: ${}                              # Product repo
    repo.fix:     ${}                              # Fixes repository
    spm.fixes:    ALL                              # Default list of fixes to install
    is.fixes:     ALL                              # Set of IS fixes
    um.fixes:     ALL                              # Set of UM fixes
    is.license.key: ${}                            # Alias for IS license key
    um.license.key: ${}                            # Alias for UM license key

    # configuration
    is.memory.init:   128
    is.memory.max:    512
    um.memory.init:   128
    um.memory.max:    512

    um.instance.port: 9001
    is.um.url: "nsp://localhost:${um.instance.port}" # proper UM URL

    spm.secure: false                        # disable SPM SSL connection by default
    spm.credentials: DEFAULT_ADMINISTRATOR   # SPM Administrator default/custom password

  server:
    os.credentials:  ${}                     # remote machine SSH credentials
    os.port:         22                      # remote machine SSH port - default value
    spm.host: ${}
    spm.port: 8092                           # SPM connection port
    is.um.url: "nsp://${spm.host}:${um.instance.port}" # proper UM URL

layers:                                            # LAYERS definition
  default:                                         # default repos for all layers
    productRepo: ${repo.product}                   # product repository for this layer
    fixRepo:     ${repo.fix}                       # fix repository for this layer
  management:                                      # management layer with SPMs
    templates:   [plugins]                         # templates to apply to this layer
  messaging:
    templates:   [um]                              # templates to apply to this layer
  integration:
    templates:   [is]                              # templates to apply to this layer

templates:                                         # TEMPLATES definition
  plugins:                                         # template alias
    products:                                      # product list to install
      ISspm:                                       # Platform Manager Plug-Ins / IS
      NUMspm:                                      # Platform Manager Plug-Ins / UM
    fixes: ${spm.fixes}                            # fixes to install
  is:                                              # template alias
    licenses:                                      # copy license from the license repository to a template location
      "IntegrationServer/config/licenseKey.xml": ${is.license.key}
    products:                                      # product list to install
      integrationServer:                           # Integration Server productId
        inst1:                                     # instance name to create or update
          primary.port:     5551
          diagnostic.port:  5552
          jmx.port:         5553
          license.file: IntegrationServer/config/licenseKey.xml
          configuration:
            OSGI-IS_inst1:
              COMMON-MEMORY:
                COMMON-MEMORY:
                  InitSize: '${is.memory.init}'
                  MaxSize: '${is.memory.max}'
            integrationServer-${instance.name}:    # runtimeComponentId
              COMMON-WMMESSAGING:                  # configurationTypeId
                COMMON-WMMESSAGING-IS_UM_CONNECTION: # configurationInstanceId
                  Messaging:                       # configuration data
                    "@alias": IS_UM_CONNECTION
                    Description: Default UM connection"
                    ClientPrefix: "IS_UM"
                    ShareClientPrefix: "false"
                    Enabled: true
                    Provider:
                      "@type": UM
                      URL: "${is.um.url}"
                      MaxRetryAttempts: 5
                      RetryInterval: 30000
    fixes: ${is.fixes}                             # fixes to install

  um:                                              # template alias
    licenses:                                      # copy license from the license repository to a template location
      "UniversalMessaging/server/templates/licence.xml": ${um.license.key}
    products:                                      # product list to install
      NUMRealmServer:                              # Universal Messaging productId
        inst1:                                     # instance name to create or update
          instance.port:    ${um.instance.port}
          instance.ip:      ${node.host}
          runtimeComponentId: Universal-Messaging-${instance.name}
          license.file: UniversalMessaging/server/templates/licence.xml
          configuration:
            Universal-Messaging-inst1:
              COMMON-MEMORY:
                COMMON-MEMORY:
                  InitSize: '${um.memory.init}'
                  MaxSize: '${um.memory.max}'
    fixes: ${um.fixes}                             # fixes to install

nodes:                                             # NODES definition
  default:                                          # defaults for any environment type
    default:                                        # default node definition
      port: ${spm.port}                             # SPM connection HTTP/S port
      secure: ${spm.secure}                         # to enable SSL port
      credentials: ${spm.credentials}               # SPM Administrator password
      bootstrapInfo:
        installDir: ${install.dir}                  # installation directory
        installer:  ${cc.installer}                 # cc installer that can be found in cc_home/profiles/CCE/data/installers
    ${spm.alias}:                                   # definition for specific nodeAlias
      host: localhost                               # Use localhost
  
  server:
    ${spm.alias}:                                  # definition for specific nodeAlias
      host: ${spm.host}                            # Use specific host
      bootstrapInfo:
        credentials: ${os.credentials}             # remote host credentials

provision:                                         # PROVISIONing mapping of layers to nodes
  default:                                         # default environment type
    management:  ${spm.alias}                      # management layer is single node
    messaging:   ${spm.alias}                      # messaging layer is single node
    integration: ${spm.alias}                      # integration layer is single node
  server:                                          # default environment type
    management:  ${spm.alias}                      # management layer is single node
    messaging:   ${spm.alias}                      # messaging layer is single node
    integration: ${spm.alias}                      # integration layer is single node

Remote Test Environment Configuration

  1. Copy environments/default/env.properties file into a new environments/test/env.templates.

  2. Modify the new file to match your remote machine configuration.

os.platform=lnxamd64
os.credentials=REMOTE

cc.installer=cc-def-10.1-fix5-${os.platform}.sh
install.dir=/home/${user.name}/softwareag

repo.product=products-10.1
repo.fix=fixes-10.1

is.license.key=YOUR_LICENSE
um.license.key=YOUR_LICENSE

environment.type=server
spm.host=YOUR_HOST

# customized memory configurations for your test environment
is.memory.init=128
is.memory.max=256
um.memory.init=512
um.memory.max=512

Save the changes to template.yaml and the env.properties files in `environments/test.

You may simulate remote node setup over SSH if your local Linux or Mac box is SSH enabled. In this case just use set spm.host as your machine hostname, but NOT localhost as it is reserved for local bootstraps.

Provision Single Host Environment

Apply the template it using the new test environment instance configuration file.

[user@linuxbox tutorial]$ ant up -Denv=test
...
BUILD SUCCESSFUL
Total time: ....

If you have not achieved the goals of this tutorial stage, use the following command to checkout everything that needed to be done so far. Make a note about your modifications of environment/test/env.properties because the version that you'll check out will overwrite them.

[user@linuxbox tutorial]$ git checkout stage-09a
Switched to branch 'stage-09a'

Provision Multi-Host Environment

Typically multi-host environment is a clustered environment. To keep this tutorial simple, we'll not setup a real cluster, but modify our template slightly to provision the environment in the following way:

  1. Management layer: three remote hosts
  2. Messaging layer: one of the three above hosts
  3. Integration layer: two other hosts

Let's call this environment type cluster and modifying provision map to the above layout.

environments:
  cluster:                                         ### new environment type
    os.credentials:  ${}                           # remote machine SSH credentials
    spm.hosts:       ${}                           # one or more hosts for the environment
    is.hosts:        ${}                           # one or more hosts defined as [host1,host2]
    um.host:         ${}                           # one host
    is.um.url:       "nsp://${um.host}:${um.instance.port}" # proper UM URL

provision:
  cluster:                                       ### new environment type
    management:  ${spm.hosts}                      # management layer
    messaging:   ${um.host}                        # messaging layer
    integration: ${is.hosts}                       # integration layer
  1. Copy enviroments/test/env.properties file into a new environments/staging/env.templates.
  2. Modify the new file to match your remote machine configuration.
environment.type=cluster
spm.hosts=[YOUR_HOST1, YOUR_HOST2, YOUR_HOST3]
um.host=YOUR_HOST1
is.hosts=[YOUR_HOST2, YOUR_HOST3]

os.platform=lnxamd64
os.credentials=REMOTE

cc.installer=cc-def-10.1-fix5-${os.platform}.sh
install.dir=/home/${user.name}/softwareag

repo.product=products-10.1
repo.fix=fixes-10.1

is.license.key=YOUR_LICENSE
um.license.key=YOUR_LICENSE

# customized memory configurations for your staging environment
is.memory.init=128
is.memory.max=256
um.memory.init=512
um.memory.max=512

Apply the template using the new staging environment configuration.

[user@linuxbox tutorial]$ ant up -Denv=staging
...
BUILD SUCCESSFUL
Total time: ....

If you have not achieved the goals of this tutorial stage, just use the following command to checkout everything that needed to be done so far. Make a note about your modifications of environment/staging/env.properties because the version that you'll check out will overwrite them.

[user@linuxbox tutorial]$ git checkout stage-09b
Switched to branch 'stage-09b'

Summary

Congratulations !!!

You've completed your first template development and now know how to develop, test and use composite templates for provisioning a simple local or complex, multi-host, multi-layer environments with products, fixes, runtime instances, and configuration.

Clone this wiki locally