Multicast instead of .hosts.erlang
This commit is contained in:
parent
bd49a76dc3
commit
3b8d0c4458
@ -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"
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
]
|
||||
]
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user