背景說明
Sentinel-dashboard是一個單獨(dú)的應(yīng)用,通過spring-boot進(jìn)行啟動,主要提供一個輕量級的控制臺,它提供機(jī)器發(fā)現(xiàn)、單機(jī)資源實(shí)時監(jiān)控、集群資源匯總,以及規(guī)則管理的功能,控制臺里默認(rèn)的實(shí)時流量監(jiān)控數(shù)據(jù)只保留5分鐘(在內(nèi)存中)
解決方案
下載地址
打開瀏覽器訪問:https://github.com/alibaba/Sentinel/releases 找到對應(yīng)版本的Assets段展開下載對應(yīng)版本的sentinel-dashboard-*.jar
服務(wù)啟動
注冊自己
$ java -Dserver.port=8858 -Dcsp.sentinel.dashboard.server=localhost:8858 -Dproject.name=sentinel-dashboard -Dcsp.sentinel.api.port=8719 -jar sentinel-dashboard-1.8.1.jar
排除自己
$ java -Dserver.port=8858 -jar sentinel-dashboard-1.8.1.jar
啟動參數(shù)
sentinel-dashboard是一個標(biāo)準(zhǔn)的spring boot應(yīng)用。
鑒權(quán)參數(shù)
| 啟動參數(shù) | 參數(shù)值 | 備注 | 默認(rèn)值 |
|---|---|---|---|
| sentinel.dashboard.auth.username | sentinel | 控制臺登錄用戶名 | sentinel |
| sentinel.dashboard.auth.password | sentinel | 控制臺登錄密碼 | sentinel |
| server.servlet.session.timeout | 7200 | 會話過期時間,這里7200表示7200秒 | 30m表示30分鐘 |
| server.servlet.session.cookie.name | sentinel_dashboard_cookie | 控制臺應(yīng)用的 cookie 名稱,可單獨(dú)設(shè)置避免同一域名下 cookie 名沖突 | sentinel_dashboard_cookie |
服務(wù)參數(shù)
| 啟動參數(shù) | 參數(shù)值 | 備注 | 默認(rèn)值 |
|---|---|---|---|
| server.port | 8858 | 指定啟動端口 | 8080 |
| project.name | sentinel-dashboard | 指定Sentinel控制臺程序的名稱 | sentinel-dashboard |
監(jiān)控檢查
| 啟動參數(shù) | 參數(shù)類型 | 默認(rèn)值 | 最小值 | 備注 |
|---|---|---|---|---|
| sentinel.dashboard.app.hideAppNoMachineMillis | Integer | 0 | 60000 | 是否隱藏?zé)o健康節(jié)點(diǎn)的應(yīng)用,距離最近一次主機(jī)心跳時間的毫秒數(shù),默認(rèn)關(guān)閉 |
| sentinel.dashboard.removeAppNoMachineMillis | Integer | 0 | 120000 | 是否自動刪除無健康節(jié)點(diǎn)的應(yīng)用,距離最近一次其下節(jié)點(diǎn)的心跳時間毫秒數(shù),默認(rèn)關(guān)閉 |
| sentinel.dashboard.unhealthyMachineMillis | Integer | 60000 | 30000 | 主機(jī)失聯(lián)判定,不可關(guān)閉 |
| sentinel.dashboard.autoRemoveMachineMillis | Integer | 0 | 300000 | 距離最近心跳時間超過指定時間是否自動刪除失聯(lián)節(jié)點(diǎn),默認(rèn)關(guān)閉 |
注冊參數(shù)
sentinel-dashboard服務(wù)注冊自己至控制臺
| 啟動參數(shù) | 參數(shù)值 | 備注 |
|---|---|---|
| csp.sentinel.api.port | 8719 | 客戶端和服務(wù)通信端口默認(rèn)值8719,客戶端會開啟一個一個端口和服務(wù)端8858進(jìn)行http通信,當(dāng)多個客戶端應(yīng)用時需要指定不同的端口 |
| csp.sentinel.dashboard.server | localhost:8858 | 服務(wù)端IP和端口 |