File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818# # RELEASE_DISTRIBUTION must be "sname" (local), "name" (distributed) or "none".
1919# export RELEASE_DISTRIBUTION=name
2020# export RELEASE_NODE=<%= @release.name %>
21+
22+ # Set node name for clustering based on ECS metadata
23+ # https://dmblake.com/elixir-clustering-with-libcluster-and-aws-ecs-fargate-in-cdk
24+ # https://docs.aws.amazon.com/AmazonECS/latest/userguide/task-metadata-endpoint-v4-fargate.html
25+ if [ ! -z " $ECS_CONTAINER_METADATA_URI_V4 " ]; then
26+ export RELEASE_DISTRIBUTION=name
27+ # HOSTNAME=$(curl -s ${ECS_CONTAINER_METADATA_URI_V4}/task | jq -r '.Containers[0].Networks[0].IPv4Addresses[0]')
28+ HOSTNAME=$( wget -q ${ECS_CONTAINER_METADATA_URI_V4} /task -O -| jq -r ' .Containers[0].Networks[0].IPv4Addresses[0]' )
29+ export RELEASE_NODE=" ${RELEASE_NAME} @${HOSTNAME} "
30+ fi
31+
32+ # export DISTRIBUTION_PORT=7777
You can’t perform that action at this time.
0 commit comments