sentinel通过docker镜像启动后无法显示监控信息
- Dominant language
- Java
- Stars
- 23.1k
- Forks
- 8.1k
- PR merge metrics
- No merged PRs in 30d
Description
## 问题描述
*bug report*
###描述发生了什么
控制台页面什么都不显示了
下面是浏览器调试模式显示的内容
```shell
Failed to load resource: the server responded with a status of 401 ()
:8080/app/briefinfos.json:1 Failed to load resource: the server responded with a status of 401 ()
DevTools 无法加载源映射: 无法加载http://127.0.0.1:8080/lib/js/angular.min.js.map 的内容:HTTP 错误: 状态代码 404,net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools 无法加载源映射: 无法加载http://127.0.0.1:8080/lib/js/jquery.min.map 的内容:HTTP 错误: 状态代码 404,net::ERR_HTTP_RESPONSE_CODE_FAILURE
```
### Describe what you expected to happen
正常应该自我监控的,有图形展示
### Tell us your environment
用的dockerfile编译
```dockerfile
FROM frolvlad/alpine-glibc:alpine-3.14
#作者
MAINTAINER MaPengfei
#暴露端口
EXPOSE 8080 8719
#工作目录
WORKDIR /opt
#拷贝文件到/opt
COPY s* /opt/
COPY jdk.sh /etc/profile.d/
ADD jdk-8u281-linux-x64.tar.gz /usr/local
run mv /usr/local/jdk* /usr/local/jdk \
&& mkdir /etc/sentinel \
&& mv /opt/sentinel.conf /etc/sentinel/sentinel.conf \
&& mkdir /var/log/sentinel \
&& sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories \
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo 'Asia/Shanghai' > /etc/timezone
# 设置java环境变量
ENV JAVA_HOME=/usr/local/jdk
ENV JRE_HOME=${JAVA_HOME}/jre
ENV CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
ENV PATH=.:${JAVA_HOME}/bin:$PATH
#启动sentinel
ENTRYPOINT ["/bin/sh","/opt/startSentinel.sh"]
```
/opt/startSentinel.sh内容
```shell
#!/bin/sh
java -Dcsp.sentinel.config.file=/etc/sentinel/sentinel.conf \
-Dproject.name=sentinel-dashboard \
-jar /opt/sentinel-dashboard-1.7.2.jar
```
/etc/sentinel/sentinel.conf 内容
```shell
##########
#基础配置项
##########
#指定Sentinel控制台端口,默认为8080
server.port=8080
##########
#鉴权配置项
##########
#是否开启登录鉴权,生产上不建议关闭
auth.enabled=true
#登录控制台的用户名,默认为 sentinel
sentinel.dashboard.auth.username=sentinel
#登录控制台的密码,默认为 sentinel
sentinel.dashboard.auth.password=sentinel
#用于指定Spring Boot服务端session的过期时间,如7200表示7200 秒;60m表示60分钟,默认为30分钟;
#server.servlet.session.timeout=7200
##########
#sentinel-transport-common 的配置项
##########
#控制台的地址,指定控制台后客户端会自动向该地址发送心跳包
entinel.dashboard.server=0.0.0.0:8080
#心跳包发送周期,单位毫秒
csp.sentinel.heartbeat.interval.ms=1000
#本地启动 HTTP API Server 的端口号,默认(8719)
csp.sentinel.api.port=8719
##########
# 日志相关
##########
csp.sentinel.log.dir=/var/log/sentinel/
#Record 日志输出的类型,file 代表输出至文件(默认),console 代表输出至终端
csp.sentinel.log.output.type=file
# 单个日志文件大小,单位KB,本次设置日志文件大小50MB
csp.sentinel.metric.file.single.size=52428800
# 监控日志文件的总数上限
csp.sentinel.metric.file.total.count=4
```
Contributor guide
Research direction
Reproduce the issue using the provided Dockerfile, /opt/startSentinel.sh, and /etc/sentinel/sentinel.conf with sentinel-dashboard-1.7.2.jar. Start by checking the dashboard login/session configuration and the 401 response for /app/briefinfos.json. Done means the console loads its monitoring information and graphical display without the reported authorization failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, java, shell
- Domain
- backend, devops, observability
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100