# source /Data/apps/ops4env/bin/activate
# sudo yum install -y postgresql-devel.x86_64
这里安装v8.14.1版本
# pip install sentry==8.14.1 -i https://pypi.doubanio.com/simple
# mkdir /Data/apps/sentry
$ sentry init /Data/apps/sentry
发现多了config.yml,sentry.conf.py 配置
(ops4env) [dev@sxxxx-dev sentry]$ ll
总用量 8
-rw-rw-r-- 1 dev dev 1966 4月 29 14:25 config.yml
-rw-rw-r-- 1 dev dev 3581 4月 29 14:25 sentry.conf.py
(ops4env) [dev@sxxxx-dev sentry]$
vi config.yml
(提前部署好redis实例10.1.201.101:6537,只用修改redis.clusters)
redis.clusters:
default:
hosts:
0:
host: 10.1.201.101
port: 6537
vi sentry.conf.py
(提前创建好mysql数据库sentry,只用修改DATABASES、BROKER_URL)。如果发现端口被占用,修改SENTRY_WEB_PORT
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'sentry',
'USER': 'admin',
'PASSWORD': 'p123456',
'HOST': '10.1.210.168',
'PORT': '3306',
'AUTOCOMMIT': True,
'ATOMIC_REQUESTS': False,
}
}
BROKER_URL = 'redis://10.1.201.101:6537'
SENTRY_WEB_PORT = 9100
# export SENTRY_CONF="/Data/apps/sentry"
# sentry django syncdb
# sentry django migrate
初始化过程中,创建一个超级用户 [email protected] pwd123456
Would you like to create a user account now? [Y/n]: Y
Email: [email protected]
Password:
Repeat for confirmation:
Should this user be a superuser? [y/N]: y
User created: [email protected]
# export SENTRY_CONF="/Data/apps/sentry"
# sentry run web
# sentry run worker
# sentry run cron
http://101.1.21.170:9100/ [email protected] pwd123456
(ops4env) [dev@cxxx-dev sentry]$ python
Python 2.7.9 (default, Sep 8 2015, 11:07:50)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/Data/apps/ops4env/lib/python27.zip', '/Data/apps/ops4env/lib/python2.7', '/Data/apps/ops4env/lib/python2.7/plat-linux2', '/Data/apps/ops4env/lib/python2.7/lib-tk', '/Data/apps/ops4env/lib/python2.7/lib-old', '/Data/apps/ops4env/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7', '/usr/local/lib/python2.7/plat-linux2', '/usr/local/lib/python2.7/lib-tk', '/Data/apps/ops4env/lib/python2.7/site-packages']
>>>
cd /Data/apps/ops4env/lib/python2.7/site-packages/sentry
CleverCode是一名架构师,技术交流,咨询问题,请加CleverCode创建的qq群(架构师俱乐部):517133582。加群和腾讯,阿里,百度,新浪等公司的架构师交流。【架构师俱乐部】宗旨:帮助你成长为架构师!