The TIG Stack consists of Telegraf, InfluxDB, and Grafana, which are powerful tools for collecting, storing, and visualizing time-series data. This guide will walk you through the installation of the TIG Stack on Ubuntu 22.04, enabling you to monitor your system's performance effectively. Whether you are deploying it on a local server or using a Windows VPS UK, this tutorial provides all the necessary steps.
Step 1: Update Your System
Before installing the TIG Stack, ensure your system is up to date. Run the following commands:
sudo apt update && sudo apt upgrade -y
Keeping your system updated is crucial for security and performance, whether you're setting it up locally or on a VPS Windows Servers platform.
Step 2: Install InfluxDB
Start by installing InfluxDB, which will be used to store time-series data. Run the following commands to add the InfluxDB repository and install it:
sudo wget -qO - https://repos.influxdata.com/influxdb.key.gpg | sudo apt-key add -
echo "deb https://repos.influxdata.com/debian bullseye stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
sudo apt update
sudo apt install influxdb -y
After installation, start and enable the InfluxDB service:
sudo systemctl start influxdb
sudo systemctl enable influxdb
Step 3: Install Telegraf
Telegraf is the agent that collects metrics from the system and sends them to InfluxDB. To install Telegraf, use the following commands:
sudo apt install telegraf -y
Once installed, start and enable the Telegraf service:
sudo systemctl start telegraf
sudo systemctl enable telegraf
Step 4: Install Grafana
Grafana is the visualization tool that will allow you to create dashboards to view your metrics. To install Grafana, run the following commands:
sudo apt install -y software-properties-common
sudo add-apt-repository ppa:grafana/stable
sudo apt update
sudo apt install grafana -y
After installation, start and enable the Grafana service:
sudo systemctl start grafana-server
sudo systemctl enable grafana-server
Step 5: Configure InfluxDB and Telegraf
Configure Telegraf to send data to InfluxDB. Open the Telegraf configuration file:
sudo nano /etc/telegraf/telegraf.conf
Find the InfluxDB output section and ensure it's configured like this:
[[outputs.influxdb]]
urls = ["http://localhost:8086"]
database = "telegraf"
Save the file and restart the Telegraf service to apply the changes:
sudo systemctl restart telegraf
Step 6: Access Grafana Dashboard
By default, Grafana runs on port 3000. Open your web browser and navigate to:
http://your-server-ip:3000
The default login credentials are:
- Username: admin
- Password: admin
After logging in, you will be prompted to change the default password.
Step 7: Add InfluxDB as a Data Source in Grafana
Once you are in the Grafana dashboard, click on "Configuration" (the gear icon) and select "Data Sources". Click on "Add data source", select "InfluxDB", and configure it:
HTTP URL: http://localhost:8086
Database: telegraf
Save and test the configuration to ensure Grafana can communicate with InfluxDB.
Step 8: Create Dashboards
Now you can create dashboards in Grafana to visualize the metrics collected by Telegraf and stored in InfluxDB. Use the query editor to select your metrics and visualize them in different formats.