Unable to connect to database after Raspberrry PI4 Reboot - Repost

Hi

My Set-Up:

  • Pi 4 with OS installed on SSD;
  • Influxdb and Grafana installed on SSD;
  • Database installed on NAS, via NFS share.

My issue:

All runs fine until the Pi is booted. Afterward, the share is visible, Grafana and Influxdb services are running but the database (Hubitat) is not visible when using Influx>Show databases (Only internal is shown)

What I’ve tried:

  • Restarting Grafana and Influxdb but no change

The only way that I can resolve the issue is to recreate the database, create user, set permissions but then I lose all historical data. Am I doing something stupid?

The edited parts of influxdb.conf is:

### [meta]

### Controls the parameters for the Raft consensus group that stores metadata

### about the InfluxDB cluster.

[meta]

# Where the metadata/raft database is stored

# dir = “/var/lib/influxdb/meta”

dir = “/srv/san04/var/lib/infuxdb/meta”

# Automatically create a default retention policy when creating a database.

# retention-autocreate = true

# If log messages are printed for the meta service

# logging-enabled = true

### [data]

### Controls where the actual shard data for InfluxDB lives and how it is

### flushed from the WAL. “dir” may need to be changed to a suitable place

### for your system, but the WAL settings are an advanced configuration. The

### defaults should work for most systems.

[data]

# The directory where the TSM storage engine stores TSM files.

# dir = “/var/lib/influxdb/data”

dir = “/srv/san04/var/lib/infuxdb/data”

# The directory where the TSM storage engine stores WAL files.

# wal-dir = “/var/lib/influxdb/wal”

wal-dir = “/srv/san04/var/lib/infuxdb/wal”

Sorry, I’m a new user so can’t attach files yet. :frowning:

Has anyone any ideas?

Rather than attach it as a file, you should put ``` backticks above and below that block so that it’s interpreted as code and not markdown.

Sorry for the very slow reply, I’ve been away. Here is my influxdb.conf

###
### [meta]
###
### Controls the parameters for the Raft consensus group that stores metadata
### about the InfluxDB cluster.
###

[meta]
  # Where the metadata/raft database is stored
  # dir = "/var/lib/influxdb/meta"
  dir = "/srv/san04/var/lib/infuxdb/meta"

  # Automatically create a default retention policy when creating a database.
  # retention-autocreate = true

  # If log messages are printed for the meta service
  # logging-enabled = true

###
### [data]
###
### Controls where the actual shard data for InfluxDB lives and how it is
### flushed from the WAL. "dir" may need to be changed to a suitable place
### for your system, but the WAL settings are an advanced configuration. The
### defaults should work for most systems.
###

[data]
  # The directory where the TSM storage engine stores TSM files.
  # dir = "/var/lib/influxdb/data"
  dir = "/srv/san04/var/lib/infuxdb/data"

  # The directory where the TSM storage engine stores WAL files.
  # wal-dir = "/var/lib/influxdb/wal"
  wal-dir = "/srv/san04/var/lib/infuxdb/wal"

Config changes take effect after a restart… if those path changes actually got effect after your latest restart you just told InfluxDB to store all its data (and related files) in a different folder…
the internal DB is auto-created if you tell so in the config…

This means that your “old” DBs are still in the other folder… move them to the new one or change the paths to the older ones… (or do a backup - restore, but I don’t see the point in this case)

Hi and thanks for your reply.

After the changes, I can restart the Influxdb service and everything seems to work okay. New databases get created on the NAS (SAN04) and data is updating the databases but if I reboot the RaspPi, then it can’t see the old database. I have to recreate the database on the NAS and recreate the User, then everything works but all of the historical data gets lost.

This makes absolutely no sense…
it’s either the InflxDB paths pointing to the wrong folder… or the folders have been deleted…

Nice to see that you are as confused as I am! :rofl:

If I explore the NAS, I can see the folders created and the database but can’t connect to it after a reboot. I have the RasPi set to wait for the network before booting and it can see the share. It just doesn’t make any sense to me.

As a test, I’ve just restarted the service with ‘sudo service influxdb restart’ and then started Influx and typed ‘show databases’ and it can see habitat. but if I reboot it just sees _internal! :thinking: