Code Monkey home page Code Monkey logo

Comments (7)

menasheh avatar menasheh commented on June 1, 2024

As I'm researching I've found DNS_NODES param, not sure if this works off of FLY yet? Looking for something that works in kubernetes or docker swarm.

from realtime.

filipecabaco avatar filipecabaco commented on June 1, 2024

Hi @menasheh

You might be having issues because you actually need to connect the erlang nodes. we're using libcluster postgres strategy to achieve it in Realtime.

Where are you deploying your system? In theory the only thing you will need is to be able to ping another machines host name and that should be enough for them to connect between them.

More details on the strategy: https://github.com/supabase/libcluster_postgres

from realtime.

menasheh avatar menasheh commented on June 1, 2024

Thanks @filipecabaco. If I understood this correctly, the default cluster strategy is DNS, but I can set CLUSTER_STRATEGIES: "POSTGRES" to change this? So far this is not working.

We're deploying on linux servers in a company-owned private cloud environment, using either Docker or Kubernetes.

Attaching section of logs from one of the kubernetes pods:

18:23:35.074 [debug] QUERY OK db=42.6ms
grant all on table public.test_tenant to authenticated; []
18:23:35.160 [debug] QUERY OK db=43.0ms
create publication supabase_realtime for table public.test_tenant []
18:23:35.205 [debug] QUERY OK db=45.5ms
commit []
18:23:37.290 [notice]     :alarm_handler: {:set, {:system_memory_high_watermark, []}}
18:23:37.375 [info] Elixir.Realtime.SignalHandler is being initialized...
18:23:37.376 [notice] SYN[[email protected]] Adding node to scope <Elixir.Realtime.Tenants.Connect>
18:23:37.377 [notice] SYN[[email protected]] Creating tables for scope <Elixir.Realtime.Tenants.Connect>
18:23:37.377 [notice] SYN[[email protected]|registry<Elixir.Realtime.Tenants.Connect>] Discovering the cluster
18:23:37.377 [notice] SYN[[email protected]|pg<Elixir.Realtime.Tenants.Connect>] Discovering the cluster
18:23:37.377 [notice] SYN[[email protected]] Adding node to scope <users>
18:23:37.377 [notice] SYN[[email protected]] Creating tables for scope <users>
18:23:37.377 [notice] SYN[[email protected]|registry<users>] Discovering the cluster
18:23:37.377 [notice] SYN[[email protected]|pg<users>] Discovering the cluster
18:23:37.377 [notice] SYN[[email protected]] Adding node to scope <Elixir.RegionNodes>
18:23:37.377 [notice] SYN[[email protected]] Creating tables for scope <Elixir.RegionNodes>
18:23:37.377 [notice] SYN[[email protected]|registry<Elixir.RegionNodes>] Discovering the cluster
18:23:37.378 [notice] SYN[[email protected]|pg<Elixir.RegionNodes>] Discovering the cluster
18:23:37.378 [warning] Replica region not found, defaulting to Realtime.Repo
18:23:37.384 [info] Running RealtimeWeb.Endpoint with cowboy 2.10.0 at :::4000 (http)
18:23:37.384 [info] Access RealtimeWeb.Endpoint at http://realtime.fly.dev
18:23:37.385 [notice] SYN[[email protected]] Adding node to scope <Elixir.PostgresCdcStream>
18:23:37.386 [notice] SYN[[email protected]] Creating tables for scope <Elixir.PostgresCdcStream>
18:23:37.386 [notice] SYN[[email protected]|registry<Elixir.PostgresCdcStream>] Discovering the cluster
18:23:37.386 [notice] SYN[[email protected]|pg<Elixir.PostgresCdcStream>] Discovering the cluster
18:23:37.387 [notice] SYN[[email protected]] Adding node to scope <Elixir.Extensions.PostgresCdcRls>
18:23:37.387 [notice] SYN[[email protected]] Creating tables for scope <Elixir.Extensions.PostgresCdcRls>
18:23:37.387 [notice] SYN[[email protected]|registry<Elixir.Extensions.PostgresCdcRls>] Discovering the cluster
18:23:37.388 [notice] SYN[[email protected]|pg<Elixir.Extensions.PostgresCdcRls>] Discovering the cluster
18:23:37.617 [info] [libcluster:postgres] Connected to Postgres database
18:23:38.180 request_id=F6JOxT985rM4oT0AAAtB [info] GET /
18:23:38.180 request_id=F6JOxT985rM4oT0AAAtB [debug] Processing with RealtimeWeb.PageLive.Index.index/2
  Parameters: %{}
  Pipelines: [:browser]
18:23:38.187 request_id=F6JOxT985rM4oT0AAAtB [info] Sent 200 in 6ms
18:23:38.374 [warning] Replica region not found, defaulting to Realtime.Repo

from realtime.

menasheh avatar menasheh commented on June 1, 2024

How does realtime get the hostname?

from realtime.

filipecabaco avatar filipecabaco commented on June 1, 2024

that might be the issue. we're using a vpc to achieve it so the ips are discoverable between all nodes which means that it works for Postgres libcluster strategy to just do a quick node() ( see here )

are you able to ping the hostnames / ip's from one container to another?

from realtime.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.