首页 > 系统相关 >如何在Ubuntu 22.04上用Docker安装Sentry

如何在Ubuntu 22.04上用Docker安装Sentry

时间:2024-04-16 16:33:56浏览次数:36  
标签:... Sentry self sentry tcp 22.04 上用 hosted docker

Sentry是一个免费和开源的错误跟踪平台,可以实时监控和修复崩溃。它使软件开发人员能够看到重要的东西,更快地解决问题,并不断了解他们的应用程序。这个平台提供了对生产部署的实时洞察力,并提供了重现和修复崩溃的信息。Sentry支持所有主要的语言和框架,并与你喜欢的应用程序和服务集成。 0 前提条件  

  • 一台运行Ubuntu 22.04的服务器。
  • 一个有效的域名被指向你的服务器IP。
  • 在你的服务器上配置了一个根密码。
  安装所需的依赖项 在开始之前,建议将你的软件包更新到最新版本。你可以用以下命令来更新它们:  
apt update -y 
apt upgrade -y

 

一旦你的系统被更新,用下面的命令安装所有需要的软件包:
apt-get install curl git build-essential apt-transport-https ca-certificates software-properties-common -y

 

 安装Docker和Docker Compose 默认情况下,最新版本的Docker和Docker Compose包在Ubuntu 22.04的默认软件库中是不可用的。所以你需要在APT中添加Docker官方仓库。   首先,用以下命令下载并添加Docker GPG密钥:  
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

 

  接下来,用下面的命令添加Docker存储库:
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null

 

一旦版本库被添加,用以下命令更新版本库缓存。
apt update -y

 

接下来,用下面的命令安装Docker和Docker Compose。
apt install docker docker-compose -y

 

安装好这两个软件包后,用以下命令启动Docker服务并使其在系统重启时启动:
systemctl start docker 
systemctl enable docker

 

现在你可以用下面的命令来验证Docker的状态:
systemctl status docker

 

你应该得到以下输出:
docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2023-01-10 04:37:27 UTC; 5s ago
TriggeredBy: ? docker.socket
       Docs: https://docs.docker.com
   Main PID: 45847 (dockerd)
      Tasks: 8
     Memory: 29.1M
        CPU: 220ms
     CGroup: /system.slice/docker.service
             ??45847 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Jan 10 04:37:26 vultr dockerd[45847]: time="2023-01-10T04:37:26.903435377Z" level=info msg="scheme \"unix\" not registered, fallback to defau>
Jan 10 04:37:26 vultr dockerd[45847]: time="2023-01-10T04:37:26.903453803Z" level=info msg="ccResolverWrapper: sending update to cc: {[{unix:>
Jan 10 04:37:26 vultr dockerd[45847]: time="2023-01-10T04:37:26.903464761Z" level=info msg="ClientConn switching balancer to \"pick_first\"" >
Jan 10 04:37:26 vultr dockerd[45847]: time="2023-01-10T04:37:26.916581613Z" level=info msg="Loading containers: start."
Jan 10 04:37:26 vultr dockerd[45847]: time="2023-01-10T04:37:26.997807510Z" level=info msg="Default bridge (docker0) is assigned with an IP a>
Jan 10 04:37:27 vultr dockerd[45847]: time="2023-01-10T04:37:27.060381720Z" level=info msg="Loading containers: done."
Jan 10 04:37:27 vultr dockerd[45847]: time="2023-01-10T04:37:27.074467014Z" level=info msg="Docker daemon" commit=20.10.12-0ubuntu4 graphdriv>
Jan 10 04:37:27 vultr dockerd[45847]: time="2023-01-10T04:37:27.074649813Z" level=info msg="Daemon has completed initialization"
Jan 10 04:37:27 vultr systemd[1]: Started Docker Application Container Engine.
Jan 10 04:37:27 vultr dockerd[45847]: time="2023-01-10T04:37:27.092699576Z" level=info msg="API listen on /run/docker.sock"

 

要检查Docker的版本,请运行以下命令:
docker --version

你应该看到以下输出:

Docker version 20.10.12, build 20.10.12-0ubuntu4

 

你也可以用以下命令检查Docker compose的版本:
docker-compose --version

 

你应该看到以下输出:
docker-compose version 1.29.2, build unknown

 

  安装Sentry   首先,使用以下命令从Git仓库下载最新版本的Sentry:
git clone https://github.com/getsentry/onpremise

 

下载完成后,将目录改为下载的目录,并运行Sentry安装脚本,开始安装。
cd onpremise
bash install.sh

 

在安装过程中,你会被要求创建一个管理员账户,如下图所示:
Here's the info we may collect:

  - OS username
  - IP address
  - install log
  - runtime errors
  - performance data

