This is the second article in this series covering how to install Bosun in a production environment. The first article can be found here and covers the installation and configuration of Bosun, this article will cover installing TSDBRelay. Instead of directly sending data to Bosun we can send our data through TSDBRelay which can forward the data to OpenTSDB and then also to Bosun for indexing, this get’s Bosun out of the ‘critical path’ and allow us to keep collecting data in the event Bosun goes down.
A lot of these steps will be very similar to the steps we took to install Bosun so we will start with an Ubuntu 18.04 server before installing go and then grabbing the latest version of TSDBRelay.
curl -O https://dl.google.com/go/go1.11.2.linux-amd64.tar.gz
tar -xvf go1.11.2.linux-amd64.tar.gz
sudo mv go /usr/local
sudo nano ~/.profile
Add the following to the end of the file then save and exit (ctrl+o, enter, ctrl+x)
export GOPATH=$HOME/work export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
One last command now before GO should be installed:
To check everything worked correctly we can run ‘go version’ and check the response:
And we should get:
go version go1.11.2 linux/amd64
We’re going to use Supervisor to monitor and control the TSBDRelay process so we need to install that using the following command:
sudo apt-get install supervisor
Pull TSDBRelay from Github
Let’s create a directory for TSDBRelay and then use wget to pull the latest release from github.
sudo mkdir -m 777 /tsdbrelay
sudo wget -O /tsdbrelay/tsdbrelay https://github.com/bosun-monitor/bosun/releases/download/0.8.0-preview/tsdbrelay-linux-amd64
Now we can use chmod to mark tsdbrelay as executable.
sudo chmod +x /tsdbrelay/tsdbrelay
Create a Supervisor file to run TSDBRelay
Like with Bosun we need to create a supervisor config file to run TSDBRelay, this config file will also contain the parameters to tell TSDBRelay where our Bosun and OpenTSDB servers are.
sudo nano /etc/supervisor/conf.d/tsdbrelay.conf
Here is a basic config file for you to use, substitute bosunip, opentsdbip and redisip with the IP’s of your servers (you can also use url’s if you want), this file also tells TSDBRelay to listen on port 5252 so change that if you wish. Save and exit.
Now let’s tell supervisor to reread and update and that should be it!
sudo supervisorctl reread
sudo supervisorctl update
All data should now be able to be sent through TSDBRelay instead of directly to our Bosun server. This is a fairly basic configuration but TSDBRelay can also do normalisation, more info on that can be found here.
The next article will cover running multiple TSDBRelay instances behind a HAProxy load balancer.