2017-08-15 2 views
2

私の設定には、TLSとユーザー/パス認証を使用するmosquitto 1.4.12がありますが、Ubuntu 14.04の下で問題なく動作しています。

問題は、$SYSブローカーステータスのトピックに公開されているデータがないことです。私は構成を見直してsys_intervalが10に設定されています。

多くのクライアント(mosquitto_sub、paho-mqtt、mqtt.fx)を試したので、クライアントの問題ではなく間違った設定です。

mosquitto.confは次のようになります。

sys_interval 10 

max_queued_messages 10000 
max_inflight_messages 100 
max_connections -1 

connection_messages true 
log_dest stderr 
log_type error 
log_type warning 
log_type notice 
log_type information 
log_type all 
log_timestamp true 

password_file /etc/mosquitto/conf.d/jp.pw 
acl_file /etc/mosquitto/conf.d/acl.conf 

persistence true 
persistence_location /var/lib/mosquitto/ 
persistence_file mosquitto.db 
persistent_client_expiration 1m 
autosave_interval 600 
retained_persistence true 

listener 8883 
tls_version tlsv1.2 

cafile /etc/mosquitto/ca_certificates/ca.crt 
certfile /etc/mosquitto/ca_certificates/cert.crt 
keyfile /etc/mosquitto/ca_certificates/cert.key 
require_certificate false 
allow_anonymous false 

acl.confがこれを持って、不必要である:通常のワイルドカードはとても扱いとして

user test 
topiC# 
+0

:あなたは$SYSトピックを含めるようにACLに余分topic行を追加する必要があり

? '$ SYS'トピックは'# 'サブスクリプションには表示されません。 – hardillb

+0

はい@hardillb、 '$ SYS/broker/clients/active'や' $ SYS/broker/uptime'のような特定のトピックを購読しています – gcw

+0

その中にあなたのmosquitto.confと設定したACLを含めるように質問を編集して、設定したものが表示されるようにしてください。 – hardillb

答えて

2

ACLのトピックフィルタは、同じルールを適用します#へのアクセスを許可するだけでは、 `$ SYS /# 'のトピックはカバーされません。あなたが正確に何をサブスクライブしている

user test 
topiC# 
topic $SYS/# 
関連する問題