How to connect my internal apps to my self-hosted Redis app

I am getting completely crazy. It has been 1 week since I try to connect my django app and my celery app to my redis app internally.

I have this error:
ERROR/MainProcess] consumer: Cannot connect to redis://ankiflow-redis.internal:6379/0: Error 111 connecting to ankiflow-redis.internal:6379. Connection refused..

Here is my fly.toml:
app = “ankiflow-redis”
primary_region = “cdg”

[build]
image = “redis:7”

[mounts]
source = “redis_data”
destination = “/data”

[env]
REDIS_APPENDONLY = “yes”
REDIS_DIR = “/data”

[processes]
app = “redis-server --appendonly yes --dir /data --protected-mode no --bind 0.0.0.0”

[[vm]]
memory = “256mb”
cpu_kind = “shared”
cpus = 1

[[services]]
internal_port = 6379
protocol = “tcp”
processes = [“app”]

[services.concurrency]
type = “connections”
hard_limit = 1000
soft_limit = 800

[scale]
min_machines = 1
max_machines = 1

[experimental]
private_network = true
autostop = false
allowed_public_ports =
auto_rollback = true

[deploy]
strategy = “rolling”

I really do not understand. The name of my app is ankiflow-redis this is why I try to connect to the host : ankiflow-redis.internal.
It could be a problem of ip adress.

You are my last hope I am deeply sad about the situation I am completely blocked.

Hi, @Ankiflow… Sorry to hear you’re having trouble, :adhesive_bandage:. The bind setting should really be [::] to allow things to be reached via the .internal address. Packets go straight from Machine → Machine in this case, everything over IPv6 wires. (With .flycast and .fly.dev it is a little different, due to the Fly Proxy sitting in the middle.)

Hope this helps!


Aside: I would also suggest removing the [[services]], [scale], and [experimental] sections; those don’t play a role in .internal traffic—and what you have there at present is not really valid…

Thank you very much for your answer,

[processes]
app = “redis-server --bind :: --appendonly yes --dir /data --protected-mode no”

it finally worked using this command up here.

1 Like

I am pleased you’ve gotten an answer @Ankiflow.

When posting here, please consider using Markdown. There’s a number of formatting systems in this platform that make posts rather easier to read. In particular, code formatting, which looks like this:

[processes]
app = "redis-server --bind :: --appendonly yes --dir /data --protected-mode no"