当前位置:网站首页>Sentry log management system installation and use tutorial
Sentry log management system installation and use tutorial
2022-07-28 08:58:00 【Brother Xing plays with the clouds】
Sentry Is an open source real-time error reporting tool , Support web Front and rear ends 、 Mobile apps and games , Support Python、OC、Java、Go、Node、Django、RoR And other mainstream programming languages and frameworks , It also provides GitHub、Slack、Trello Integration of common development tools .
github Address
One 、 Environmental preparation
Environmental Science | explain |
|---|---|
Ubuntu16.04 | ip: 10.211.55.14 |
Two 、 Install prerequisites
1. install PostgreSQL
1. apt install
sudo apt-get -y install postgresql postgresql-contrib
2. modify Postgres The character's password
> sudo su > su - postgres > psql
Input :
postgres =# \password # Change the current user password Enter new password: Enter it again: postgres =# \q # sign out
function exit Leave postgres user
2. install redis
1. install
> sudo wget http://download.redis.io/releases/redis-3.2.6.tar.gz > sudo tar -zxvf redis-3.2.6.tar.gz > sudo cp -rf redis-3.2.6 /usr/local/redis > cd /usr/local/redis > sudo apt install gcc > sudo make > sudo make install
If you are prompted make test, Then input. make test
2. start-up
function redis-server start-up redis
3. install python, pip, And other environments
1. Install system components
sudo apt install python-setuptools python-dev libxslt1-dev gcc libffi-dev libjpeg-dev libxml2-dev libxslt-dev libyaml-dev libpq-dev
2. install pip
download get-pip.py
> wget "https://bootstrap.pypa.io/get-pip.py" > sudo python get-pip.py
3. install python library
> pip install -U virtualenv
3、 ... and 、 install sentry
1. Creating a virtual environment
> sudo mkdir /var/www > sudo chmod -R 777 /var/www > cd /var/www/ > mkdir sentry > cd sentry > virtualenv venv
2. install sentry
> source venv/bin/activate > pip install -U sentry > sentry Usage: sentry [OPTIONS] COMMAND [ARGS]...
Sentry is cross-platform crash reporting built with love.
The configuration file is looked up in the `~/.sentry` config directory but this can be overridden with the `SENTRY_CONF` environment variable or be explicitly provided through the `--config` parameter.
Options: --config PATH Path to configuration files. --version Show the version and exit. --help Show this message and exit.
Commands: celery DEPRECATED see `sentry run` instead. cleanup Delete a portion of trailing data based on... config Manage runtime config options. createuser Create a new user. devserver Starts a lightweight web server for... django Execute Django subcommands. dsym Manage system symbols in Sentry. export Exports core metadata for the Sentry... files Manage files from filestore. help Show this message and exit. import Imports data from a Sentry export. init Initialize new configuration directory. plugins Manage Sentry plugins. queues Manage Sentry queues. repair Attempt to repair any invalid data. run Run a service. shell Run a Python interactive interpreter. start DEPRECATED see `sentry run` instead. tsdb Tools for interacting with the time series... upgrade Perform any pending database migrations and...
Four 、 To configure sentry
1. initialization
sentry init Profile path
> sentry init /var/www/sentry/conf
2. modify postgreSQL Your connection account and password
open /var/www/sentry/conf/sentry.conf.py
Revise the following paragraph
DATABASES = { 'default': { 'ENGINE': 'sentry.db.postgres', 'NAME': 'sentry', 'USER': 'postgres', 'PASSWORD': '123123', # Just installed postgreSQL After you set the password 'HOST': '', 'PORT': '', 'AUTOCOMMIT': True, 'ATOMIC_REQUESTS': False, } }
3. Initialize data and create users
> createdb -E utf-8 sentry
If you are prompted createdb: could not connect to database template1: FATAL: role "lin" does not exist
Then switch to postgre User execution
perform
SENTRY_CONF=/var/www/sentry/conf/ sentry upgrade
If you are prompted OperationalError: FATAL: Peer authentication failed for user "postgres"
Solution : 1.sudo vim /etc/postgresql/9.5/main/pg_hba.conf 2. modify
local all postgres peer
TYPE DATABASE USER ADDRESS METHOD
"local" is for Unix domain socket connections only
local all all peer
IPv4 local connections:
host all all 127.0.0.1/32 md5
IPv6 local connections:
host all all ::1/128 md5
by
local all postgres md5
TYPE DATABASE USER ADDRESS METHOD
"local" is for Unix domain socket connections only
local all all peer
IPv4 local connections:
host all all 127.0.0.1/32 md5
IPv6 local connections:
host all all ::1/128 md5
3. restart postgresql
sudo service postgresql restart
Re execution
SENTRY_CONF=/var/www/sentry/conf/ sentry upgrade
If you are prompted `sentry.exceptions.InvalidConfiguration: MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.`
Solution : 1. Get into redis redis-cli 2. perform
config set stop-writes-on-bgsave-error no
Re execution
Re execution SENTRY_CONF=/var/www/sentry/conf/ sentry upgrade
After this step is completed, you may be prompted whether to create users , Then create users as required , If there is no prompt, execute the following statement to create
SENTRY_CONF=/var/www/sentry/conf/ sentry createuser
## 5、 ... and 、 Operation service
SENTRY_CONF=/var/www/sentry/conf/ sentry run web # function web service SENTRY_CONF=/var/www/sentry/conf/ sentry run worker # Run the log collection process
SENTRY_CONF=/var/www/sentry/conf/ sentry run cron # start-up cron process
6、 ... and 、 Configuration items 1. Browser open sentry Of web management , http://ip:9000 2. Enter the password of the account you just set 3. Click on New Project Create a project 4. Platform selection php, Enter the name of the project , Click Create 5. The jump page will show the connection code 6. Test error
<?php require_once 'vendor/autoload.php'; Raven_Autoloader::register();
Replace here with your own project id, On the page showing connection help
$client = new Raven_Client('http://f2c047b856bb41fcbf486f467b7fcf5b:[email protected]:9000/1');
$error_handler = new Raven_ErrorHandler($client); $error_handler->registerExceptionHandler(); $error_handler->registerErrorHandler(); $error_handler->registerShutdownFunction();
set_error_handler(array($error_handler, 'handleError')); set_exception_handler(array($error_handler, 'handleException'));
$client->captureMessage(" An error has occurred here ");
$i = 1 / 0;
After running , see web End , You will see the error transmitted back .
边栏推荐
- Shell programming specifications and variables
- Eight ways to solve EMC and EMI conducted interference
- linux初始化mysql时报错 FATAL ERROR: Could not find my-default.cnf
- Solution: indexerror: index 13 is out of bounds for dimension 0 with size 13
- 'global event bus' &' message subscription and Publishing '
- Detailed explanation of MSTP protocol for layer 3 switch configuration [Huawei ENSP experiment]
- Recycling of classes loaded by classloader
- PostgreSQL:无法更改视图或规则使用的列的类型
- PHP Basics - PHP uses mysqli
- C轮融资已完成!思迈特软件领跑国内BI生态赋能,产品、服务竿头一步
猜你喜欢

我来教你如何组装一个注册中心?

TXT文本文件存储

Dry goods semantic web, Web3.0, Web3, metauniverse, these concepts are still confused? (top)

c语言数组指针和指针数组辨析,浅析内存泄漏

客户至上 | 国产BI领跑者,思迈特软件完成C轮融资

I am a 27 year old technical manager, whose income is too high, and my heart is in a panic

Introduction of functions in C language (blood Book 20000 words!!!)

Kubernetes technology and Architecture (VII)

Day112. Shangyitong: Mobile verification code login function

Explain cache consistency and memory barrier
随机推荐
Day112. Shangyitong: Mobile verification code login function
Smartbi of smart smart smart software completed the c-round financing and accelerated the domestic Bi into the intelligent era
Leetcode brushes questions. I recommend this video of the sister Xueba at station B
Path and attribute labels of picture labels
Vk1620 temperature controller / smart meter LED digital display driver chip 3/4-wire interface with built-in RC oscillator to provide technical support
Js继承方法
Service current limiting and fusing of micro service architecture Sentinel
Top all major platforms, 22 versions of interview core knowledge analysis notes, strong on the list
Why setting application.targetframerate doesn't work
Redis basic knowledge, let's review it
Gb/t 41479-2022 information security technology network data processing security requirements map overview
【软考软件评测师】2013综合知识历年真题
A new method of exposing services in kubernetes clusters
Div tags and span Tags
MDM数据质量应用说明
Go channel
Alibaba internal interview materials
Wechat applet - wechat applet browsing PDF files
C #, introductory tutorial -- debugging skills and logical error probe technology and source code when the program is running
JSON 文件存储