sentry的安装和使用以及各种问题处理
官方的git地址:https://github.com/getsentry/onpremise
需要先安装docker 1.10版本以上
假设你已经安装完docker,那么接下来
安装docker-compose
sudo yum install epel-release
sudo yum install -y python-pip
sudo pip install docker-compose
安装git
sudo yum install git
制作本地数据库和sentry的目录配置,用来绑定挂载
sudo mkdir -p data/{sentry,postgres}
克隆sentry项目
git clone https://github.com/getsentry/onpremise.git
以下是根据官网给的步骤
docker volume create --name=sentry-data && docker volume create --name=sentry-postgres
创建配置文件
cp -n .env.example .env
执行
docker-compose build
生成key
docker-compose run --rm web config generate-secret-key
添加到.env的SENTRY_SECRET_KEY里面
创建数据库 并且根据提示创建账号
docker-compose run --rm web upgrade
启动
docker-compose up -d
启动成功后可以访问http://localhost:9001
如果创建账号失败:
(1)使用docker命令进入postgres数据库
# docker exec -it onpremise_postgres_1 bash
(2)进入postgres数据库
# psql -h 127.0.0.1 -d postgres -U postgres
(3)查看这两个表是否有数据sentry_project,sentry_organization
postgres=# select * from sentry_project; postgres=# select * from sentry_organization ;
如果没有数据,进行创建
(4)新开一个终端,进入sentry的web的shell里面,其实就是一个python端
# docker-compose run --rm web shell
(5)输入以下命令进行初始化数据
from sentry.models import Project from sentry.receivers.core import create_default_projects create_default_projects([Project])
(6)退出第五步的shell,创建自己的用户
# docker-compose run --rm web createuser
根据提示输入邮箱和密码
如果是发送成功,但是sentry里面看不到日志:
从docker日志查询
docker stop onpremise_worker docker logs -f --tail onpremise_worker
如果发现是类似这样的错误

