Advanced Server Configuration
Configuration via Java System Properties
This advanced server configuration uses Java system properties.
In unusual cases where the config.yml
cannot be modified easily, or you wish to temporarily override a value within it, an advanced option allows overriding values within it bypassing special Java system properties when starting IQ Server.
Property overrides must start with prefix dw. - followed by a dot-separated path to the configuration value being overridden.
java -Ddw.logging.level=TRACE -jar nexus-iq-server-*.jar server config.yml 2> stderr.log
java -Ddw.baseUrl=http://iq.example.com -jar nexus-iq-server-*.jar server config.yml 2> stderr.log
Configuration via Environment Variables
An option in config.yml
can be set to the value of an environment variable.
For example, you could set the IQ Server application port to the value of an environment variable IQ_PORT as follows
server: applicationConnectors: - type: http port: ${IQ_PORT}
You can also set a default value, to be used if the environment variable is not set as follows
server: applicationConnectors: - type: http port: ${IQ_PORT:-8070}
If an environment variable is used but not set and does not have a default value, then IQ Server will use the environment variable reference as a string value, e.g. if ${ENV_VAR} is used but not set, then IQ Server would use the string value "${ENV_VAR}"
Finally you can nest environment variables, for example with IQ_HOST=PROD and IQ_PORT_PROD=8070
server: applicationConnectors: - type: http port: ${IQ_PORT_${IQ_HOST}}
then ${IQ_HOST} would resolve to PROD and ${IQ_PORT_PROD} would resolve to 8070.