question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Redis port does not need to be published

See original GitHub issue

Description

Is there a reason to publish redis service port ? It seems to me that publishing it in docker-stack.yml is unecessary (redis is accessed internally in the swarm by other services). When deploying the stack, one can see the published port and try to access it from a web browser but will have the following message which can be confusing :

-ERR wrong number of arguments for 'get' command

Steps to reproduce the issue, if relevant:

  1. deploy the stack
  2. open http://<host_ip>:<redis_published_port>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lucjcommented, Mar 10, 2018

You’r right, redis does not need to be published as it’s only used internally by the vote and worker services.

Quick note regarding your example:

Be careful, redis does not expose a http endpoint but a tcp one, if you use a redis client you will be able to connect to the redis service from the outside. Below and nxample when running the stack on play-with-docker.com:

$ redis-cli -h ip172-18-0-10-bahv0ckprd2000cias1g-30000.direct.labs.play-with-docker.com -p 30000
ip172-18-0-10-bahv0ckprd2000cias1g-30000.direct.labs.play-with-docker.com:30000>

Note: as no host port is provided in the redis service, the first one of the range (30000) is mapped to 6379.

0reactions
ManoMarkscommented, Oct 29, 2018

Can someone provide a PR for me? There are several compose/stack files, and a kube deployment file.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Redis docker not available on localhost of docker-compose
The problem is that your application container is using localhost as the hostname for connecting to the redis container. It should be using ......
Read more >
Redis CLI
Host, port, password, and database. By default, redis-cli connects to the server at the address 127.0.0.1 with port 6379. You can change the...
Read more >
I'm wondering if I found a bug with Laravel Redis, I'm doing ...
I'm using Redis pub/sub with Laravel 8 Sail to communicate with a node server that isn't added to the docker.yaml and not launched...
Read more >
Configure the Redis output | Journalbeat Reference [7.15]
If one server becomes unreachable, the events are distributed to the reachable servers only. You can define each Redis server by specifying HOST...
Read more >
Spring Data Redis
One of the first tasks when using Redis and Spring is to connect to the store through the IoC container. To do that,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found