Resin has the very convenient ability to import configuration from an HTTP URL. This feature in combination with clever usage of environment variables can be a huge help avoiding the issues caused by maintaining local copies of configuration files in a large environment. In this Wiki article I setup a webserver as a centralized configuration repository and show how to modify your local Resin configuration such that the same file can be used by any Resin instance in any environment.
Posts Tagged ‘configuration’
Conditional Configuration Using Functions and Expressions
This second part of a multi-part article on Resin configuration examines how to employ conditional XML statements and EL functions to simplify Resin configuration. When we’re done, you’ll understand how the same configuration could be shared between deployment environments with entirely different Resin operation by using some following concepts:
- Conditional XML with <resin:if>, <resin:when>, <resin:choose>, <resin:otherwise>
- Null checking with â€œthe Elvis Operatorâ€ ?:
- Regular expression matching with =~
- Resource access with mbean() and jndi()
Configuration variable substitution using <resin:properties> and rvar()
This first part of a multi-part article on Resin configuration examines how to use EL variables in various situations to simplify Resin configuration. When we’re done you’ll understand how a simple database resource like this:
<database jndi-name="jdbc/mysql"> <driver type="com.mysql.jdbc.Driver"> <url>jdbc:mysql://user:password@$192.168.1.1:3306/dbname</url> </driver> </database>
… can be dynamically merged with per-server properties like this:
dbserver : 192.168.1.1 app-0.dbserver : 192.168.1.23 app-1.dbserver : 192.168.1.64
… resulting in configuration that is simple, powerful, and well suited for deployment in a cloud environment.