Thirty (30) day retention. No marketing. Privacy policy at sentry.io/privacy.

Would you like to create a user account now? [Y/n]: y

Email: Email: [email protected]
Password: 
Repeat for confirmation: 
Added to organization: sentry
User created: [email protected]
Creating missing DSNs
Correcting Group.num_comments counter

-----------------------------------------------------------------

You're all done! Run the following command to get Sentry running:

  docker-compose up -d

-----------------------------------------------------------------

 

接下来,使用以下命令验证所有下载的镜像。
docker images

 

你应该看到以下输出。
REPOSITORY                               TAG             IMAGE ID       CREATED             SIZE
sentry-cleanup-self-hosted-local         latest          04fa0fce18f0   4 minutes ago       908MB
symbolicator-cleanup-self-hosted-local   latest          6837f5f48e6c   5 minutes ago       180MB
snuba-cleanup-self-hosted-local          latest          242b7b248e1c   5 minutes ago       486MB
sentry-self-hosted-local                 latest          101b00356aa6   5 minutes ago       907MB
sentry-self-hosted-jq-local              latest          83c66fd3f78f   6 minutes ago       82.5MB
getsentry/sentry                         nightly         cf0f404d102e   About an hour ago   907MB
getsentry/snuba                          nightly         fc6c2d286bf8   8 hours ago         484MB
getsentry/relay                          nightly         43cd2ba5497c   5 days ago          242MB
busybox                                  latest          66ba00ad3de8   6 days ago          4.87MB
tianon/exim4                             latest          12842ac621c1   2 weeks ago         158MB
debian                                   bullseye-slim   dd94cb611937   2 weeks ago         80.5MB
getsentry/sentry-cli                     latest          a585383ff864   2 weeks ago         26.3MB
getsentry/symbolicator                   nightly         80d9b41cd195   3 weeks ago         178MB
nginx                                    1.22.0-alpine   5685937b6bc1   3 months ago        23.5MB
postgres                                 9.6             027ccf656dc1   11 months ago       200MB
confluentinc/cp-kafka                    5.5.0           efc480c1c89c   15 months ago       598MB
confluentinc/cp-zookeeper                5.5.0           ddeb961d8e80   15 months ago       598MB
redis                                    6.2.4-alpine    500703a12fa4   18 months ago       32.3MB
memcached                                1.6.9-alpine    a0132b3398e4   18 months ago       8.09MB
curlimages/curl                          7.77.0          e062233fb4a9   19 months ago       8.26MB
maxmindinc/geoipupdate                   v4.7.1          8ec32cc727c7   21 months ago       10.6MB
clickhouse-self-hosted-local             latest          abe55fc6544d   2 years ago         497MB
yandex/clickhouse-server                 20.3.9.70       abe55fc6544d   2 years ago         497MB

 

  启动Sentry容器   在这一点上,Sentry已经安装完毕。现在你可以使用以下命令启动Sentry容器:
docker-compose up -d

 

这将启动Sentry的所有容器,如下所示:
Starting sentry_onpremise_memcached_1            ... done
Starting sentry_onpremise_redis_1                ... done
Starting sentry_onpremise_symbolicator_1         ... done
Creating sentry_onpremise_symbolicator-cleanup_1 ... done
Starting sentry_onpremise_zookeeper_1            ... done
Starting sentry_onpremise_clickhouse_1           ... done
Starting sentry_onpremise_smtp_1                 ... done
Starting sentry_onpremise_postgres_1             ... done
Starting sentry_onpremise_kafka_1                ... done
Starting sentry_onpremise_snuba-consumer_1          ... done
Starting sentry_onpremise_snuba-outcomes-consumer_1 ... done
Starting sentry_onpremise_snuba-api_1               ... done
Starting sentry_onpremise_snuba-sessions-consumer_1 ... done
Starting sentry_onpremise_snuba-replacer_1          ... done
Creating sentry_onpremise_snuba-cleanup_1           ... done
Creating sentry_onpremise_relay_1                   ... done
Creating sentry_onpremise_web_1                     ... done
Creating sentry_onpremise_post-process-forwarder_1  ... done
Creating sentry_onpremise_cron_1                    ... done
Creating sentry_onpremise_sentry-cleanup_1          ... done
Creating sentry_onpremise_worker_1                  ... done
Creating sentry_onpremise_ingest-consumer_1         ... done
Creating sentry_onpremise_nginx_1                   ... done

 

你可以使用下面的命令验证所有容器的状态。
docker-compose ps

 

