至于为什么要搭建,目的是为了测试移动端程序上传符号表是否可以定位具体的崩溃代码。Sentry作为一款开源的日志跟踪平台。使我们能够快速定位到错误所在的文件和行号。

准备工作

1、Python3
2、Docker 20.10.6
3、Sentry 21.5.1

Python3

为什么需要安装Python
因为自 2020 年 12 月 4 日起,Sentry 默认使用 Python 3。 Sentry 21.1.0 之后的版本不在支持 Python2。

  • 方式一
brew install python
  • 方式二
    官网下载最新版本Python官网

Docker

可以直接从Docker官网下载https://www.docker.com/get-started
安装完成即可。
国内从 DockerHub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务,例如:
1、科大镜像:https://docker.mirrors.ustc.edu.cn/
2、网易:https://hub-mirror.c.163.com/
3、阿里云: https://registry.cn-hangzhou.aliyuncs.com
4、七牛云加速器:https://reg-mirror.qiniu.com
代码示例如下:

"registry-mirrors": ["https://registry.cn-hangzhou.aliyuncs.com"]

在这里插入图片描述

Sentry

直接下载即可https://github.com/getsentry/sentry
解压下载的压缩包,进入解压的文件夹中运行以下命令:

./install.sh

此时我们可能遇到问题如下:

  • 问题一:
./install/_lib.sh: line 15: realpath: command not found

解决方式:添加链接描述

brew install coreutils
  • 问题二:
▶ Parsing command line ...

▶ Setting up error handling ...

▶ Checking minimum requirements ...

WARN: Recommended minimum CPU cores available to Docker is 4, found 2
FAIL: Required minimum RAM available to Docker is 3800 MB, found 1988 MB

解决方式:https://blog.csdn.net/qq_15057213/article/details/117594471?spm=1001.2014.3001.5501
解决完以上问题,运行

./install.sh

安装成功会显示
在这里插入图片描述

启动Sentry服务

docker-compose up -d

启动完成如下图所示
在这里插入图片描述
此时可以点击http://127.0.0.1:9000/organizations/sentry/issues/?project=1
在这里插入图片描述

Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