天天看点

sentry搭建和使用

premise安装:​​https://github.com/getsentry/onpremise​​

​cp sentry/config.example.yml​

​​ ​

​sentry/config.yml​

​ 

​cp sentry/sentry.conf.example.py sentry/sentry.conf.py​

执行install.sh 

安装完成后打开:ip:9000端口即可

docker安装参考:​​https://hub.docker.com/_/sentry/​​

How to setup a full Sentry instance

  1. Start a Redis container
$ docker run -d --name sentry-redis redis      
  1. Start a Postgres container
$ docker run -d --name sentry-postgres -e POSTGRES_PASSWORD=secret -e POSTGRES_USER=sentry postgres      
  1. Generate a new secret key to be shared by all ​

    ​sentry​

    ​ containers. This value will then be used as the ​

    ​SENTRY_SECRET_KEY​

    ​ environment variable.
$ docker run --rm sentry config generate-secret-key      

生成的密码:

n2er7#1^&&=v*w%%jvwg46wlv!59vt^*^qgid_fn1(e#mhe*t! 

  1. If this is a new database, you'll need to run ​

    ​upgrade​

$ docker run -it --rm -e SENTRY_SECRET_KEY='<secret-key>' --link sentry-postgres:postgres --link sentry-redis:redis sentry upgrade      

Note: the ​

​-it​

​ is important as the initial upgrade will prompt to create an initial user and will fail without it

  1. Now start up Sentry server  -p 9000:9000 启动端口映射
$ docker run -d --name my-sentry -p 9000:9000 -e SENTRY_SECRET_KEY='<secret-key>' --link sentry-redis:redis --link sentry-postgres:postgres sentry      
  1. The default config needs a celery beat and celery workers, start as many workers as you need (each with a unique name)
$ docker run -d --name sentry-cron -e SENTRY_SECRET_KEY='<secret-key>' --link sentry-postgres:postgres --link sentry-redis:redis sentry run cron
$ docker run -d --name sentry-worker-1 -e SENTRY_SECRET_KEY='<secret-key>' --link sentry-postgres:postgres --link sentry-redis:redis sentry run worker      

Port mapping

Configuring the initial user

$ docker run -it --rm -e SENTRY_SECRET_KEY='<secret-key>' --link sentry-redis:redis --link sentry-postgres:postgres sentry createuser