802 B · text History cff00cb
#!/bin/sh

# Long-name distribution so libcluster can reach this node from peers,
# and Phoenix.PubSub (live charts, the landing grid) spans every replica.
#
# POD_IP is injected by the deployment from status.podIP. RELEASE_COOKIE
# comes from the elixir-args secret so every replica agrees on the
# Erlang cookie.
#
# Only enable name-distribution when POD_IP is actually populated —
# otherwise RELEASE_NODE becomes "final_track@" and the BEAM aborts
# before Logger attaches, producing only a generic init crash.
if [ -n "${POD_IP}" ]; then
  echo "[env.sh] starting with name distribution as final_track@${POD_IP}" >&2
  export RELEASE_DISTRIBUTION=name
  export RELEASE_NODE="final_track@${POD_IP}"
else
  echo "[env.sh] POD_IP is empty — falling back to local-only sname distribution" >&2
fi