How to Install Sentry Error Tracking System with Docker on Ubuntu 18.04 LTS
1

Sentry is a free and open-source error monitoring software that can be utilized to establish points in real-time. On this tutorial, we’ll clarify the way to set up Sentry with Docker on Ubuntu 18.04 server.

Necessities

  • A server working Ubuntu 18.04 with four GB of RAM.
  • A root password is configured in your server.

Getting Began

Earlier than beginning, it is suggested to replace your system with the most recent model. You are able to do it with the next command:

apt-get replace -y
apt-get improve -y

As soon as the system is up to date, restart it to use all of the adjustments.

Set up Docker CE

Subsequent, you have to to put in the most recent model of Docker CE in your system. By default, the most recent model of Docker just isn’t out there within the Ubuntu 18.04 default repository. So you have to so as to add the repository for that.

First, set up the required packages with the next command:

apt-get set up curl git build-essential apt-transport-https ca-certificates curl software-properties-common -y

Subsequent, obtain and add the GPG key with the next command:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -

Subsequent, add the Docker CE repository with the next command:

add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"

Subsequent, replace the repository and set up Docker CE with the next command:

apt-get replace -y
apt-get set up docker-ce -y

As soon as the Docker has been put in, you’ll be able to verify the standing of Docker with the next command:

systemctl standing docker

You need to see the next output:

? docker.service - Docker Software Container Engine
    Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
    Lively: lively (working) since Wed 2019-07-03 12:34:40 UTC; 22s in the past
      Docs: https://docs.docker.com
  Principal PID: 4683 (dockerd)
     Duties: 8
    CGroup: /system.slice/docker.service
            ??4683 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
 
 Jul 03 12:34:37 ubuntu1804 dockerd[4683]: time="2019-07-03T12:34:37.685945390Z" stage=warning msg="Your kernel does not support swap memory lim
 Jul 03 12:34:37 ubuntu1804 dockerd[4683]: time="2019-07-03T12:34:37.686904854Z" level=warning msg="Your kernel doesn't help cgroup rt perio
 Jul 03 12:34:37 ubuntu1804 dockerd[4683]: time="2019-07-03T12:34:37.687422213Z" level=warning msg="Your kernel doesn't help cgroup rt runti
 Jul 03 12:34:37 ubuntu1804 dockerd[4683]: time="2019-07-03T12:34:37.697386605Z" level=info msg="Loading containers: begin."
 Jul 03 12:34:38 ubuntu1804 dockerd[4683]: time="2019-07-03T12:34:38.896641657Z" level=info msg="Default bridge (docker0) is assigned with an IP
 Jul 03 12:34:39 ubuntu1804 dockerd[4683]: time="2019-07-03T12:34:39.508555810Z" level=info msg="Loading containers: completed."
 Jul 03 12:34:39 ubuntu1804 dockerd[4683]: time="2019-07-03T12:34:39.939899550Z" level=info msg="Docker daemon" commit=2nd0083d graphdriver(s)=ov
 Jul 03 12:34:39 ubuntu1804 dockerd[4683]: time="2019-07-03T12:34:39.947534196Z" level=info msg="Daemon has accomplished initialization"
 Jul 03 12:34:40 ubuntu1804 systemd[1]: Began Docker Software Container Engine.
 Jul 03 12:34:40 ubuntu1804 dockerd[4683]: time="2019-07-03T12:34:40.230411944Z" level=info msg="API pay attention on /var/run/docker.sock"
 

Set up Sentry

First, you have to to obtain the most recent model of sentry from the Github repository. You may obtain it with the next command:

git clone https://github.com/getsentry/onpremise

As soon as the obtain has been accomplished, it’s best to see the next output:

Cloning into 'onpremise'...
 distant: Enumerating objects: 13, completed.
 distant: Counting objects: 100% (13/13), completed.
 distant: Compressing objects: 100% (11/11), completed.
 distant: Whole 228 (delta 3), reused 6 (delta 2), pack-reused 215
 Receiving objects: 100% (228/228), 55.14 KiB | 275.00 KiB/s, completed.
 Resolving deltas: 100% (106/106), completed.
 

Subsequent, construct the native customized picture with the next command:

cd ~/onpremise
make construct

Subsequent, you have to to create a sentry service script. You may create it with the next command:

nano sentry_services.sh

Add the next traces:

#! /bin/bash
 clear
 docker run --detach --name sentry-redis redis:3.2-alpine
 docker run --detach  --name sentry-postgres --env POSTGRES_PASSWORD=secret --env POSTGRES_USER=sentry postgres:9.5
 docker run  --detach  --name sentry-smtp tianon/exim4
 docker run --rm sentry-onpremise --help
 docker run --rm sentry-onpremise config generate-secret-key
 

Save and shut the file, when you’re completed. Then, run the script with the next command:

. sentry_services.sh

You need to see the next output:

0kvhow&i+ok#rjkkc0wvo*n=45=uuua8)51li8)cdjuld6e(2wa
 

Subsequent, you have to to retailer the above key in SENTRY_SECRET_KEY variable. You are able to do this with the next command:

echo 'export SENTRY_SECRET_KEY="0kvhow&i+k#rjkkc0wvo*n=45=uuua8)51li8)cdjuld6e(2wa"' >> ~/.bashrc
supply ~/.bashrc

Subsequent, begin the migration course of with the next command:

docker run --link sentry-redis:redis --link sentry-postgres:postgres --link sentry-smtp:smtp --env SENTRY_SECRET_KEY=${SENTRY_SECRET_KEY} --rm -it sentry-onpremise improve

As soon as the migration course of has been accomplished efficiently, begin the Sentry app with the next command:

docker run --detach --name sentry-web-01 --publish 9000:9000 --link sentry-redis:redis --link sentry-postgres:postgres --link sentry-smtp:smtp --env SENTRY_SECRET_KEY=${SENTRY_SECRET_KEY} sentry-onpremise run net

Subsequent, begin the background staff with the next command:

docker run --detach --name sentry-worker-01 --link sentry-redis:redis --link sentry-postgres:postgres --link sentry-smtp:smtp --env SENTRY_SECRET_KEY=${SENTRY_SECRET_KEY} sentry-onpremise run employee

Subsequent, begin the cron course of with the next command:

docker run --detach --name sentry-cron --link sentry-redis:redis --link sentry-postgres:postgres --link sentry-smtp:smtp --env SENTRY_SECRET_KEY=${SENTRY_SECRET_KEY} sentry-onpremise run cron

Sentry is now configured and listens on port 9000. You may entry Sentry net interface by visiting the URL http://yourserverip:9000.

Congratulations! you’ve efficiently put in and configured Sentry with Docker on Ubuntu 18.04 server.

Amazon warns clients: These dietary supplements is perhaps pretend

Previous article

Leaks reveal a trio of iPhone 11 releases to return from Apple this fall

Next article

You may also like

1 Comment

  1. My developer is trying to persuade me to move to .net from PHP.
    I have always disliked the idea because of the costs. But he’s tryiong none
    the less. I’ve been using WordPress on a number of websites for about a year and am anxious about switching to another platform.
    I have heard fantastic things about blogengine.net.
    Is there a way I can transfer all my wordpress posts into it?
    Any kind of help would be really appreciated!

Leave a Reply

More in Linux