list、get、または set コマンドを指定して propertyManager スクリプトを実行し、サーバー・プロパティー値を取得したり、プロパティー値を変更または設定したりします。GlobalPropertiesMXBean API を使用してサーバー・プロパティーを設定または取得することもできます。
このタスクについて
propertyManager set コマンドは、プロパティーをサーバーに追加して、サーバーの動作および特性を変更します。プロパティーは、サーバー上のすべてのソリューションで適用されます。
サーバー・プロパティーをプログラムで設定または変更するには、GlobalPropertiesMXBean API のメソッドを呼び出して、GlobalProperties Java™ Management Extensions (JMX) 管理 Bean (MBean) を使用します。
Liberty サーバー・プロファイルは、サーバーの動作を制御するのに役立つ MBean および対応する管理インターフェース API を提供します。
手順
- propertyManager set コマンドを実行して、サーバー・プロパティーの値を設定します。 例えば、Windows では、以下のようにします。
propertyManager set solutionAutoStart=true maxAgentTransactionRetries=2 --host=localhost --port=9080 --username=user1 --password=user1 --trustStoreLocation=C:¥IBM¥ODMInsights890¥runtime¥wlp¥usr¥servers¥cisDev¥resources¥security¥key.jks --trustStorePassword=truststore
- propertyManager
set コマンドを実行して、ガーベッジ・コレクションの長期一時停止を警告するためのしきい値を設定します。
ガーベッジ・コレクションの長期一時停止は、タイムアウトのリスクを表します。
以下の例で、システム・モニターは、5 分の期間内で 3 秒を超える一時停止を伴う 6 回のガーベッジ・コレクションがあった場合を捕らえます。
propertyManager set warningGCLongPauseCountThreshold="6" warningGCLongPauseTimeThreshold="3000" warningGCLongPausePeriodThreshold="5m"
- 特定のサーバー・プロパティーの値をリストするには、propertyManager get コマンドを実行します。
コマンド・パラメーターとしてプロパティーの名前を指定します。 例えば、Windows では、以下のようにします。
propertyManager get solutionAutoStart --host=localhost --port=9080 --username=user1 --password=user1 --trustStoreLocation=C:¥IBM¥ODMInsights890¥runtime¥wlp¥usr¥servers¥cisDev¥resources¥security¥key.jks --trustStorePassword=truststore
- サーバーに設定されたすべてのプロパティーのリストを表示するには、propertyManager list コマンドを実行します。 例えば、Windows では、以下のようにします。
propertyManager list --host=localhost --port=9080 --username=user1 --password=user1 --trustStoreLocation=C:¥IBM¥ODMInsights890¥runtime¥wlp¥usr¥servers¥cisDev¥resources¥security¥key.jks --trustStorePassword=truststore
- プロパティーの値をプログラムで設定するには、GlobalPropertiesMXBean API および setProperty クラスを使用します。 例:
serverConfig.setProperty("solutionAutoStart", "true");