单页面应用优化之路一前端日志管理Sentry搭建

 
        我们今天安装的版本是Docker版
           
        一、安装Docker & docker-compose
            可以看我以前的日志,不多叙述,查看docker 和 docker-compose 的版本           
root@ubuntu:/home/ubuntu# docker --version
Docker version 17.09.1-ce, build 19e2cf6
 
root@ubuntu:/home/ubuntu# docker-compose -version
docker-compose version 1.18.0, build 8dd22a9
 
        二、 下载的sentry
            
root@ubuntu:/home/ubuntu/docker-sentry# git clone https://github.com/getsentry/onpremise.git
Cloning into 'onpremise'...
remote: Enumerating objects: 164, done.
remote: Total 164 (delta 0), reused 0 (delta 0), pack-reused 164
Receiving objects: 100% (164/164), 29.00 KiB | 0 bytes/s, done.
Resolving deltas: 100% (76/76), done.
Checking connectivity... done.
 
 
        三、一些准备工作
        1、根据文件docker-compose.yml,创建数据卷
 
root@ubuntu:/home/ubuntu/docker-sentry/onpremise# docker volume create --name=sentry-data 
    && docker volume create --name=sentry-postgres
sentry-data
sentry-postgres
 
 
        2、创建虚拟环境配置文件
 
root@ubuntu:/home/ubuntu/docker-sentry/onpremise# cp -n .env.example .env
 
        四、安装依赖的docker,分别有Redis,postgres,memcached,smtp,执行下面命令自动下载并获取key
 
root@ubuntu:/home/sentry/onpremise# docker-compose run --rm web config generate-secret-key
Pulling smtp (tianon/exim4:)...
latest: Pulling from tianon/exim4
f7e2b70d04ae: Pull complete
f94554f8e5e9: Pull complete
0b20a7a5fe1e: Pull complete
1b1d255fab51: Pull complete
1ec1532dfb6e: Pull complete
...
Successfully built 888ed909c192
Successfully tagged onpremise_web:latest
WARNING: Image for service web was built because it did not already exist.
To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
q-p(*ccozr!e#v!+3j05j-li30d!ssp@2o!(q9ejj_e7e50(bu
 
 
        五、将生成的key拷贝至docker-compose.yml 的 x-defaults 的environment 的SENTRY_SECRET_KEY 中
 
version: '3.4'
 
x-defaults: &defaults
  restart: unless-stopped
  build: .
  depends_on:
    - redis
    - postgres
    - memcached
    - smtp
  env_file: .env
  environment:
    SENTRY_SECRET_KEY: q-p(*ccozr!e#v!+3j05j-li30d!ssp@2o!(q9ejj_e7e50(bu
    SENTRY_MEMCACHED_HOST: memcached
    SENTRY_REDIS_HOST: redis
    SENTRY_POSTGRES_HOST: postgres
    SENTRY_EMAIL_HOST: smtp
  volumes:
    - sentry-data:/var/lib/sentry/files


 
        六、更新配置并创建超级管理员,中间按提示填写email、pwd就可以了
 
root@ubuntu:/home/sentry/onpremise# docker-compose run --rm web upgrade
Starting onpremise_redis_1    ... done
Starting onpremise_postgres_1 ... done
Starting onpremise_smtp_1      ... done
Starting onpremise_memcached_1 ... done
Traceback (most recent call last):
...
Running migrations for hipchat_ac:
 - Migrating forwards to 0002_auto__del_mentionedevent.
 > hipchat_ac:0001_initial
 > hipchat_ac:0002_auto__del_mentionedevent
 - Loading initial data for hipchat_ac.
Installed 0 object(s) from 0 fixture(s)
Creating missing DSNs
Correcting Group.num_comments counter
 

 

posted @   南巷清风--大R  阅读(234)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」
点击右上角即可分享
微信分享提示