sudo yum -y install docker-io
service docker start
sudo curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://6616fe43.m.daocloud.io
chkconfig docker on
docker pull redis docker pull postgres docker pull sentry
docker run -d --name sentry-redis redis docker run -d --name sentry-postgres -e POSTGRES_PASSWORD=secret -e POSTGRES_USER=sentry postgres docker run --rm sentry config generate-secret-key
docker run -it --rm -e SENTRY_SECRET_KEY='<secret-key>' --link sentry-postgres:postgres --link sentry-redis:redis sentry upgrade
(這一步會提示輸入郵箱和密碼) html
docker run -d -p 9000:9000 --name my-sentry -e SENTRY_SECRET_KEY='<secret-key>' --link sentry-redis:redis --link sentry-postgres:postgres sentry
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
1.卸載舊版本html5
sudo yum remove docker \ docker-common \ docker-selinux \ docker-engine
2.安裝依賴包python
sudo yum install -y yum-utils device-mapper-presistent-data lvm2
3.添加穩定源linux
sudo yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo
4.安裝docker ce(比較耗時)git
sudo yum makecache fast sudo yum install docker-ce
5.啓動dockergithub
sudo systemctl start docker
6.測試dockerweb
sudo docker run hello-world
7.查看docker版本redis
docker --version
8.安裝docker-compose(可能會報錯,參考報錯解決)sql
sudo yum install epel-release sudo yum install -y python-pip sudo pip install docker-compose
9.安裝gitdocker
sudo yum install git
10.下載docker鏡像並構建容器
sudo mkdir -p data/{sentry,postgres} git clone https://github.com/getsentry/onpremise.git cd onpremise/
11.更新和運行
docker-compose run --rm web config generate-secret-key
複製最後一行返回值
12.修改設置
vi docker-compose.yml #或者下載下來修改再上傳
13.執行migrate
docker-compose run --rm web upgrade
這裏有沒有建立用戶,直接完成,不知道什麼緣由
報錯提示
應該是不能創建用戶表,可是中間這個報錯是怎麼解決呢?
注意:回退刪除的話,不能用backspace,能夠用crtl+回退
14.運行全部服務
docker-compose up -d
15.查看全部服務
docker ps
·File "/bin/yum-config-manager", line 133
except yum.Errors.RepoError, e:
^
SyntaxError: invalid syntax
解決:
編輯yum-config-manager(解決在操做例如yum換源的時候報錯問題)
cd /bin vim yum-config-manager
第一行改成以下:
#!/usr/bin/python2 -tt
Found existing installation: requests 2.6.0
Cannot uninstall 'requests'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
解決:
忽略 錯誤 安裝模塊
pip install --ignore-installed requests pip2 install --ignore-installed requests
以後再從新安裝docker-compose等步驟
其餘解決參考方式:
Cannot uninstall 'html5lib'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
問題解決:請找到python下面的路徑
而後再找到這個東東把它刪除就能夠了
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
Could not fetch/save url https://download.docker.com/linux/centos/docker-ce.repo to file /etc/yum.repos.d/docker-ce.repo
這是因爲國內訪問不到docker官方鏡像的緣故
能夠經過aliyun的源來完成:
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
(1)使用docker命令進入postgres數據庫
# docker exec -it onpremise_postgres_1 bash
(2)進入postgres數據庫
# psql -h 127.0.0.1 -d postgres -U postgres
(3)查看這兩個表是否有數據sentry_project,sentry_organization
postgres=# select * from sentry_project;
postgres=# select * from sentry_organization ;
若是沒有數據,進行建立
(4)新開一個終端,進入sentry的web的shell裏面,其實就是一個python端
# docker-compose run --rm web shell
(5)輸入如下命令進行初始化數據
from sentry.models import Project
from sentry.receivers.core import create_default_projects
create_default_projects([Project])
(6)退出第五步的shell,建立本身的用戶
# docker-compose run --rm web createuser
輸入你的郵箱和密碼,再刷新網頁就能夠登陸,也能夠查看postgres數據庫裏面也會有數據了。
1.centos7下搭建sentry錯誤日誌服務器:http://projectsedu.com/2016/10/14/centos7%E4%B8%8B%E6%90%AD%E5%BB%BAsentry%E9%94%99%E8%AF%AF%E6%97%A5%E5%BF%97%E6%9C%8D%E5%8A%A1%E5%99%A8/
2.django經過celery添加異步任務:http://projectsedu.com/2017/02/08/django%E9%80%9A%E8%BF%87celery%E6%B7%BB%E5%8A%A0%E5%BC%82%E6%AD%A5%E4%BB%BB%E5%8A%A1/
3.使用 SENTRY 監控業務日誌:https://tech.liuchao.me/2015/06/monitor-service-error-logs-by-using-sentry/
4.解決centos7 docker-compose Traceback:https://blog.csdn.net/weixin_41282397/article/details/80689822
5.docker-compose run --rm web upgrade出錯,最後卡住好久:http://coding.imooc.com/learn/questiondetail/71021.html
6.docker安裝部署sentry:https://blog.csdn.net/dasgk/article/details/78291448