Use only one IP address that matches the hostname

This commit is contained in:
Johannes M. Scheuermann 2021-03-14 19:46:12 +00:00
parent 79fed2cd7c
commit 5259721a58
2 changed files with 4 additions and 7 deletions

View File

@ -23,21 +23,18 @@
source /var/fdb/scripts/create_cluster_file.bash
function create_server_environment() {
fdb_dir=/var/fdb
env_file=$fdb_dir/.fdbenv
: > $env_file
env_file=/var/fdb/.fdbenv
if [[ "$FDB_NETWORKING_MODE" == "host" ]]; then
public_ip=127.0.0.1
elif [[ "$FDB_NETWORKING_MODE" == "container" ]]; then
public_ip=$(grep `hostname` /etc/hosts | sed -e "s/\s *`hostname`.*//")
public_ip=$(hostname -i | awk '{print $1}')
else
echo "Unknown FDB Networking mode \"$FDB_NETWORKING_MODE\"" 1>&2
exit 1
fi
echo "export PUBLIC_IP=$public_ip" >> $env_file
echo "export PUBLIC_IP=$public_ip" > $env_file
if [[ -z $FDB_COORDINATOR && -z "$FDB_CLUSTER_FILE_CONTENTS" ]]; then
FDB_CLUSTER_FILE_CONTENTS="docker:docker@$public_ip:$FDB_PORT"
fi

View File

@ -26,4 +26,4 @@ source /var/fdb/.fdbenv
echo "Starting FDB server on $PUBLIC_IP:$FDB_PORT"
fdbserver --listen_address 0.0.0.0:$FDB_PORT --public_address $PUBLIC_IP:$FDB_PORT \
--datadir /var/fdb/data --logdir /var/fdb/logs \
--locality_zoneid=`hostname` --locality_machineid=`hostname` --class $FDB_PROCESS_CLASS
--locality_zoneid="$(hostname)" --locality_machineid="$(hostname)" --class $FDB_PROCESS_CLASS