Learn how to – Install Zipkin distributed tracing system on Ubuntu / Debian / CentOS.
In this tutorial, we’ll walk through installing and starting an instance of Zipkin tracing system on Ubuntu / Debian / CentOS Linux distributions. Zipkin is a distributed tracing system designed to help you gather timing data needed to troubleshoot latency problems in microservice architectures. It manages both the collection and lookup of this data. Its design is based on the Google Dapper paper.
There are three options of running Zipkin tracing system:
- Using Java (jar file)
- Running in Docker Container
- Running from source.
In this guide, we will consider the first two options – Using Java and Docker. So let’s get started.
Install Zipkin distributed tracing system using Docker
The easiest and quickest way of running Zipkin is via Docker.
How to install Docker CE on Ubuntu / Debian / Fedora / Arch / CentOS
Once Docker is installed, spin a Zipkin Docker container.
docker run -d -p 9411:9411 openzipkin/zipkin
Install Zipkin distributed tracing system using Java
This method will use distributed Java jar file to run Zipkin tracing system on Ubuntu / Debian and CentOS system.
Step 1: Install Java
Install Java on Debian / Ubuntu
sudo apt-get update
sudo apt-get install -y default-jdk jq vim
java -version
Install Java on CentOS 7:
sudo yum -y install epel-release
sudo yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel jq vim
sudo alternatives --config java
java -version
Step 2: Install Zipkin on Ubuntu / Debian / CentOS
Once you have Java 8 or higher installed, fetch the latest release of Zipkin as a self-contained executable jar:
curl -sSL https://zipkin.io/quickstart.sh | bash -s
To run Zipkin, just execute the command:
$ java -jar zipkin.jar
Sample output:
Step 3: Configure Systemd
Running Zipkin with java -jar
Move jar file to /opt directory
.
sudo mkdir /opt/zipkin
sudo mv zipkin.jar /opt/zipkin
ls /opt/zipkin
1.
Start by creating a system group for the user:
sudo groupadd -r zipkin
sudo useradd -r -s /bin/false -g zipkin zipkin
sudo chown -R zipkin:zipkin /opt/zipkin
2.
Create Systemd Service
We can now create a systemd service file to manage our application.
sudo vim /etc/systemd/system/zipkin.service
It will have content like below:
# Zipkin System Service
[Unit]
Description=Manage Java service
Documentation=https://zipkin.io/
[Service]
WorkingDirectory=/opt/zipkin
ExecStart=/usr/bin/java -jar zipkin.jar
User=zipkin
Group=zipkin
Type=simple
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
Memory limits can be set like this:
ExecStart=/bin/java -Xms128m -Xmx256m -jar zipkin.jar
Where -Xms128m
and -Xmx256m
are used to set the minimum and maximum memory that the application can use.
3.
Inform systemd about the new service addition.
sudo systemctl daemon-reload
4.
Once reloaded, start the service
sudo systemctl start zipkin.service
5.
To check the status, use:
$ sudo systemctl status zipkin.service
● zipkin.service - Manage Java service
Loaded: loaded (/etc/systemd/system/zipkin.service; disabled; vendor preset: disabled)
Active: active (running) since Sat 2019-04-06 06:35:18 UTC; 8s ago
Docs: https://zipkin.io/
Main PID: 6034 (java)
CGroup: /system.slice/zipkin.service
└─6034 /bin/java -jar zipkin.jar
....
See screenshot below.
Step 4: Access Zipkin Web UI
Zipkin provides a nice interface for viewing traces based on service, time, and annotations. Browse http://your_host:9411
Note: There is no built-in authentication in the UI. Zipkin UI can be secured by running it behind an authenticating proxy like Apache HTTPD, Nginx. Check running Zipkin behind Apache reverse proxy notes.
Step 5: Configure Tracers and Instrumentation
You have installed and Configured Zipkin, the last requirement is the configuration of your Applications for instrumentation. Check the Instrumentation documentation for how to guides. There are other useful topics on Zipkin Docs.
Leave a Reply
You must be logged in to post a comment.