一、简介
是什么:面向分布式、多语言异构化服务架构的流量治理组件
能干嘛:从流量路由、流量控制、流量整形、熔断降级、系统自适应过载保护、热点流量防护等多个维度来帮助开发者保障微服务的稳定性


二、实现步骤
2.1 查看Sentinel版本
bash
docker search sentinel-dashboard
2.2 下载Sentinel镜像
bash
docker pull bladex/sentinel-dashboard

查看镜像:

友情提示:如果提示拉取镜像时报错,可以选择更换docker镜像源,步骤如下:
bash
vim /etc/docker/daemon.json
{
"registry-mirrors": [
"https://docker.registry.cyou/",
"https://docker-cf.registry.cyou/",
"https://dockercf.jsdelivr.fyi/",
"https://docker.jsdelivr.fyi/",
"https://dockertest.jsdelivr.fyi/",
"https://mirror.aliyuncs.com/",
"https://dockerproxy.com/",
"https://mirror.baidubce.com/",
"https://docker.m.daocloud.io/",
"https://docker.nju.edu.cn/",
"https://docker.mirrors.sjtug.sjtu.edu.cn/",
"https://docker.mirrors.ustc.edu.cn/",
"https://mirror.iscas.ac.cn/",
"https://docker.rainbond.cc/",
"https://jq794zz5.mirror.aliyuncs.com"
]
}
bash
# 重新加载配置
systemctl daemon-reload
# 重启docker
systemctl restart docker
# 查看配置是否生效
docker info
bash
vim /etc/resolv.conf
nameserver 114.114.114.114
nameserver 8.8.8.8
2.3 运行Sentinel容器
bash
docker run --name sentinel -p 8858:8858 -td bladex/sentinel-dashboard
三、访问Sentinel监控平台
访问地址:http://ip:8858
账号:sentinel
密码:sentinel
四、Sentinel修改默认账号、密码
4.1 进入容器
bash
docker exec -it sentinel /bin/bash
4.2 新建application.properties文件
bash
touch application.properties
4.3 写入配置
bash
vi application.properties
# If auth.enabled=false, Sentinel console disable login
auth.username=sentinel
auth.password=sentinel
只需要写上述两句配置,改掉password就可以了。利用的是springboot项目配置文件优先级方式复写了jar包内的默认配置
4.4 重启docker容器
bash
docker restart sentinel
4.5 测试
输入错误密码

输入正确密码,正常进入
