Sun Java System Application Server Enterprise Edition 8.2 高可用性管理指南

使用 Sun Java System Web Server

針對 Sun Java System Web Server,當您安裝負載平衡外掛程式時,安裝程式會自動執行所有必要的配置。不需要進行手動配置。

安裝程式會在 Sun Java System Web Server 的配置檔案中增加以下項目:

在 Web 伺服器實例的 magnus.conf 檔案中,會增加:

##EE lb-pluginInit 
fn="load-modules"
shlib="web-server-install-dir/plugins/lbplugin/bin/libpassthrough.so" 
funcs="init-passthrough,service-passthrough,name-trans-passthrough" Thread="no"
Init fn="init-passthrough"
##end addition for EE lb-plugin

在 Web 伺服器實例的 obj.conf 檔案中,會增加:

<Object name=default>
NameTrans fn="name-trans-passthrough" name="lbplugin" 
config-file="web-server-install-dir/web-server-instance/config/loadbalancer.xml"
<Object name="lbplugin">
  ObjectType fn="force-type" type="magnus-internal/lbplugin"
  PathCheck fn="deny-existence" path="*/WEB-INF/*"
  Service type="magnus-internal/lbplugin" 
  fn="service-passthrough"
  Error reason="Bad Gateway" 
  fn="send-error" 
  uri="$docroot/badgateway.html"
</object>

在上述程式碼中,lbplugin 為唯一識別 Object 的名稱,web-server-install-dir/web-server-instance/config/loadbalancer.xml 為負載平衡器配置要在其上執行的虛擬伺服器之 XML 配置檔案的位置。

NameTrans 項目在 obj.conf 中的顯示順序非常重要。安裝程式會將 NameTrans 項目擺在正確的位置,但是如果您為了其他目的而編輯 obj.conf,則必須確定維持正確的順序。尤其是負載平衡器資訊必須位在 document-root 函數之前。如需有關 obj.conf 檔案的更多資訊,請參閱「Sun Java System Web Server 7.0 Administrator’s Configuration File Reference」

安裝好後,請依循設定 HTTP 負載平衡中的說明配置負載平衡器。