一、配置Idea Terminal的Shell path。(后面会用到,cmd和powershell配置不同)
有两种:cmd 和 powershell配置不同
正式开始配置sentinel
1、选择Edit configuration
2.点击+号,添加Shell Script
3、
a.Shell path使用cmd
script path:选择javajdk路径下的bin/java.exe
script options: D:/cpf/sentinel-dashboard-1.8.0.jar(写自己sentinel的路径在-jar后面)
-Dserver.port=8180 -Dcsp.sentinel.dashboard.server=localhost:8180 -Dproject.name=sentinel-dashboard -jar D:/cpf/sentinel-dashboard-1.8.0.jar(写自己sentinel的路径在-jar后面)
-Dserver.port 用于指定 Sentinel 控制台端口
-Dcsp.sentinel.dashboard.server 用于指定控制台对外暴露的服务地址
-Dproject.name:项目名称
b.Shell path使用powershell(idea一般默认powershell)
选择scrip text:D:/cpf/sentinel-dashboard-1.8.0.jar(写自己sentinel的路径在-jar后面)
java '-Dserver.port=8180' '-Dcsp.sentinel.dashboard.server=localhost:8180' '-Dproject.name=sentinel-dashboard' -jar D:/cpf/sentinel-dashboard-1.8.0.jar(写自己的sentinel路径 在-jar后面)
-jar前的三项加单引号就行了。
(注意:该方式cmd也可以运行,只需要把单引号去了了就行)
cmd:
java -Dserver.port=8180 -Dcsp.sentinel.dashboard.server=localhost:8180 -Dproject.name=sentinel-dashboard -jar D:/cpf/sentinel-dashboard-1.8.0.jar(写自己sentinel的路径在-jar后面)