Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mosquitto-dev] Mosquitto persistence file didn't grows.

Hi, all.

 I have a mosquitto server deployed in a Docker container. I mounted a volume for logs and persistence file and everythings seems to work fine except for the persistence: The mosquitto.db files doesn't grows even if I stop any subscriptor which could empty queues.
 Write permissions on db path are fine, if I delete the file mosquitto.db, mosquitto creates it again when started. But nothing seems to be written into and when mosquitto logs to have written his in-memory database to the file, the mosquitto.db was touched and its "last time modified" updated accordingly.
 Any suggestion is strongly appreciated.


# cat /etc/redhat-release (both container and host)
CentOS Linux release 7.4.1708 (Core)

# cat /etc/yum.repos.d/mosquitto.repo
name=mqtt (CentOS_CentOS-7)

mosquitto version 1.4.14 (build date 2017-09-14 18:40:30+0000)

mosquitto config file:

retry_interval 20
user mosquitto
port 1883
protocol mqtt
autosave_interval 180
autosave_on_changes false
persistence true
persistence_file mosquitto.db
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log
log_type all
connection_messages true
log_timestamp true
allow_anonymous true

From Mosquitto log:

Fri Feb  9 17:50:41 2018: Saving in-memory database to /var/lib/mosquitto/mosquitto.db.

Mosquitto db file (host side):

-rw------- 1 systemd-bus-proxy systemd-bus-proxy 39 Feb  9 17:56 mosquitto-db/_data/mosquitto.db

Mosquitto db file (from the container):

# ll /var/lib/mosquitto/mosquitto.db

-rw------- 1 mosquitto mosquitto 39 Feb  9 16:56 /var/lib/mosquitto/mosquitto.db


Best regards, Matteo Fracassetti.

Back to the top