centos7下搭建sentry错误日志服务器
1. docker
安装(方法一)
1.确保yum packages 是最新的
$ sudo yum update
2.添加yum repo
$ sudo tee /etc/yum.repos.d/docker.repo <<-'EOF'
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF
3.安装docker
$ sudo yum install docker-engine
4.启动docker
$ sudo service docker start
5.验证docker已经启动
$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from hello-world
a8219747be10: Pull complete
91c95931e552: Already exists
hello-world:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
Digest: sha256:aa03e5d0d5553b4c3473e89c8619cf79df368babd1.7.1cf5daeb82aab55838d
Status: Downloaded newer image for hello-world:latest
Hello from Docker.
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(Assuming it was not already locally available.)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
For more examples and ideas, visit:
http://docs.docker.com/userguide/
安装(方法二)
1.确保yum packages 是最新的
$ sudo yum update
2.运行docker 安装脚本
$ curl -fsSL https://get.docker.com/ | sh
3.启动docker服务器
$ sudo service docker start
4.验证docker已经启动
$ sudo docker run hello-world
2. sentry
sentry 依赖的组件比较多 包括 redis、 postgresql、 outbound email
在安装sentry前请确保 docker 版本大于1.10
1.安装git
$ sudo yum install git
2.下载docker镜像并构建容器
$ git clone https://github.com/getsentry/onpremise.git
$ cd onpremise
$ sudo make build
注: 所有命令都要以sudo权限运行 否则会报错docker 未启动
3.用docker安装sentry依赖的组件
Redis
docker run \
--detach \
--name sentry-redis \
redis:3.2-alpine
PostgreSQL
docker run \
--detach \
--name sentry-postgres \
--env POSTGRES_PASSWORD=secret \
--env POSTGRES_USER=sentry \
postgres:9.5
Outbound Email
docker run \
--detach \
--name sentry-smtp \
tianon/exim4
注意:接下来所有命令都需要用到 Redis、 PostgreSQL、 Outbound Email中的环境变量,所有命令中需要将将三个镜像连接起来
$ sudo docker run \
--detach \
--rm \
--link sentry-redis:redis \
--link sentry-postgres:postgres \
--link sentry-smtp:smtp \
--env SENTRY_SECRET_KEY=${SENTRY_SECRET_KEY} \
${REPOSITORY} \
<command>
其中 SENTRY_SECRET_KEY 可以自己生成
4.在PostgreSQL中生成sentry需要的表
$ sudo docker run \
--detach \
--rm \
--link sentry-redis:redis \
--link sentry-postgres:postgres \
--link sentry-smtp:smtp \
--env SENTRY_SECRET_KEY=${SENTRY_SECRET_KEY} \
-it sentry-onpremise upgrade
在创建过程中会提示创建一个superuser, 根据提示自动输入邮箱和密码,该账户和密码很重要, 在sentry部署好以后需要用该账号登录, 请必须记住账号和密码
5.拉起sentry需要的后台服务
$ sudo docker run \
--detach \
--rm \
--link sentry-redis:redis \
--link sentry-postgres:postgres \
--link sentry-smtp:smtp \
--env SENTRY_SECRET_KEY=${SENTRY_SECRET_KEY} \
--name sentry-worker-01 \
sentry-onpremise run worker
6.拉起sentry需要的cron后台服务
$ sudo docker run \
--detach \
--rm \
--link sentry-redis:redis \
--link sentry-postgres:postgres \
--link sentry-smtp:smtp \
--env SENTRY_SECRET_KEY=${SENTRY_SECRET_KEY} \
--name sentry-cron \
sentry-onpremise run cron
7.最后拉起sentry的web服务
$ sudo docker run \
--detach \
--rm \
--link sentry-redis:redis \
--link sentry-postgres:postgres \
--link sentry-smtp:smtp \
--env SENTRY_SECRET_KEY=${SENTRY_SECRET_KEY} \
--name sentry-web-01 \
--port 9000:9000 \
sentry-onpremise \
run web
关闭注册
修改 server.py
SENTRY_FEATURES[‘auth:register’] = True注:不同版本的docker可能会在–port 参数上有报错,如果出错可以尝试-p 或者–p 同时有些会提示 –d和-rm冲突,去掉–detach即可
最后在浏览器中访问 http://localhost:9000/
注意启动顺序 woker->cron->web,
centos7下搭建sentry错误日志服务器的更多相关文章
- 第四百零五节,centos7下搭建sentry错误日志服务器,接收python以及Django错误,
第四百零五节,centos7下搭建sentry错误日志服务器,接收python以及Django错误, 注意:版本,不然会报错 Docker >=1.11Compose >1.6.0 通过d ...
- Docker手动搭建sentry错误日志系统
Sentry介绍 在开发过程中,我们通过debug来排查bug,并且使用logging来记录系统的错误.但是logging有很多不足: 必须登陆到服务器查看日志文件 需要主动去查询 输出日志方式无法把 ...
- Centos7 下搭建SVN + Apache 服务器
1. 安装httpd 安装httpd服务: $ sudo yum install httpd 检查httpd是否安装成功: $ httpd -version Server version: Apach ...
- CentOS7下搭建邮件服务器(dovecot + postfix + SSL)
CentOS 花了基本上两天的时间去配置CentOS7下的邮件服务器.其中艰辛太多了,一定得总结下. 本文的目的在于通过一系列配置,在CentOS 7下搭建dovecot + postfix + ...
- CentOS7下搭建zabbix监控(四)——Zabbix报警设置
CentOS7下搭建zabbix监控(一)——Zabbix监控端配置 CentOS7下搭建zabbix监控(二)——Zabbix被监控端配置 CentOS7下搭建zabbix监控(三)——Zabbix ...
- 在Centos7下搭建Socks5代理服务器
在Centos7下搭建Socks5代理服务器 http://blog.51cto.com/quliren/2052776 采用socks协议的代理服务器就是SOCKS服务器,是一种通用的代理服务器 ...
- centos7下搭建ceph luminous(12.2.1)--无网或网络较差
本博客的主要内容是在centos7下搭建luminous,配置dashboard,搭建客户端使用rbd,源码安装ceph,最后给出一些较为常用的命令.本博客针对初次接触ceph的人群. 搭建环境: 主 ...
- CentOS7下搭建zabbix监控(三)——Zabbix监控服务配置
CentOS7下搭建zabbix监控(一)——Zabbix监控端配置 CentOS7下搭建zabbix监控(二)——Zabbix被监控端配置 (1).配置Zabbix监控Apache服务 主机名:yo ...
- CentOS7下搭建zabbix监控(二)——Zabbix被监控端配置
Zabbix监控端配置请查看:CentOS7下搭建zabbix监控(一)——Zabbix监控端配置 (1).在CentOS7(被监控端)上部署Zabbix Agent 主机名:youxi2 IP地址: ...
随机推荐
- SonarQube和Maven的集成
1.1. SonarQube简介 SonarQube是一款免费用于代码质量管理的开源平台,用于管理源代码的质量,可以从七个维度检测代码质量通过插件形式,可以支持包括java,C#,C/C++,PL/S ...
- 【BZOJ1007】水平可见直线(单调栈)
[BZOJ1007]水平可见直线(单调栈) 题解 Description 在xoy直角坐标平面上有n条直线L1,L2,...Ln,若在y值为正无穷大处往下看,能见到Li的某个子线段,则称Li为 可见的 ...
- 【UVA 11426】gcd之和 (改编)
题面 \(\sum_{i=1}^{n}\sum_{j=1}^m\gcd(i,j)\mod998244353\) \(n,m<=10^7\) Sol 简单的一道莫比乌斯反演题 \(原式=\sum_ ...
- [BZOJ1880] [Sdoi2009] Elaxia的路线 (SPFA & 拓扑排序)
Description 最近,Elaxia和w**的关系特别好,他们很想整天在一起,但是大学的学习太紧张了,他们 必须合理地安排两个人在一起的时间.Elaxia和w**每天都要奔波于宿舍和实验室之间, ...
- 剑指offer(15)反转链表
题目描述 输入一个链表,反转链表后,输出链表的所有元素. 题目分析 至少需要三个指针pPre(指向前一个结点).pCurrent(指向当前的结点,在代码中就是pHead).pPnext(指向后一个结点 ...
- 论文笔记(4):Fully Convolutional Networks for Semantic Segmentation
一.FCN中的CNN 首先回顾CNN测试图片类别的过程,如下图: 主要由卷积,pool与全连接构成,这里把卷积与pool都看作图中绿色的convolution,全连接为图中蓝色的fully conne ...
- Delphi关于ADO控件的简单使用
控件:TAdoQuery.ADOConnection.TDataSource.TRzDBGrid 1.新建Vcl Form Application 2.在窗体上添加TADOConnection,设置连 ...
- 学习ASP.NET Core Razor 编程系列一
一. 概述 .NET Core 1.0发布的时候就想进行学习的,不过根据微软的以往的发布规律1.0版可以认为是大众测试版,2.0才算稳定.现在2.1都已经发布了预览版,之前对其"不稳定&qu ...
- 如何利用wireshark破解网站密码
在有进行破解意愿的想法诞生之前,博主得先来给各位泼一盆凉水,本文介绍的方法破解http的轻而易举,而对于https的就算了.因为Wireshark 没有session key ,不能解密SSL数据流. ...
- 面向服务的体系架构 SOA(二) --- 服务的路由和负载均衡
2. 服务的路由和负载均衡 1.2.1 服务化的演变 SOA设计思想:分布式应用架构体系对于业务逻辑复用的需求十分强烈,上层业务都想借用已有的底层服务来快速搭建更多.更丰富的应用,降低新业务开展的人力 ...