InfluxDB provides high-performance data ingestion, real-time querying, and flexible data retention policies. By following this guide, you’ll set up InfluxDB on your AnonVM instance and be able to start storing and querying time-series data.
Step 1: Access Your AnonVM Server
First, log in to your AnonVM server using SSH:
Replace your-vps-ip
with your server’s actual IP address.
Step 2: Add the InfluxDB Repository
InfluxDB isn’t always included in the default package repositories, so you’ll need to add the InfluxData repository.
-
For Debian/Ubuntu-based systems:
-
For CentOS/RHEL systems:
Step 3: Install InfluxDB
After adding the repository, install InfluxDB with the following commands:
-
For Debian/Ubuntu-based systems:
-
For CentOS/RHEL systems:
Step 4: Start and Enable InfluxDB
To run InfluxDB and set it to start on boot, use the following commands:
To verify that InfluxDB is running, check the status:
Step 5: Configure InfluxDB
The main configuration file for InfluxDB is located at /etc/influxdb/influxdb.conf
. Open this file to adjust settings, such as data retention policies, HTTP settings, and more.
-
Open the configuration file:
-
Enable HTTP Access: Ensure that HTTP service is enabled to allow API calls.
Adjust the
bind-address
if you want to restrict access to specific IP addresses. -
Save and exit the configuration file.
-
Restart InfluxDB to apply the changes:
Step 6: Configure Firewall (If Applicable)
Ensure port 8086 is open to allow connections to InfluxDB.
-
For UFW (Ubuntu):
-
For Firewalld (CentOS/RHEL):
Step 7: Verify the Installation
You can verify the installation by running the following command:
If everything is set up correctly, it should return an HTTP 204 No Content
status, which means InfluxDB is running.
Step 8: Create a Database in InfluxDB
To start storing data, create a new database. You can do this directly in the InfluxDB CLI.
-
Access the CLI:
-
Create a database:
Replace
my_database
with your desired database name. -
Verify the database was created:
-
Exit the CLI by typing
exit
.
Step 9: (Optional) Set Up User Authentication
To secure your InfluxDB instance, enable authentication and create a user.
-
Enable Authentication in
/etc/influxdb/influxdb.conf
by setting: -
Restart InfluxDB:
-
Create an Admin User in the InfluxDB CLI:
Replace
your_password
with a secure password.
Step 10: Query Data and Monitor
You’re now ready to start sending data to InfluxDB! You can use tools like Telegraf for automated data collection or Grafana to visualize your data.
- Telegraf: A plugin-driven server agent for collecting metrics from various sources and storing them in InfluxDB.
- Grafana: Connect Grafana to InfluxDB to create real-time, customizable dashboards for data visualization.
Conclusion
Setting up InfluxDB on your AnonVM server provides a powerful and flexible database for time-series data. With InfluxDB, you can efficiently manage and query large volumes of metrics, making it an excellent choice for monitoring and analytics solutions.