I’ve looked through several of the threads and I just can’t connect to redis.
Here is my config:
Redis fly.toml
app = "app-name-redis"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []
[build]
image = "flyio/redis:6.2.6"
[env]
[experimental]
allowed_public_ports = []
auto_rollback = true
[[services]]
[[mounts]]
source = "redis_server"
destination = "/data"
App fly.toml
app = "app-name"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []
[build]
builder = "heroku/buildpacks:20"
[env]
PORT = "8080"
[experimental]
allowed_public_ports = []
auto_rollback = true
[[services]]
http_checks = []
internal_port = 8080
processes = ["app"]
protocol = "tcp"
script_checks = []
[services.concurrency]
hard_limit = 25
soft_limit = 20
type = "connections"
[[services.ports]]
force_https = true
handlers = ["http"]
port = 80
[[services.ports]]
handlers = ["tls", "http"]
port = 443
[[services.tcp_checks]]
grace_period = "1s"
interval = "15s"
restart_limit = 0
timeout = "2s"
And my ioredis code in index.ts
const redisClient = new Redis({
port: 6379,
family: 6,
host: "app-name-redis.internal",
password: "<PASSWORD>",
})
I get this error:
[ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1229:16)
I have made sure to set the REDIS_PASSWORD variable on the redis side.
Any ideas?