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
  1. 关闭注册

    修改 server.py
    SENTRY_FEATURES[‘auth:register’] = True

    注:不同版本的docker可能会在–port 参数上有报错,如果出错可以尝试-p 或者–p 同时有些会提示 –d和-rm冲突,去掉–detach即可

最后在浏览器中访问 http://localhost:9000/

注意启动顺序 woker->cron->web,

centos7下搭建sentry错误日志服务器的更多相关文章

  1. 第四百零五节,centos7下搭建sentry错误日志服务器,接收python以及Django错误,

    第四百零五节,centos7下搭建sentry错误日志服务器,接收python以及Django错误, 注意:版本,不然会报错 Docker >=1.11Compose >1.6.0 通过d ...

  2. Docker手动搭建sentry错误日志系统

    Sentry介绍 在开发过程中,我们通过debug来排查bug,并且使用logging来记录系统的错误.但是logging有很多不足: 必须登陆到服务器查看日志文件 需要主动去查询 输出日志方式无法把 ...

  3. Centos7 下搭建SVN + Apache 服务器

    1. 安装httpd 安装httpd服务: $ sudo yum install httpd 检查httpd是否安装成功: $ httpd -version Server version: Apach ...

  4. CentOS7下搭建邮件服务器(dovecot + postfix + SSL)

    CentOS   花了基本上两天的时间去配置CentOS7下的邮件服务器.其中艰辛太多了,一定得总结下. 本文的目的在于通过一系列配置,在CentOS 7下搭建dovecot + postfix + ...

  5. CentOS7下搭建zabbix监控(四)——Zabbix报警设置

    CentOS7下搭建zabbix监控(一)——Zabbix监控端配置 CentOS7下搭建zabbix监控(二)——Zabbix被监控端配置 CentOS7下搭建zabbix监控(三)——Zabbix ...

  6. 在Centos7下搭建Socks5代理服务器

    在Centos7下搭建Socks5代理服务器 http://blog.51cto.com/quliren/2052776   采用socks协议的代理服务器就是SOCKS服务器,是一种通用的代理服务器 ...

  7. centos7下搭建ceph luminous(12.2.1)--无网或网络较差

    本博客的主要内容是在centos7下搭建luminous,配置dashboard,搭建客户端使用rbd,源码安装ceph,最后给出一些较为常用的命令.本博客针对初次接触ceph的人群. 搭建环境: 主 ...

  8. CentOS7下搭建zabbix监控(三)——Zabbix监控服务配置

    CentOS7下搭建zabbix监控(一)——Zabbix监控端配置 CentOS7下搭建zabbix监控(二)——Zabbix被监控端配置 (1).配置Zabbix监控Apache服务 主机名:yo ...

  9. CentOS7下搭建zabbix监控(二)——Zabbix被监控端配置

    Zabbix监控端配置请查看:CentOS7下搭建zabbix监控(一)——Zabbix监控端配置 (1).在CentOS7(被监控端)上部署Zabbix Agent 主机名:youxi2 IP地址: ...

随机推荐

  1. 第二个scala程序

    计算昨日收益,读取hdfs文件,使用临时表sqlcontext进行计算,结果保存于mysql中. 之前考虑过将结果存储于Hbase中,由于各种原因及问题,在加上数据量真的很小很小,就改成mysql了. ...

  2. Python 爬取 中关村CPU名字和主频

    0.准备工作   1.相关教程         Python 爬虫系列教程:http://cuiqingcai.com/1052.html         Python Web课程:http://ww ...

  3. 【BZOJ2882】工艺(后缀自动机)

    [BZOJ2882]工艺(后缀自动机) 题面 BZOJ权限题,良心洛谷 题解 还是一样的,先把串在后面接一遍 然后构建\(SAM\) 直接按照字典序输出\(n\)次就行了 #include<io ...

  4. 【BZOJ4237】稻草人(CDQ分治,单调栈)

    [BZOJ4237]稻草人(CDQ分治,单调栈) 题面 BZOJ 题解 \(CDQ\)分治好题呀 假设固定一个左下角的点 那么,我们可以找到的右下角长什么样子??? 发现什么? 在右侧是一个单调递减的 ...

  5. Mysql遇到 is marked as crashed and should be repaired 问题解决方法

    遇到 找到mysql的安装目录的bin/myisamchk工具,在命令行中输入: myisamchk -c -r /var/lib/mysql/ambari/alert_current.MYI 问题解 ...

  6. gulp配置

    /* gulp配置 */ /* gulp配置 */ var gulp = require('gulp'), concat = require('gulp-concat'), rename = requ ...

  7. 接触vsto,开发word插件的利器

    研究word插件有一段时间了,现在该是总结的时候了. 首先咱们来了解下什么是vsto?所谓vsto,就是vs面向office提供的一个开发平台.一个开发平台至少包含两个要素:开发工具(sdk)和运行环 ...

  8. jdk,maven,tomcat 的环境配置

    一般的下载,我想就不用我多说什么了,mysql的配置在mysql压缩包安装方式上,这里直接贴图,下次要是忘记了可以看一眼. 这两个是直接新建的,打开方式为我的电脑,右键:属性,左侧:高级系统设置,下侧 ...

  9. HTTP架构介绍(1) Web服务器和代理服务器

    HTTP应用协议本身是不能运行的,它需是需要架构在硬件和软件解决方案上,才能在万维网上提供高效的传输服务. 在这系列的文章中,我们将会了解到以下概念: Web服务器 代理服务器 缓存 网关.信道和中继 ...

  10. 转: web 页面加载速度优化实战-100% 的飞跃提升

    前言 一个网站的加载速度有多重要? 反正我相信之前来 博主网站 的人至少有 50% 在加载完成前关闭了本站. 为啥捏? 看图 首页完整加载时间 8.18s,看来能进来看博主网站的人都是真爱呀,哈哈. ...