Riemann is an open source event stream processing system, which is used for monitoring and alerting purposes. It receives, stores, and processes data from various sources, and alerts based on pre-defined criteria. In this tutorial, we'll cover the steps required to install Riemann on Alpine Linux.
Before you begin this tutorial, ensure that you have the following:
First, log in to your Alpine Linux system with the sudo user account, and update the package list to its latest version:
sudo apk update
Riemann is a Java-based application. So, ensure that you have the latest version of Java installed on your system:
sudo apk add openjdk8
Next, download the latest version of the Riemann binary from the official website, using the following command:
wget https://github.com/riemann/riemann/releases/download/0.3.2/riemann-0.3.2.tar.bz2
Extract the Rieman package:
tar -xf riemann-0.3.2.tar.bz2
Move the extracted folder to a location where you wish to keep Riemann. Here, we will move it to /opt/riemann
:
sudo mkdir /opt/riemann
sudo mv riemann-0.3.2 /opt/riemann/
Riemann needs a configuration file riemann.config
to configure settings such as log files, email alerts, etc.
Create a riemann.config
file under /opt/riemann
directory:
sudo nano /opt/riemann/riemann.config
Add the following sample content into the riemann.config
file:
(let [host (hostname)]
(merge-defaults
(default)
{ :host host
:port 5555
:ws-tries 30
:event-max-buffer-size 10
:run-interval 10
:log-level :info
:log-file "/var/log/riemann/riemann.log"
:email { :host "localhost"
:port 25
:from "riemann@example.com"
:to "admin@example.com"
:subject "Riemann Alert"
:body (fn [events]
(->> events
(map event-str)
(interpose ",\n")
(apply str)))}})
)
In the above configuration file, we have specified the following settings:
host
– The name of your Riemann server.port
– The port number used to listen for Riemann events.ws-tries
– The number of times to attempt to reconnect to the WebSocket when disconnected.event-max-buffer-size
– The maximum number of events allowed in the buffer.run-interval
– The time period between Riemann configuration runs.log-level
– The log level to use (debug, info, warn, error).log-file
– The path to the Rieman log file.email
– Email server settings for alerting purposes.Once Riemann is configured, we can start the service using the following command:
java -cp /opt/riemann/*:/opt/riemann/etc riemann.bin -config /opt/riemann/riemann.config
To verify that Riemann is running successfully, open a web browser and enter the IP address of Riemann server. You should see the Riemann dashboard.
http://[your-ip]:4567
That's it! You've successfully installed Riemann on Alpine Linux. You can now use Riemann to monitor and alert on events. You can also explore additional Riemann configurations and plugins to extend its functionality.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!