Influxdb not creating data dir when using Create Database

Hi All,

I am trying to create a new database name dockerstats using the below query:

CREATE DATABASE “dockerstats” WITH DURATION 21d REPLICATION 1 SHARD DURATION 24h NAME “default”

After executing this statement it shows up in the list of databases but Show Measurements returned empty and there is no data directory created under /var/lib/influxdb/data/. I tested using versions 1.2.0 and 1.2.2. Please advice. But it is storing data somewhere and seeing the data in the console when I use a Measurement. Please advise what I am doing wrong.

I already have jmeter and jvmstats within the data directory migrated from earlier versions of Influxdb (influxdb-0.12.0-1.x86_64.rpm).

Regards
Karthik

@kpalanivelu Influx will not create the folders until there is data in the database. Also a SHOW MEASUREMENTS on an empty database will return nothing. Also what do you mean by the following: [quote=“kpalanivelu, post:1, topic:794”]
But it is storing data somewhere and seeing the data in the console when I use a Measurement.
[/quote]

@jackzampolin I have created data within dockerstats. When I run the back up it is backing up the database. When I restore also I am getting the data back but not seeing measurements or data dir. I wonder where does it stores the data? But I see other data dir under /var/lib/influxdb/data which is ported from version 0.12. And dockerstats is created newly on 1.2.2.

Hi, I think i found the issue but I need your help here. I already have databases jvmstats and jmeter from earlier version 0.12 and ported to 1.2.2. After porting it and starting the influx db; I created new database of dockerstats with the following command through CLI/HTTP API:

CREATE DATABASE “dockerstats” WITH DURATION 21d REPLICATION 1 SHARD DURATION 24h NAME “default”

I tested the app, data are in dockerstats as I mentioned earlier. I took back up and got following files which got restored and got the data:

dockerstats.default.00389.00
dockerstats.default.00392.00
dockerstats.default.00399.00
dockerstats.default.00399.01

Normally I do restore by the following command:

influxd restore -database dockerstats -datadir /var/lib/influxdb/data/ /opt/monitoring/influxdb/restore

But when I tried it with below command, I thought found the mistake I am doing:

influxd restore -database dockerstats -datadir /var/lib/influxdb/data/dockerstats /opt/monitoring/influxdb/restore

Restoring from backup …/influxdb/restore/dockerstats.*
unpacking /var/lib/influxdb/data/dockerstats/jvmstats/default/389/000000112-000000002.tsm
unpacking /var/lib/influxdb/data/dockerstats/jvmstats/default/392/000000040-000000004.tsm
unpacking /var/lib/influxdb/data/dockerstats/jvmstats/default/399/000000116-000000002.tsm
unpacking /var/lib/influxdb/data/dockerstats/jvmstats/default/399/000000118-000000001.tsm
unpacking /var/lib/influxdb/data/dockerstats/jvmstats/default/399/000000116-000000002.tsm
unpacking /var/lib/influxdb/data/dockerstats/jvmstats/default/399/000000118-000000001.tsm
unpacking /var/lib/influxdb/data/dockerstats/jvmstats/default/399/000000119-000000001.tsm
Above command created the dockerstats dir within data folder and saw jvmstats with dockerstats folder. I am struggling why am I creating the data of dockerstats within jvmstats. I am confused. Please help

Regards
Karthik

To add another perspective to this issue. I am using telegraf to send metrics to influxdb. Telegraf configuration has two input plugins and two output plugins. Telegraf reads JVM metrics using jolokia plugin and sends to JVMstats database in InfluxDB. Similarly docker plugin reads data and post to dockerstats in influxdb. They both use namedrop and namepass attribute to filter the metric as below:

For jvmstats db:

namedrop = [“container_*”,“docker_”,“engine”]
namepass = [“jolokia”]

For dockerstats it is inverse:

namedrop = [“jolokia”]
namepass = [“container_*”,“docker_”,“engine”]

Please let me know where I am missing.