From a96410666684b32eba80d01d4b4ffb529e705b5c Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Wed, 6 Apr 2022 08:30:25 +0100 Subject: [PATCH] Ensure SeaweedFS uses the Nebula IP --- Dockerfile | 4 +++- seaweedfs-start.sh | 15 ++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 709b557..0933260 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,9 @@ RUN go install github.com/chrislusf/seaweedfs/weed@latest FROM alpine:3.15 # Install some required tools -RUN apk add fuse +RUN apk add fuse go jq +# RUN go install github.com/square/certstrap@latest +# ENV PATH=$PATH:/root/go/bin RUN mkdir /app WORKDIR /app diff --git a/seaweedfs-start.sh b/seaweedfs-start.sh index cddba88..ef033fa 100755 --- a/seaweedfs-start.sh +++ b/seaweedfs-start.sh @@ -2,17 +2,18 @@ BIN_DIR=/app SEAWEEDFS_MASTERS=10.10.100.1:9333 # Need an odd number #,10.10.100.21:9333 +NODE_IP=$(/app/nebula-cert print -path /etc/nebula/host.crt -json | jq -r '.details.ips[0] | split("/")[0]') if test "${LIGHTHOUSE}" == "true"; then - ${BIN_DIR}/weed master -mdir=/storage/raw -peers=${SEAWEEDFS_MASTERS} & + ${BIN_DIR}/weed master -mdir=/storage/raw -peers=${SEAWEEDFS_MASTERS} -ip="${NODE_IP}" & else - ${BIN_DIR}/weed volume -dir=/storage/raw -mserver=${SEAWEEDFS_MASTERS} & - ${BIN_DIR}/weed filer -master=${SEAWEEDFS_MASTERS} -encryptVolumeData & - ${BIN_DIR}/weed filer.remote.sync -dir=/test/ & + ${BIN_DIR}/weed volume -dir=/storage/raw -mserver=${SEAWEEDFS_MASTERS} -ip="${NODE_IP}" & + ${BIN_DIR}/weed filer -master=${SEAWEEDFS_MASTERS} -ip="${NODE_IP}" -encryptVolumeData & + # ${BIN_DIR}/weed filer.remote.sync -dir=/test/ & - ${BIN_DIR}/weed mount -dir=/data -dirAutoCreate - ${BIN_DIR}/weed mount -dir=/test -dirAutoCreate -filer.path=/test/ - ${BIN_DIR}/weed mount -dir=/blah -dirAutoCreate -filer.path=/root/ + ${BIN_DIR}/weed mount -dir=/data -dirAutoCreate & + ${BIN_DIR}/weed mount -dir=/test -dirAutoCreate -filer.path=/test/ & + ${BIN_DIR}/weed mount -dir=/blah -dirAutoCreate -filer.path=/root/ & fi wait