你应该看到下面的输出:
----------------------------------------------------------------------------------------------------------------------------------------------
sentry-self-hosted_clickhouse_1                           /entrypoint.sh                   Up (healthy)   8123/tcp, 9000/tcp, 9009/tcp        
sentry-self-hosted_cron_1                                 /etc/sentry/entrypoint.sh  ...   Up             9000/tcp                            
sentry-self-hosted_geoipupdate_1                          /usr/bin/geoipupdate -d /s ...   Exit 1                                             
sentry-self-hosted_ingest-consumer_1                      /etc/sentry/entrypoint.sh  ...   Up             9000/tcp                            
sentry-self-hosted_kafka_1                                /etc/confluent/docker/run        Up (healthy)   9092/tcp                            
sentry-self-hosted_memcached_1                            docker-entrypoint.sh memcached   Up (healthy)   11211/tcp                           
sentry-self-hosted_nginx_1                                /docker-entrypoint.sh ngin ...   Up             0.0.0.0:9000->80/tcp,:::9000->80/tcp
sentry-self-hosted_post-process-forwarder-errors_1        /etc/sentry/entrypoint.sh  ...   Up             9000/tcp                            
sentry-self-hosted_post-process-forwarder-                /etc/sentry/entrypoint.sh  ...   Up             9000/tcp                            
transactions_1                                                                                                                                
sentry-self-hosted_postgres_1                             /opt/sentry/postgres-entry ...   Up (healthy)   5432/tcp                            
sentry-self-hosted_redis_1                                docker-entrypoint.sh redis ...   Up (healthy)   6379/tcp                            
sentry-self-hosted_relay_1                                /bin/bash /docker-entrypoi ...   Up             3000/tcp                            
sentry-self-hosted_sentry-cleanup_1                       /entrypoint.sh 0 0 * * * g ...   Up             9000/tcp                            
sentry-self-hosted_smtp_1                                 docker-entrypoint.sh exim  ...   Up             25/tcp                              
sentry-self-hosted_snuba-api_1                            ./docker_entrypoint.sh api       Up             1218/tcp                            
sentry-self-hosted_snuba-cleanup_1                        /entrypoint.sh */5 * * * * ...   Up             1218/tcp                            
sentry-self-hosted_snuba-consumer_1                       ./docker_entrypoint.sh con ...   Up             1218/tcp                            
sentry-self-hosted_snuba-outcomes-consumer_1              ./docker_entrypoint.sh con ...   Up             1218/tcp                            
sentry-self-hosted_snuba-replacer_1                       ./docker_entrypoint.sh rep ...   Up             1218/tcp                            
sentry-self-hosted_snuba-sessions-consumer_1              ./docker_entrypoint.sh con ...   Up             1218/tcp                            
sentry-self-hosted_snuba-subscription-consumer-events_1   ./docker_entrypoint.sh sub ...   Up             1218/tcp                            
sentry-self-hosted_snuba-subscription-consumer-           ./docker_entrypoint.sh sub ...   Up             1218/tcp                            
transactions_1                                                                                                                                
sentry-self-hosted_snuba-transactions-cleanup_1           /entrypoint.sh */5 * * * * ...   Up             1218/tcp                            
sentry-self-hosted_snuba-transactions-consumer_1          ./docker_entrypoint.sh con ...   Up             1218/tcp                            
sentry-self-hosted_subscription-consumer-events_1         /etc/sentry/entrypoint.sh  ...   Up             9000/tcp                            
sentry-self-hosted_subscription-consumer-transactions_1   /etc/sentry/entrypoint.sh  ...   Up             9000/tcp                            
sentry-self-hosted_symbolicator-cleanup_1                 /entrypoint.sh 55 23 * * * ...   Up             3021/tcp                            
sentry-self-hosted_symbolicator_1                         /bin/bash /docker-entrypoi ...   Up             3021/tcp                            
sentry-self-hosted_web_1                                  /etc/sentry/entrypoint.sh  ...   Up (healthy)   9000/tcp                            
sentry-self-hosted_worker_1                               /etc/sentry/entrypoint.sh  ...   Up             9000/tcp                            
sentry-self-hosted_zookeeper_1                            /etc/confluent/docker/run        Up (healthy)   2181/tcp, 2888/tcp, 3888/tcp   

 

完成后,你可以进入下一步。   访问Sentry Web UI   此时,Sentry已经启动,并在9000端口上监听。现在,打开你的网页浏览器,输入网址http://your-server-ip:9000,访问Sentry仪表板。你将会被转到Sentry的登录页面,如下图所示: 0 提供你的管理员用户名和密码,然后点击登录按钮。你应该看到以下页面:   0 0 提供你的Sentry URL、电子邮件地址和SMTP详细信息,并点击继续按钮。你应该在下面的页面中看到Sentry的默认仪表盘: 0   总结     在本指南中,我们解释了如何在Ubuntu 22.04上安装Sentry。现在,你可以在你的组织中实施Sentry,实时跟踪整个堆栈中的应用程序。  

