Changing influxdb configuration (max-values-per-tag = 100000) for influxdb set up as a GKE application

3/24/2019

I took advantage of the GKE Application console to quickly spin up an instance of Influxdb in my existing GKE cluster. This allowed me to get started with influxdb with relative ease. However, after I started writing data to the cluster, I quickly ran into the 'Max values per tag exceeded limit'. Looking this up, I found articles that recommend setting of the 'max-values-per-tag' to 0 and restarting the influxdb. Problem is, given that I setup influxdb as a GKE application, I don't know if there is a way to change the configuration settings for influxdb via the GKE console or any other way. I did a kubexec to the influxdb pod but don't find this setting in the /etc/influxdb/influxdb.conf file. Even if I do change the file, I don't think the value will survive a restart of the pod since I don't believe this file is in a persistent volume.

Is there a way to change influxdb settings of my influxdb instance that I have spun using GKE application console.

This is the current contents of my /etc/influxdb/influxdb.conf file in the influxdb pod

[meta]
  dir = "/var/lib/influxdb/meta"

[data]
  dir = "/var/lib/influxdb/data"
  engine = "tsm1"
  wal-dir = "/var/lib/influxdb/wal" 
-- boboverflow
google-kubernetes-engine
influxdb

1 Answer

3/25/2019

I figured the answer myself. When creating the influxdb application from The GKE application console, GKE created a stateful set and a persistent volume for me. The path /var/lib/influxdb is mounted on the persistent volume created for this influxdb instance which means that locating the influxdb.conf file in this location guarantees that it will survive pod restarts. So I copied the file originally located in /etc/influxdb/influxdb.conf into /var/lib/influxdb/influxdb.conf and edited it to add this line to the data section:

max-values-per-tag = 0 

I then edited the stateful set via kubectl and set an additional environment variable INFLUXDB_CONFIG_PATH to /var/lib/influxdb/influxdb.conf

Editing the stateful set caused the influxdb pod to be recreated, and the new influxdb pod has the necessary configuration which now allows me to write an unlimited number of unique values per tag.

-- boboverflow
Source: StackOverflow