创建虚拟环境
conda create -n sentry python=2.7
source activate sentry
安装sentry
/usr/local/anaconda2/bin/pip install sentry
初使化
/usr/local/anaconda2/bin/sentry init /etc/sentry
创建数据库[一定要innodb]
mysql -uroot -prekfan -e 'create database sentry;'
cd /etc/sentry
修改相关参数
安装mysql模块
/usr/local/anaconda2/bin/pip install mysql-python
/usr/local/anaconda2/bin/pip install pymysql
生成数据库
SENTRY_CONF=/etc/sentry /usr/local/anaconda2/bin/sentry upgrade
创建用户
SENTRY_CONF=/etc/sentry /usr/local/anaconda2/bin/sentry createuser
运行WEB
SENTRY_CONF=/etc/sentry /usr/local/anaconda2/bin/sentry run web
运行后台进程
export C_FORCE_ROOT="true"
SENTRY_CONF=/etc/sentry /usr/local/anaconda2/bin/sentry run worker
运行cron进程
SENTRY_CONF=/etc/sentry /usr/local/anaconda2/bin/sentry run cron
python测试用列
-
#!/usr/bin/env ptyhon
-
-
#pip install --upgrade sentry-sdk==0.7.10
-
import sentry_sdk
-
sentry_sdk.init("")
-
-
from sentry_sdk import capture_exception
-
-
try:
-
division_by_zero = 1 / 0
-
except Exception as e:
-
capture_exception(e
已知问题
创建用户会出错,WEB打开为是500错误
可以手要添加用户
-
shell
-
SENTRY_CONF=/etc/sentry /usr/local/anaconda2/bin/sentry shell
-
手工创建用户等
-
https://docs.sentry.io/server/faq/
-
# Bootstrap the Sentry environment
-
from sentry.utils.runner import configure
-
configure()
-
-
# Do something crazy
-
from sentry.models import (
-
Team, Project, ProjectKey, User, Organization, OrganizationMember,
-
OrganizationMemberTeam
-
)
-
-
organization = Organization()
-
organization.name = 'MyOrg'
-
organization.save()
-
-
team = Team()
-
team.name = 'Sentry'
-
team.organization = organization
-
team.save()
-
-
project = Project()
-
project.team = team
-
project.add_team(team)
-
project.name = 'Default'
-
project.organization = organization
-
project.save()
-
-
user = User()
-
user.username = 'admin'
-
user.email = 'admin@localhost'
-
user.is_superuser = True
-
user.set_password('admin')
-
user.save()
-
-
member = OrganizationMember.objects.create(
-
organization=organization,
-
user=user,
-
role='owner',
-
)
-
-
OrganizationMemberTeam.objects.create(
-
organizationmember=member,
-
team=team,
-
)
DNS为空的问题
9.11没有DSN
config.yml
system.url-prefix:
postgresql报citext错误
如果pgsql没有安装的话,会报错,需要安装一个这个扩展
安装扩展模块
/tmp/postgresql-11.2/contrib/citext
gmake
gmake install
createdb -E utf-8 sentry
阅读(1781) | 评论(0) | 转发(0) |