Closed jarrah31 closed 2 years ago
Strange - managed to get it working somehow!
I started by reading the redis database using this command:
dnucb:~$ sudo apt install redis-tools
dnucb:~$ redis-cli -h 192.168.1.107 -p 6379 ping
PONG
dnucb:~$ redis-cli -h 192.168.1.107 -p 6379 keys '*'
(empty list or set)
I wrote some test data to check redis was working ok:
dnucb:~$ redis-cli -h 192.168.1.107 -p 6379
192.168.1.107:6379> ping
PONG
192.168.1.107:6379> set mykey somevalue
OK
192.168.1.107:6379> exit
dnucb:~$ redis-cli -h 192.168.1.107 -p 6379 keys '*'
1) "mykey"
Great I thought, let's enable debug log in Traefik-top. Restarted the container, checked keys, and to my surprise data appeared!
dnucb:~/docker$ redis-cli -h 192.168.1.107 -p 6379 keys '*'
1) "traefik/http/routers/firefox-rtr/rule"
2) "traefik/http/routers/firefox-rtr/middlewares/0"
3) "traefik_http_services@844ce3de795f"
4) "traefik/http/services/firefox-svc/loadBalancer/passHostHeader"
5) "traefik/http/routers/firefox-rtr/service"
6) "traefik/http/services/firefox-svc/loadBalancer/servers/0/url"
7) "traefik/http/routers/firefox-rtr/entryPoints/0"
8) "traefik_http_routers@844ce3de795f"
9) "mykey"
I really don't know why it didn't work yesterday. Perhaps things just needed to be restarted in the correct order. Anyhow, Traefik redirects to dnucb are working well, so thank you again for writing a very useful utility!
Hopefully this issue will help others looking to debug redis and Traefik top in the future. :)
Thanks for reporting back and I'm glad you got things working! I'll see about adding some troubleshooting info to the readme.
Thanks Cheten!
I just want to mention that the "Key not found in store" error from Traefik no longer appears after a restart seeing as traefik data is now within redis.
Another change I forgot about that may actually be the fix is that I changed my redis container to the following image, and so perhaps a Traefik-top restart the next day is all it then needed.
Would it be worth adding the redis docker-compose below to the readme because I needed to do some digging to see what Redis was (I'd never heard of it before) and figure out the docker-compose details. Thanks.
redis:
image: docker.io/bitnami/redis:latest
container_name: redis
restart: always
environment:
# ALLOW_EMPTY_PASSWORD is recommended only for development.
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_DISABLE_COMMANDS=FLUSHDB,FLUSHALL
ports:
- '6379:6379'
volumes:
- $DOCKERDIR/redis:/bitnami/redis/data
networks:
- t2_proxy
Hi,
I don't think, this is related to the image. I'm using redis:alpine
and it's working just fine :)
Hi Cheten,
Thank you for creating this agent!
I've attempted to install and use Traefik-kop but so far I've been unable to make Traefik detect the remote service. I suspect a configuration issue somewhere so I've copied below my setup in case you can spot an issue. Could you suggest any methods to test connectivity between the hosts please?
So far I have two physical Docker hosts - dnuca with Traefik and dnucb with a Firefox container.
dnuca has the following Traefik and redis conatainer config (I use labels for Traefik configuration) (Host IP: 192.168.1.107)
dnucb host (Host IP 192.168.1.32):
Verbose logs from Traefik-top:
Logs from Redis:
Traefik logs gave an error saying "Key not found in store" - is this part of the problem?
Thanks.