10.5.8. 管理 CLI でのデプロイメントスキャナーの設定
前提条件
デプロイメントスキャナーを設定する方法は複数ありますが、バッチスクリプトの使用やリアルタイムによる属性の公開および変更には、管理 CLI を使用できます。read-attribute および write-attribute グローバルコマンドライン操作を使用すると、デプロイメントスキャナーの挙動を変更できます。デプロイメントスキャナー属性の詳細は、「デプロイメントスキャナー属性のリファレンス」の説明を参照してください。
standalone.xml で確認できます。
<subsystem xmlns="urn:jboss:domain:deployment-scanner:1.1">
<deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000"/>
</subsystem>
手順10.11 デプロイメントスキャナーの設定
設定するデプロイメントスキャナー属性を決定
管理 CLI を使用してデプロイメントスキャナーを設定するには、最初に正しい属性名を公開する必要があります。これには、ルートノードでread-resources操作を使用するか、cdコマンドを使用してサブシステムの子ノードに移動して行います。また、このレベルでlsコマンドを使用して属性を表示することもできます。read-resource操作を使用したデプロイメントスキャナー属性の表示read-resource操作を使用して、デフォルトのデプロイメントスキャナーリソースで定義された属性を公開します。[standalone@localhost:9999 /]/subsystem=deployment-scanner/scanner=default:read-resource { "outcome" => "success", "result" => { "auto-deploy-exploded" => false, "auto-deploy-xml" => true, "auto-deploy-zipped" => true, "deployment-timeout" => 600, "path" => "deployments", "relative-to" => "jboss.server.base.dir", "scan-enabled" => true, "scan-interval" => 5000 } }lsコマンドを使用したデプロイメントスキャナー属性の表示lsコマンドにオプションの-l引数を指定して、サブシステムノード属性、値、およびタイプを含む結果の表を表示します。lsコマンドとその引数の詳細を確認するには、ls --helpと入力して CLI ヘルプエントリーを表示します。管理 CLI のヘルプメニューの詳細については、トピック「管理 CLI でのヘルプの使用」を参照してください。[standalone@localhost:9999 /] ls -l /subsystem=deployment-scanner/scanner=default ATTRIBUTE VALUE TYPE auto-deploy-exploded false BOOLEAN auto-deploy-xml true BOOLEAN auto-deploy-zipped true BOOLEAN deployment-timeout 600 LONG path deployments STRING relative-to jboss.server.base.dir STRING scan-enabled true BOOLEAN scan-interval 5000 INT
write-attribute操作を使用したデプロイメントスキャナーの設定変更する属性の名前を決定したら、write-attributeを使用して、書き込む属性名と新しい値を指定します。以下の例は、すべて子ノードレベルで実行されます。この例を使用するには、cdコマンドとタブ補完を使用してデフォルトスキャナーノードを表示し、移動します。[standalone@localhost:9999 /] cd subsystem=deployment-scanner/scanner=default
展開されたコンテンツの自動デプロイメントの有効化
write-attribute操作を使用して、展開されたアプリケーションコンテンツの自動デプロイメントを有効にします。[standalone@localhost:9999 scanner=default] :write-attribute(name=auto-deploy-exploded,value=true) {"outcome" => "success"}XML コンテンツの自動デプロイメントの無効化
write-attribute操作を使用して XML アプリケーションコンテンツの自動デプロイメントを無効にします。[standalone@localhost:9999 scanner=default] :write-attribute(name=auto-deploy-xml,value=false) {"outcome" => "success"}zip 形式のコンテンツの自動デプロイメントの無効化
write-attributeコマンドを使用して zip 形式のアプリケーションコンテンツの自動デプロイメントを無効にします。[standalone@localhost:9999 scanner=default] :write-attribute(name=auto-deploy-zipped,value=false) {"outcome" => "success"}パス属性の設定
write-attribute操作を使用して、パス属性を変更し、例のnewpathname値を監視するデプロイメントスキャナーの新しいパス名に置き換えます。変更を反映するにはサーバーでリロードする必要があります。[standalone@localhost:9999 scanner=default] :write-attribute(name=path,value=newpathname) { "outcome" => "success", "response-headers" => { "operation-requires-reload" => true, "process-state" => "reload-required" } }相対パス属性の設定
write-attribute操作を使用して、設定 XML ファイルのパスセクションで定義されたファイルシステムパスに対する相対参照を変更します。変更を反映するには、サーバーでリロードする必要があります。[standalone@localhost:9999 scanner=default] :write-attribute(name=relative-to,value=new.relative.dir) { "outcome" => "success", "response-headers" => { "operation-requires-reload" => true, "process-state" => "reload-required" } }デプロイメントスキャナーの無効化
write-attribute操作を使用して、scan-enabled値を false に設定することにより、デプロイメントスキャナーを無効にします。[standalone@localhost:9999 scanner=default] :write-attribute(name=scan-enabled,value=false) {"outcome" => "success"}スキャン間隔の変更
write-attribute操作を使用してスキャン間隔を 5000 ミリ秒から 10000 ミリ秒に変更します。[standalone@localhost:9999 scanner=default] :write-attribute(name=scan-interval,value=10000) {"outcome" => "success"}
設定の変更が、デプロイメントスキャナーに保存されます。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.