Run the propertyManager script with
the list, get, or set command
to retrieve the value of server properties and modify or set the property
values. You can also set or get server properties by using the GlobalPropertiesMXBean
API.
About this task
The
propertyManager set command
adds properties to the server to modify the behavior and characteristics
of the server. The properties apply across all solutions on the server.
To
set or modify server properties programmatically, use the GlobalProperties Java™ Management Extensions (JMX)
management bean (MBean) by calling the methods in the GlobalPropertiesMXBean API.
The Liberty server profile provides MBeans and corresponding management
interface APIs that help you control server behavior.
Procedure
- Set the value of server properties by running the propertyManager set command. For example, on Windows:
propertyManager set solutionAutoStart=true maxAgentTransactionRetries=2 --host=localhost --port=9080 --username=user1 --password=user1 --trustStoreLocation=C:\IBM\ODMInsights88\runtime\wlp\usr\servers\cisDev\resources\security\key.jks --trustStorePassword=truststore
- To list the value of a specific server property, run the propertyManager get command.
Provide the name of the property as a command parameter. For
example, on Windows:
propertyManager get solutionAutoStart --host=localhost --port=9080 --username=user1 --password=user1 --trustStoreLocation=C:\IBM\ODMInsights88\runtime\wlp\usr\servers\cisDev\resources\security\key.jks --trustStorePassword=truststore
- To display a list of all the properties that are set for
the server, run the propertyManager list command. For example, on Windows:
propertyManager list --host=localhost --port=9080 --username=user1 --password=user1 --trustStoreLocation=C:\IBM\ODMInsights88\runtime\wlp\usr\servers\cisDev\resources\security\key.jks --trustStorePassword=truststore
- To set the value of a property programmatically, use the
GlobalPropertiesMXBean API and the setProperty class. For
example:
serverConfig.setProperty("solutionAutoStart", "true");