Multicast instead of .hosts.erlang

This commit is contained in:
Elizabeth Hunt 2023-02-01 08:51:20 -07:00
parent bd49a76dc3
commit 3b8d0c4458
Signed by: simponic
GPG Key ID: 52B3774857EB24B1
4 changed files with 10 additions and 13 deletions

View File

@ -62,10 +62,6 @@ ENV LC_ALL en_US.UTF-8
WORKDIR "/app"
RUN chown nobody /app
# set OTP_ROOT so elixir can find nodes
ENV OTP_ROOT=/app
COPY .hosts.erlang /app/.hosts.erlang
# set runner ENV
ENV MIX_ENV="prod"

View File

@ -10,7 +10,6 @@ server_node_ids=(4 5 6)
build_dir="${HOME}/src/chessh/buildscripts/build"
server_name="chessh.linux.usu.edu"
erlang_hosts_file="${build_dir}/.hosts.erlang"
load_balancer_nginx_site_file="/etc/nginx/sites-enabled/${server_name}.conf"
ha_proxy_cfg_file="/etc/haproxy/haproxy.cfg"
ssl_cert_path="/etc/letsencrypt/live/${server_name}"
@ -160,15 +159,11 @@ function build_server() {
scp $ssh_opts "${build_dir}/build_server.sh" $node_conn:~/
scp $ssh_opts $erlang_hosts_file $node_conn:~/
ssh $ssh_opts $node_conn "~/build_server.sh"
}
function build_server_nodes() {
copy_ssh_keys
printf "'192.168.100.%s'\n" ${server_node_ids[@]} > $erlang_hosts_file
for node_id in "${server_node_ids[@]}"
do
build_server $node_id

View File

@ -30,7 +30,6 @@ fi
# Build
cd $chessh_path
[ -d "$chessh_path/priv/keys" ] && cp ~/keys/* "$chessh_path/priv/keys/" || cp -r ~/keys "$chessh_path/priv"
mv $HOME/.hosts.erlang .
sudo docker build . -t chessh/server
# Systemd service

View File

@ -13,8 +13,15 @@ config :chessh, RateLimits,
config :libcluster,
topologies: [
erlang_hosts_example: [
strategy: Elixir.Cluster.Strategy.ErlangHosts,
config: [timeout: 30_000]
chessh: [
strategy: Elixir.Cluster.Strategy.Gossip,
config: [
port: 45892,
if_addr: "0.0.0.0",
multicast_if: "192.168.1.1",
multicast_addr: "233.252.1.32",
multicast_ttl: 1,
secret: "chessh"
]
]
]