JBoss EAP 01:Standalone、Domain 與管理介面,先知道自己連到誰
同事說「設定已經改了」,你的請求卻仍走舊行為。先確認是否看同一個實例:同一台主機可以有多個 JVM,管理連線也不一定等於 HTTP 流量最後進入的 server。這一課先建立可以指出名稱與位置的地圖。
Standalone 是管理模式,不等於 Spring Boot JAR
EAP standalone 管理一個 server instance;通常從 standalone/configuration 的設定啟動。它仍然是可部署 WAR、EJB 等元件的應用伺服器。Boot 的 standalone JAR 是應用自己啟動的包裝方式,兩個詞出現在不同層,不能推論兩者有相同生命週期。
# For your own isolated training installation only.
# Run from the EAP installation directory; not executed for this tutorial.
./bin/standalone.sh -c standalone.xml這是啟動示意,不是所有公司的標準指令。RPM、容器或服務管理器可能負責啟動;實際載入的設定檔、JDK 與系統屬性要從那個入口追。不要只打開名稱最熟悉的 standalone.xml 就認定它正在使用。伺服器運行時,設定變更應走受管理的介面,不直接和程序搶寫 XML。
Domain 把管理集中,業務仍在各 server 執行
Domain controller / domain model
→ host controller
→ server A ─┐
→ server B ─┴→ server-group → profile + socket-binding group
Application requests execute on the server JVMs.domain.xml 管理共用設定,host.xml 描述該 host 的角色與 server 等主機層資訊。server group 把一組 server 對到 profile、部署與網路設定。profile 是一組 subsystem 配置,與 Spring 的 profile 不是同一套機制;同名也不代表會互相切換。managed domain 本身不等於應用已做負載平衡或 session 複寫。
管理面與業務 HTTP 面分開確認
# Example local management address; use the actual authorized listener.
./bin/jboss-cli.sh --connect --controller=127.0.0.1:9990
# In the connected CLI, for a standalone training server:
version
:read-children-names(child-type=subsystem)
deployment info9990 是這裡的位址示意,正式環境可能使用不同 port、TLS 或代理。version 用來核對 CLI/連線環境顯示的版本資訊,deployment info 看部署狀態。權限不足、資源不存在與讀取成功但清單為空,是不同結果。Domain 的共用設定通常在 /profile=名稱,特定 server runtime 則走 /host=名稱/server=名稱;不能把 standalone 的根路徑照貼後就當成同一個目標。
動手:在沒有 EAP 的電腦先讀宣告
python3 inventory.py fixtures/standalone.synthetic.xml在下載包目錄執行,預期看到 OrdersDS、AuditXA、mq-jakarta 與 orders.war。http 的 port 仍是 ${jboss.http.port:8080},因為工具刻意不猜環境變數、port offset 或實際 listener。這是辨認 XML 結構的練習,不是有效 EAP 設定,也沒有驗證它能啟動。
自我檢查與答案
看到 socket binding 的預設字串 8080,就能宣稱服務現在聽 8080 嗎?不能。你還缺實際載入設定、expression、offset 與 runtime 的證據。下一步在工作表寫下 mode、host、server、server-group 與 profile;不適用的欄位寫不適用,不知道的留未知。
下載 EAP 離線學習包:盤點工具、練習與工作表下一課:02:WAR/EAR 與部署路徑