目 录CONTENT

文章目录

sentry安装部署

xlong
2024-06-02 / 0 评论 / 0 点赞 / 66 阅读 / 3540 字 / 正在检测是否收录...

sentry 24.5.0 Requirements

  • Docker 19.03.6+

  • Compose 2.19.0+

  • 4 CPU Cores

  • 16 GB RAM

  • 20 GB Free Disk Space

安装docker和Compose 过程忽略:

sentry安装

cd /home/
wget https://github.com/getsentry/self-hosted/archive/refs/tags/24.5.0.tar.gz
tar xf 24.5.0.tar.gz
cd self-hosted-24.5.0/
./install.sh
# 安装结束执行下面的命令启动服务
docker compose up -d

安装过程输入一个真实存在的邮箱,接着输入两次密码:

root@iZ2zecvxnyzb263gnpac42Z:/home/self-hosted-24.5.0# ./install.sh
...
Creating missing DSNs
Correcting Group.num_comments counter
09:24:27 [INFO] sentry.outboxes: Executing outbox replication backfill
09:24:27 [INFO] sentry.outboxes: Processing sentry.ControlOutboxs...
09:24:27 [INFO] sentry.outboxes: Processing sentry.RegionOutboxs...
09:24:27 [INFO] sentry.outboxes: done
09:24:27 [WARNING] sentry: Cannot initiate onboarding for organization (1) due to missing owners
Created internal Sentry project (slug=internal, id=1)

Would you like to create a user account now? [Y/n]: y
Email: 输入邮箱
Password:/usr/local/lib/python3.11/getpass.py:91: GetPassWarning: Can not control echo on the terminal.
  passwd = fallback_getpass(prompt, stream)
Warning: Password input may be echoed.
 输入密码

Repeat for confirmation:Warning: Password input may be echoed.
 再次输入密码

Added to organization: sentry
User created: xxx

▶ Setting up GeoIP integration ...
Setting up IP address geolocation ...
Installing (empty) IP address geolocation database ... done.
IP address geolocation is not configured for updates.
See https://develop.sentry.dev/self-hosted/geolocation/ for instructions.
Error setting up IP address geolocation.


-----------------------------------------------------------------

You're all done! Run the following command to get Sentry running:

  docker compose up -d

-----------------------------------------------------------------

打开 http://主机:9000 访问web页面。

登录CSRF错误解决方法:

为 Sentry 实例设置负载均衡器或反向代理后,您应该修改 config.yml 文件中的 system.url-prefix 以匹配新的 URL 和协议。您还应该更新 sentry/sentry.conf.py 脚本中的 SSL/TLS 部分,否则在执行某些操作(例如配置集成)时可能会出现与 CSRF 相关的错误。

没有设置负载均衡或者反向代理也会出现CSRF错误:

对于全新安装,system.url-prefix尚未设置,因此我们默认使用 localhost url

解决方法:

# 修改配置文件 sentry/config.example.yml
root@test:/home/self-hosted-24.5.0# grep system sentry/config.example.yml
# system.url-prefix: https://example.sentry.com
system.url-prefix: http://192.168.1.100:9000
#system.internal-url-prefix: 'http://web:9000'
system.internal-url-prefix: 'http://192.168.1.100:9000'

# 修改配置文件 sentry/sentry.conf.py
root@test:/home/self-hosted-24.5.0# tail sentry/sentry.conf.py
# CSRF_TRUSTED_ORIGINS = ["https://example.com", "http://127.0.0.1:9000"]
CSRF_TRUSTED_ORIGINS = [ "http://47.93.81.154:9000"]

重启服务:

docker-compose down && docker-compose up -d

0

评论区