Spring Cloud Alibaba 之02-安裝Sentinel-Dashboard1.8.2

1.環(huán)境檢查

[root@xag220 vhosts]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)

[root@xag220 vhosts]# java -version;
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)

[root@xag220 logs]# hostname -I
10.0.30.220 

2.下載Sentinel控制臺安裝包

[root@xag220 logs]# cd /usr/local/src

[root@xag220 src]# pwd
/usr/local/src

wget https://github.com/alibaba/Sentinel/releases/download/1.8.2/sentinel-dashboard-1.8.2.jar --no-check-certificate

3.jar包做成服務(wù)

mkdir -p /usr/local/sentinel/{bin,logs}

[root@xag220 src]# mv sentinel-dashboard-1.8.2.jar /usr/local/sentinel/

vim /usr/local/sentinel/bin/startup.sh
------------------------------
#!/bin/bash
nohup /u01/java/jdk1.8.0_181/bin/java -Dserver.port=8088 -Dcsp.sentinel.dashboard.server=localhost:8088 -Dproject.name=sentinel-dashboard -jar /usr/local/sentinel/sentinel-dashboard-1.8.2.jar >  /usr/local/sentinel/logs/sentinel.log 2>&1 &
echo $! > /var/run/sentinel.pid
-------------------------------

vim /usr/local/sentinel/bin/shutdown.sh
-------------------------------
#!/bin/sh
kill -9 `cat /var/run/sentinel.pid`
-------------------------------

腳本文件賦予權(quán)限
chmod u+x /usr/local/sentinel/bin/startup.sh
chmod u+x /usr/local/sentinel/bin/shutdown.sh

vim /usr/lib/systemd/system/sentinel.service

[Unit]
Description=service for sentinel
After=syslog.target network.target remote-fs.target nss-lookup.target
     
[Service]
Type=forking
Environment="JAVA_HOME=/u01/java/jdk1.8.0_181"
ExecStart=/usr/local/sentinel/bin/startup.sh
ExecStop=/usr/local/sentinel/bin/shutdown.sh
PrivateTmp=true
     
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
設(shè)置開機(jī)自啟動(dòng)
systemctl enable sentinel.service

啟動(dòng)sentinel服務(wù)
systemctl start sentinel.service

停止開機(jī)自啟動(dòng)
systemctl disable sentinel.service

查看服務(wù)當(dāng)前狀態(tài)
systemctl status sentinel.service

重新啟動(dòng)服務(wù)
systemctl restart sentinel.service 

查看所有已啟動(dòng)的服務(wù)
systemctl list-units --type=service

瀏覽器登陸:http://10.0.30.220:8088
默認(rèn)用戶名和密碼都是sentinel,對于用戶登錄的相關(guān)配置可以在啟動(dòng)命令中增加下面的參數(shù)來進(jìn)行配置:

-Dsentinel.dashboard.auth.username=sentinel: 用于指定控制臺的登錄用戶名為 sentinel;
-Dsentinel.dashboard.auth.password=123456: 用于指定控制臺的登錄密碼為 123456;如果省略這兩個(gè)參數(shù),
默認(rèn)用戶和密碼均為 sentinel

-Dserver.servlet.session.timeout=7200: 用于指定 Spring Boot 服務(wù)端 session 的過期時(shí)間,
如 7200 表示 7200 秒;60m 表示 60 分鐘,默認(rèn)為 30 分鐘

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容