Version 7 (modified by 2 years ago) (diff) | ,
---|
MQTT with Redis
Ref here
We can get the whole folder by file
anunda@Storage1:~/MQTT_REDIS/docker-mosquitto-master$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 89a4bf87fc23 docker-mosquitto-master_mosquitto "/run.sh mosquitto" About an hour ago Up About an hour 8883/tcp, 0.0.0.0:1883->1883/tcp, 0.0.0.0:9883->9883/tcp, 9001-9002/tcp docker-mosquitto-master_mosquitto_1 a05510662c79 redis:5.0.4-alpine "docker-entrypoint.s…" About an hour ago Up About an hour 0.0.0.0:6379->6379/tcp redis-mosq
- chmod 666 to Logs/mosquitto.log for writable log file
- get the hash key with following command
krit@mini ~$ docker run -it docker-mosquitto-master_mosquitto np -p mypassword PBKDF2$sha256$901$9QuSsTtUWxCQZYN1$AqEXxC19zJcjcsaHUvSPzAIZA+zq0ccT
- get the ip address of redis-mosq docker by
krit@mini ~$ docker inspect redis-mosq
- add user to redis-mosq with command "set user password" where password get from hash key as in step 2
krit@mini ~$ docker exec -it redis-mosq sh -c 'exec redis-cli -h "192.168.176.2" -p "6379"' 192.168.176.2:6379> set krit PBKDF2$sha256$901$9QuSsTtUWxCQZYN1$AqEXxC19zJcjcsaHUvSPzAIZA+zq0ccT 192.168.176.2:6379> quit
Attachments (1)
- docker-mosquitto-master.tar (50.0 KB) - added by 2 years ago.
Download all attachments as: .zip