Configuration Files

Overview

When modeling applications using either application packages or images, you may need to call application-specific install and configuration scripts (config files) when deploying the application. Specifically, these files or scripts may have hard-wired values for configuration parameters that may need to be changed at deployment time. These parameters represent settings that must be reconfigured when your application is deployed on the target cloud.

If you use parameters (either CloudCenter-Defined Parameters or Parameter Substitution), you may need to modify the configuration files to reflect the correct property defined in the relevant parameter.

CloudCenter-Defined Parameters are designed to cover cases where deployment owners may not know settings values in advance as those values are dynamically generated by the underlying infrastructure or is specific to the deployment environment or is dependent on the system. Based on the application deployment context, CloudCenter automatically replaces appropriate values at runtime for each parameter referenced in your application configuration files. Alternately, you can pass the parameters as arguments to install/configuration scripts. See Parameter Substitution for additional context.

Profiles Using Varied Parameters

For example, an N-tier Web Application may require the following parameters or macros:

  • %DB_TIER_IP%: private IP address of the Database node (tier name = Database)
  • %NoSQL_TIER_IP%: private IP address of the NoSQL Database node (tier name = NoSQLDatabase)
  • %MB_TIER_IP%: private IP Address of the MessageBus node (tier name = MessageBus)
  • %BC_TIER_IP%: private IP address of the BackendCache node (tier name = BackendCache)

These parameters are for used for legacy compatibility (CloudCenter 2.x and earlier) purposes. Be sure to use the exact name for each underlying tier: Database, NoSQLDatabase, MessageBus, and BackendCache.

When you need to replace tokens in the configuration file for CloudCenter 3.x and later releases, use the %CliqrTier_TierName_IP% token, where TierName is the name of the dependent tier.

 

In the above example, you can use the %DB_TIER_IP% macro as a placeholder for the IP address of the database tier, within your configuration file. If you do so, then CloudCenter (at deployment time) will replace the DB_TIER_IP parameter with the actual private IP address on which the database is accessible to this application.

Configuration File Using the Macro

The following example displays a configuration file using this macro:

 ../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 macro substitution, the configuration file for the above application had the following description in the highlighted area:

database.jdbc.connectionURL=jdbc:mysql://localhost:3306/rollerdb? 

Effectively, the dynamically generated private IP address (of database tier) replaces the localhost IP address during runtime by using the %DB_TIER_IP% macro value.

For supported services, if you modify the configuration file, save the file in the same package format and extension as the original file. For example, save as a .war package (for Tomcat), .zip package (for Apache), .sql package (for MySQL), and so forth.

Other References

  • No labels