1.运行命令进入postgres docker
docker exec -it onpremise_postgres_1 bash
2.进入postgre数据库
psql -h 127.0.0.1 -d postgres -U postgres
3.执行:
create or replace function sentry_increment_project_counter( project bigint, delta int) returns int as $$ declare new_val int; begin loop update sentry_projectcounter set value = value + delta where project_id = project returning value into new_val; if found then return new_val; end if; begin insert into sentry_projectcounter(project_id, value) values (project, delta) returning value into new_val; return new_val; exception when unique_violation then end; end loop; end $$ language plpgsql;
4.ctrl + D退出数据库,exit退出bash
5.重新运行onpremise_worker
安装好以后我们可以用python的raven进行测试:
安装
pip install raven
我们假设DSN是http://2b104bab64a447dab5ade5fbd8cac7b8:bad2a34018ce48ea9437f204384ffd54@192.168.187.134:9000/5
raven test http://2b104bab64a447dab5ade5fbd8cac7b8:bad2a34018ce48ea9437f204384ffd54@192.168.187.134:9000/5
sentry的安装和使用以及各种问题处理的更多相关文章
- Sentry的安装搭建与使用
业务监控工具 Sentry 的搭建与使用 官方网址 Django Sentry 官网链接 Sentry 简介 Sentry 是一个开源的实时错误报告工具,支持 web 前后端.移动应用以及游戏,支持 ...
- 错误日志收集sentry的安装与简单使用
通过官方文档https://docs.sentry.io/可以得知,安装服务有两种方式,一种是使用Python,这种方式个人感觉比较麻烦.于是选择了第二种方式:使用docker. 我是在Windows ...
- sentry docker-compsoe 安装以及简单使用
1. 准备环境 docker docker-compose 2. 安装 a. docker-compose git clone git clone https://github.com/get ...
- Sentry的安装、配置、使用
前言 上一篇文章介绍了ExceptionLess这个日志收集系统:ExceptionLess的安装.配置.使用 由于ExceptionLess官方提供的客户端只有.Net/.NetCore平台和js的 ...
- mac安装sentry
最近需要一个日志监视系统所以选择了sentry. 安装docker https://download.docker.com/mac/stable/Docker.dmg 登录 安装完了打开 会提示登录输 ...
- 使用开源软件sentry来收集日志
原文地址:http://luxuryzh.iteye.com/blog/1980364 对于一个已经上线的系统,存在未知的bug或者运行时发生异常是很常见的事情,随之而来的几点需求产生了: 1.系统发 ...
- 【转】Sentry介绍
Sentry 是一个开源的实时错误报告工具,支持 web 前后端.移动应用以及游戏,支持 Python.OC.Java.Go.Node.Django.RoR 等主流编程语言和框架 ,还提供了 GitH ...
- Docker手动搭建sentry错误日志系统
Sentry介绍 在开发过程中,我们通过debug来排查bug,并且使用logging来记录系统的错误.但是logging有很多不足: 必须登陆到服务器查看日志文件 需要主动去查询 输出日志方式无法把 ...
- 使用 Sentry集中处理错误
Sentry的简介 Sentry 是一个实时的事件日志和聚合平台,基于 Django 构建. Sentry 可以帮助你将程序的所有 exception 自动记录下来,处理 exception 是每个程 ...
随机推荐
- tornado--输入和输出
tornado--输入和输出 tornado的self.write只接受byte,Unicode,dict三种格式的对象. self.write会存在一个缓冲区,当不强制断开缓冲的时候,它会把当前函数 ...
- day03 文件操作
目录 1.文件操作实例 2.文件常用操作 3.with模块操作文件 常用实例,把文件里面的内容读出来做成字典的形式在做成字列表展示. 1.精简版. lst = []f = open("fil ...
- Inno Setup打包带有MSI文件的程序
[Setup] ; 注: AppId的值为单独标识该应用程序. ; 不要为其他安装程序使用相同的AppId值. ; (生成新的GUID,点击 工具|在IDE中生成GUID.) AppId={{47A1 ...
- win2008安装并配置zabbix3.4 agent
agent 下载地址: https://www.zabbix.com/download_agents 下载解压后有2个文件夹,一个是bin,存放32位和64位执行程序,一个是conf目录存放着配置文件 ...
- *&p理解
要明白这个需明白两个基础: 运算符*优先级高于&, 两个运算符都是从右向左结合运算 所以,*&a 的意思就是先运算 *,得到 指针,再通过 &,获取指针的引用 如果不理解,继续 ...
- 【转】Syncthing – 数据同步利器---自己的网盘,详细安装配置指南,内网使用,发现服务器配置
Syncthing – 数据同步利器---自己的网盘,详细安装配置指南,内网使用,发现服务器配置 原贴:https://www.cnblogs.com/jackadam/p/8568833.html ...
- 解决spyder、Jupyter Notebook 打不开
参考: https://blog.csdn.net/lanchunhui/article/details/72891918 https://stackoverflow.com/questions/49 ...
- laravel Cache store [] is not defined
去这个网站学习一下也好 https://laravel-china.org/topics/2093/laravel-source-analysis-series-cache#0b2791 如果env ...
- 工控随笔_13_西门子_WinCC的VBS脚本_04_变量类型之二
上一个随笔说了一些关于vbs变量类型的内容,这一篇我们继续说说变量类型相关的内容. 一.NULL补充内容 '需要注意的是,NULL不能简单通过 = 来进行比较,而必须通过 'IsNull函数来实现 ' ...
- (引用)!Unicode,GBK以及UTF8的联系和区别
在实现单片机显示汉字的操作时,了解到有关汉字编码的相关概念. Unicode是一种字符集,该字符集可以涵盖世界上所有的语言.最常见的字符集是ASC II-0~127(0x00~0x7f).Unicod ...