Steps to Setup InfluxDB on Windows
Updated: 4 hours ago
This post details steps to set up InfluxDB on Windows.
To visit more such posts follow hashtag - #RealTimeMonitoring
Step 1 - Download InfluxDB
Step 2 - Configure InfluxDB instance
Step 3 - Start InfluxDB server
Step 4 - Verify Configuration
Step 5 - Start as Service
Step 6 - Run InfluxDB client & Get Started
Go to the InfluxDB download page
Click on the marked button which opens new window
In new window scroll till you reach Window binaries.
Click on the URL in the box, and the download will start
Unzip the downloaded file to a preferred location
Below is the file content after extraction:
Below 3 files are of interest to us for now:
influx.exe: Command-line interface to connect to the database & execute queries
influxd.exe: Launch InfluxDB server
influxdb.conf : Configure InfluxDB instance
Configure InfluxDB instance by editing conf file as below :
Add folders named data, meta & wal inside the parent folder where InfluxDB is extracted:
Open conf file for editing:
Change the following sections:
Note double slash instead of single!
[meta] # Where the metadata/raft database is stored dir = "<Location of meta folder>\\meta"
[data] # The directory where the TSM storage engine stores TSM files. dir = "<Location of meta folder>\\data" # The directory where the TSM storage engine stores WAL files. wal-dir = "<Location of meta folder>\\wal
Below are default settings.This relates to http end point which interacts with InfluxDB.Change in case different port is to be used.
[http] # Determines whether HTTP endpoint is enabled. #enabled = true # The bind address used by the HTTP service. #bind-address = ":8086" # Determines whether HTTP request logging is enabled. #log-enabled = true
Start the InfluxDB server by double-clicking influxd or by going to command prompt & running command.
You might get firewall permission issue and need to accept to take it forward.
Finally, you should see below:
By default, logs are shown on standard output console. To redirect log output to file:
Go to the command prompt > location of InfluxDB directory
Run below command:
If you do any changes in conf file, run below command to make changes effective:
Since HTTP endpoint is enabled in the conf file, we can check by launching HTTP endpoint at configured port.
Launch url - http://localhost:8086/query .Below page should follow:
We need to start InfluxDB server by the above way every time we want to get started which is a hassle.It is preferable to run it as service for the same reason.
To run InfluxDB as a service:
Download nssm utility
Open a command prompt as an admin and go to the location of nssm utility command
Following window should open to configure service.
Enter the path for InfluxD & conf file as below:
Argument -> -config "<location of dir>/influxdb.conf"
Startup type -->Automatic
Service start successfully message should be received once pressed ok
Double click marked exe to start Influx CLI
You should see below interface
Congratulations! You are ready to create DB, measurements and perform IFQL commands!
Check out next post for next steps - InfluxDB CLI - Begin with Influx database