cabol / nebulex_redis_adapter

Nebulex adapter for Redis

Home Page:https://hexdocs.pm/nebulex_redis_adapter/NebulexRedisAdapter.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Consistently getting MOVED error with a cluster

anthonyshull opened this issue · comments

We have a much larger application to which we are trying to add a Redis cluster. I kept getting issues with MOVED errors and disconnections. So, I wanted to try using the cluster in much simpler application to see if I could get it to work. I'm not sure if my configuration is off or if clustering is not working.

The local cluster is 7.2.3 installed following: Understand, Setup and Test a Redis Cluster in less than 10 minutes. I had the same issues with Bitnami's docker compose cluster.

defp deps do
  [
    {:nebulex, "2.5.2"},
    {:nebulex_redis_adapter, "2.3.1"}
  ]
end
config :testcache, Testcache.Cache,
  mode: :redis_cluster,
  redis_cluster: [
    configuration_endpoints: [
      conn_opts: [
        host: "127.0.0.1",
        port: 30001
      ]
    ]
  ]
defmodule Testcache.Cache do
  use Nebulex.Cache, otp_app: :testcache, adapter: NebulexRedisAdapter
end
iex(1)> Testcache.Cache.start_link([])
{:ok, #PID<0.650.0>}
iex(2)> Testcache.Cache.put("foo", "bar")
:ok
iex(3)> Testcache.Cache.put("hello", "world")
** (Redix.Error) MOVED 866 127.0.0.1:30001...

I just realized the issue is I didn't have crc as a dependency.

Glad to hear that, thanks!