官方的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的安装和使用以及各种问题处理的更多相关文章

  1. Sentry的安装搭建与使用

    业务监控工具 Sentry 的搭建与使用 官方网址 Django Sentry 官网链接 Sentry 简介 Sentry 是一个开源的实时错误报告工具,支持 web 前后端.移动应用以及游戏,支持 ...

  2. 错误日志收集sentry的安装与简单使用

    通过官方文档https://docs.sentry.io/可以得知,安装服务有两种方式,一种是使用Python,这种方式个人感觉比较麻烦.于是选择了第二种方式:使用docker. 我是在Windows ...

  3. sentry docker-compsoe 安装以及简单使用

    1. 准备环境 docker docker-compose     2. 安装 a. docker-compose git clone git clone https://github.com/get ...

  4. Sentry的安装、配置、使用

    前言 上一篇文章介绍了ExceptionLess这个日志收集系统:ExceptionLess的安装.配置.使用 由于ExceptionLess官方提供的客户端只有.Net/.NetCore平台和js的 ...

  5. mac安装sentry

    最近需要一个日志监视系统所以选择了sentry. 安装docker https://download.docker.com/mac/stable/Docker.dmg 登录 安装完了打开 会提示登录输 ...

  6. 使用开源软件sentry来收集日志

    原文地址:http://luxuryzh.iteye.com/blog/1980364 对于一个已经上线的系统,存在未知的bug或者运行时发生异常是很常见的事情,随之而来的几点需求产生了: 1.系统发 ...

  7. 【转】Sentry介绍

    Sentry 是一个开源的实时错误报告工具,支持 web 前后端.移动应用以及游戏,支持 Python.OC.Java.Go.Node.Django.RoR 等主流编程语言和框架 ,还提供了 GitH ...

  8. Docker手动搭建sentry错误日志系统

    Sentry介绍 在开发过程中,我们通过debug来排查bug,并且使用logging来记录系统的错误.但是logging有很多不足: 必须登陆到服务器查看日志文件 需要主动去查询 输出日志方式无法把 ...

  9. 使用 Sentry集中处理错误

    Sentry的简介 Sentry 是一个实时的事件日志和聚合平台,基于 Django 构建. Sentry 可以帮助你将程序的所有 exception 自动记录下来,处理 exception 是每个程 ...

随机推荐

  1. mysql5.7在windwos下的安装

    1. 下载mysql5.7的安装包 下载地址:https://dev.mysql.com/downloads/mysql/ 选择“Windows (x86, 64-bit), ZIP Archive” ...

  2. centos7进单用户

    当重启linux系统,进入系统选择页面的时候,按e 在linux16那一行最后面添加 init=/bin/sh 按ctrl+c 挂载根分区,可读写 mount / -o rw, remount

  3. android开发解决Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'. > java.lang.RuntimeException: java.lang.RuntimeException: c.....

    网上常见的方法我都试过,都没能解决,偶然看到的一个方法解决了,在这了记录一下. 在App目录下的build.gradle的android{ ...  ....}中添加如下代码,即可解决.(xx.xx. ...

  4. Python 安装beautifulsoup4遇到No module named setuptools问题解决方法

    背景说明: 电脑win7-32 在Python 3.3.5下安装beautifulsoup4 4.6.0(下载链接https://pypi.org/project/beautifulsoup4/#fi ...

  5. ANSYS稳态热分析

    目录 题目 APDL操作 温度云图 题目 管子内径外径为r1=4.125mm,r2=4.635mm,中间物体的产热功率为Q=8.73e8W/m3,管外有温度t=127℃的冷水流过,冷却水与管子外表面的 ...

  6. vue 中结合百度地图获取当前城市

    首先需要去百度地图开发者平台申请 ak http://lbsyun.baidu.com/index.php?title=%E9%A6%96%E9%A1%B5 在index.html 中引入script ...

  7. 3、Linux连接oracle

    su - oracle //登录sqlplus sqlplus /nolog //连接orcale conn xx/xx;(用户名/密码)  或者 connect /as sysdba;

  8. cannal&otter源码解析

    一点引用资料的整理 http://www.tianshouzhi.com/api/tutorials/canal/381 canal 同步工具 https://github.com/alibaba/c ...

  9. [ZZ] 如何在多版本anaconda python环境下转换spyder

    https://www.zhihu.com/people/alexwhu/answers 使用anaconda的话,可以参考以下步骤: 1.打开anaconda navigator,选择左侧的环境菜单 ...

  10. Sqlserver 计算两坐标距离函数

    mark if exists (select * from dbo.sysobjects where id = object_id(N'UF_ETL_GetDistance') and xtype i ...