wiki:mqttredis

Version 5 (modified by krit, 2 years ago) (diff)

--

MQTT with Redis

Ref here
We can get the whole folder by file

  1. untar file and run docker-compose up -d
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
  1. 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
    
  1. get the ip address of redis-mosq docker by
    krit@mini ~$ docker inspect redis-mosq 
    
  1. add user to redis-mosq with command "set user password" as follow
    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)

Download all attachments as: .zip