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
  2. Start a Postgres container

    $ docker run -d --name sentry-postgres -e POSTGRES_PASSWORD=secret -e POSTGRES_USER=sentry postgres
  3. 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! 

  4. If this is a new database, you'll need to run upgrade

    $ docker run -it --rm -e SENTRY_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

  5. Now start up Sentry server  -p 9000:9000 启动端口映射

    $ docker run -d --name my-sentry -p 9000:9000 -e SENTRY_SECRET_KEY='' --link sentry-redis:redis --link sentry-postgres:postgres sentry
  6. 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='' --link sentry-postgres:postgres --link sentry-redis:redis sentry run cron
    $ docker run -d --name sentry-worker-1 -e SENTRY_SECRET_KEY='' --link sentry-postgres:postgres --link sentry-redis:redis sentry run worker

Port mapping

If you'd like to be able to access the instance from the host without the container's IP, standard port mappings can be used. Just add -p 8080:9000 to the docker run arguments and then access either http://localhost:8080 or http://host-ip:8080 in a browser.

Configuring the initial user

If you did not create a superuser during upgrade, use the following to create one:

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

 

你可能感兴趣的:(Docker)