标签:...,Sentry,self,sentry,tcp,22.04,上用,hosted,docker
From: https://www.cnblogs.com/muyi-yang/p/18138532

相关文章

  • 在ubuntu22.04中使用阿里云镜像站安装docker(官方安装太慢)
    在Ubuntu22.04上安装docker,略有不同。安装一些依赖。sudoaptupdatesudoaptinstallapt-transport-httpsca-certificatescurlgnupglsb-releaseBash在国内的网络环境下,如果使用官方的源来安装docker,下载安装包的过程就非常慢,所以这里使用阿里云源安装添加阿......
  • Ubuntu22.04安装vmtools失败总结
    Ubuntu22.04安装vmtools失败总结问题按照网上安装vmtools方法,点击VMwareWorkstation菜单栏虚拟机重新安装VMtools后再运行下列代码sudo./vmware-install.pl会失败。无法与Windows进行联动。解决方案sudoapt-getupdatesudoapt-getinstallopen-vm-tools-......
  • 记一下-ubuntu22.04安装QQ音乐
    最近用安装了桌面的ubuntu-server22.04,感觉很好用,然后突发奇想,看下装个音乐播放器但是找来找去,发现现在好多已经不开发Debian系的版本了,也就qq音乐还有就尝试安装了下,发现虽然可以安装,但是无法正常打开,打开了就闪退下面就介绍下不闪退的安装步骤下载包到qq音乐的官网下载htt......
  • 在GitHub上用HTTP端口使用ssh
    问题:在实现本地仓库与GitHub仓库相关联时出现下图问题尝试了很多方法包括但不限于:更改公私钥密码,更改防火墙,检查仓库UPL等方法但都没有效果解决方法:通过HTTPS端口使用SSH测试有时,防火墙完全拒绝允许SSH连接。如果无法使用带有凭据缓存的HTTPS克隆,则可以尝试使用通过......
  • Ubuntu 22.04安装在大容量硬盘时默认只启用100G
    背景买了长江致钛的4T硬盘,重新安装Ubuntu22.04后,发现硬盘空间只有100G。本文就是解决这个问题。安装Ubuntu的过程安装到这一步的时候,默认是100G:进入修改界面:修改界面这里显示的是100G:修改成前一步中看到的最大容量1021.996G:在这一步中,可以看到这两行都是1021......
  • Ubuntu22.04修改默认窗口系统为X11
    Ubuntu22.04安装默认窗口系统为Wayland(通过设置->关于可以看到)。一、用UbuntuonXorg会话登录用户登录时,点“未列出”,输入用户名后,在登录界面底部的齿轮图标中,选择"UbuntuonXorg"作为会话类型登录,系统将为当前会话使用Xorg。如果每次手动选择Xorg登录,系统应该记住选......
  • Sentry+nginx代理
    如果想让所有的服务通过统一出口上报异常,可以使用代理模式.一配置本地host文件(可选)127.0.0.1sentry-proxy.com二增加nginx配置#nginx/conf/conf.d/sentry.confserver{listen8081;server_namesentry-proxy.com;#步骤一配置的dns,域名容易......
  • 环境搭建 ubuntu22.04+gtx1070+cuda12.0+cudnn8.8.0+TensorRT8.6
    构建基础             cuda12.0的.deb包会强制安装所依赖的nvidia-525.60.13版本驱动,但是对于ubuntu22.04来说,linux内核为6.5.0,其与该nvidia驱动不兼容,会报错,所以要先安装所支持的驱动,然后再使用runfile进行安装cuda12.0。cuda与驱动版本对应可查如下官网:1.C......
  • 解决ubuntu22.04的ssh问题--userauth_pubkey: key type ssh-rsa not in PubkeyAccepte
    问题在我新安装了一台ubuntu22.04的服务器时,配置远程服务器正常情况下,只要把握本机的公钥写到被远程主机对应用户的.ssh/authorized_keys文件中就好了但是,今天发现,虽然设置进去了,但是远程还是提示需要密码但是并不是所有的主机是这样的,同样是ubuntu22.04的服务器还是能够免......
  • Linux 上用 docker-compose 文件指定的方式安装ETCD
    转载自:https://xie.infoq.cn/article/ffb0703096f0de1045e1ab028,这篇博客很棒!完全可执行的。本人修改了作者docker命令替换成了dockercompose文件的方式。创建数据保存目录:mkdir-p/home/service/etcd/data;创建配置目录:/home/service/etcd/conf;配置文件:/home/service......