Setting up the InfluxDB database
Here, we’ll log in to our InfluxDB server, set up an initial account and bucket, and generate an API key so we can connect to it from our Python script and the Grafana data source.
Initializing the InfluxDB server
Log in to the InfluxDB UI at http://localhost:8086. If you haven’t already set up the instance, you’ll see a prompt to perform the initialization:
- Set the username to whatever you like.
- Add a password (a minimum of eight characters minimum).
- Choose an organization name, in our case,
LearnGrafana
. - Create a bucket, in our case,
Chapter07
.
Generating an API token
Generating an API key is a very straightforward process. You’ll need this token in order to access the InfluxDB server from your script:
- Click on Load Data | API Tokens.
- Click the gear icon on the right side of the user you created previously and select Clone.
- Click on Copy to clipboard to save the API token...