Self Hosting Redis, how to do it?

This is my toml and this is basically the entire app.

app = 'test-redis'
primary_region = 'syd'

#This is not using local docker to build
[build]
image='redis'

[http_service]
  auto_stop_machines = 'stop'
  auto_start_machines = true
  min_machines_running = 1
 
 [[services]]
 internal_port = 6379
 protocol      = 'tcp'

   [[services.ports]]
    port=6379

[[vm]]
  memory = '256mb'
  cpu_kind = 'shared'
  cpus = 1

I try to connect with redis insight using hostname or the shared IPV4 address and I get the error

Reached the max retries per request limit (which is 1). Refer to “maxRetriesPerRequest” option for details.

I also tried to setup another following the guide here GitHub - fly-apps/redis: Launch a Redis server on Fly

This doesnt work at all. It does not expose the port 10000 (yes I did uncomment it) to the internet

Hi… What does fly ips list -a test-redis show?


Aside: It’s generally better to tunnel with flyctl proxy if you can. I don’t use Redis myself, but, generally speaking, this mechanism is both more secure and (typically) more convenient than traversing the public Internet…

1 Like

ok im not a smart boy.

I didnt have any ips assigned and once establishing dedicated ipv4, I can connect fine.

1 Like

You don’t need shared ip and export http service, it will open the interface to the public network and cause security issues.

You can connect via private network use host your-redis-app.internal

Minimal fly toml:

app = 'your-redis-appname'

[build]
  image = 'redis:7'

# if you need persistence, create volume before launch
# `fly volume create redis_data` 
[[mounts]]
  source = 'redis_data'
  destination = '/data'
  processes = ['app']

yea thats right but only if the app utilising redis is on the same network, which is why the internal url works.

I was trying to connect via my redis-insight that I have on my docker locally.

Anyway, problation is resolvation.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.