Skip to main content

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

Thanks for your suggestions, you're right: I was testing with mosquitto_pub and I noticed that the client_id changes every messages and I didn't specify the qos so "mosquitto_pub" goes defaults to 0.

clean_session is a parameter related to bridges, there isn't the same options for standard listeners, right?
A "retry_interval 300" should be a safe value?

Now I'm sending messages like this:

    mosquitto_pub -d -h myhost.mydomain.tld -i 2833-sviluppo -q 2 -t '/NLMG3MFQRDVCMZMW/id04/attrs' -m '{"status":3,"battery":2.0}'

I stopped the IOT Agent which consumes messages from the mosquitto queue so I expect to see the mosquitto.db growing but is still at same size:

    -rw------- 1 systemd-bus-proxy systemd-bus-proxy 39 Feb 12 12:06 mosquitto.db


Thank you, Matteo Fracassetti.


Il 11/02/2018 21:35, Karl Palsson ha scritto:
Are you actually sure you have any subscribers that will be
stored? remember, you need.

* clean session false
* stable client id
* subscribe with qos >= 1

Finally, and unrelated, but you almost definitely do _not_ want retry interval down at 20.  


Matteo Fracassetti <matteo.fracassetti@xxxxxxxxxx> wrote:
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
[home_oojah_mqtt]
name=mqtt (CentOS_CentOS-7)
type=rpm-md
baseurl=http://download.opensuse.org/repositories/home:/oojah:/mqtt/CentOS_CentOS-7/
gpgcheck=1
gpgkey=http://download.opensuse.org/repositories/home:/oojah:/mqtt/CentOS_CentOS-7/repodata/repomd.xml.key
enabled=1

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


_______________________________________________
mosquitto-dev mailing list
mosquitto-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/mosquitto-dev


_______________________________________________
mosquitto-dev mailing list
mosquitto-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/mosquitto-dev

-- 

Saluti, Matteo Fracassetti.
Gruppo Sistemisti/DBA - Datacenter
Area Produzione e Prodotti ICT
 
CUP 2000 S.c.p.A.
Via del Borgo di S. Pietro, 90/c - 40126 Bologna
Tel. +39 051 4208{482,571} - Fax +39 051 4208511
E-mail: matteo.fracassetti@xxxxxxxxxx

Back to the top