diff --git a/README.md b/README.md index 12f7403..a639875 100644 --- a/README.md +++ b/README.md @@ -45,14 +45,14 @@ The installer will: ## Nullpoint Cluster -Create or join a distributed storage cluster with Nebula mesh networking and GlusterFS. Start with a single node and scale up by adding more servers. +Create or join a distributed storage cluster with [Nebula](https://github.com/slackhq/nebula) mesh networking and [GlusterFS](https://www.gluster.org/). Start with a single node and scale up by adding more servers. ```bash wget -qO- https://git.dominik-roth.eu/dodox/nullpoint/raw/branch/master/cluster-setup.sh | sudo bash ``` - **Storage mounted at**: `/data/storage/` - all data replicated to all nodes -- **Nebula mesh network** - encrypted overlay with certificate-based trust -- **DNS-based discovery** - use your existing HA setup (HAProxy/Keepalived) -- **All nodes are lighthouses** - full redundancy, no single point of failure -- **Simple secret sharing** - just `domain:port:ca_cert` to join +- **Encrypted mesh network** - certificate-based trust with Nebula overlay +- **Flexible lighthouse setup** - use DNS names or direct IPs +- **All nodes are lighthouses** - full redundancy by default +- **Simple secret sharing** - just share lighthouse endpoints and CA cert to join diff --git a/cluster-setup.sh b/cluster-setup.sh index 200f5d1..55c9135 100755 --- a/cluster-setup.sh +++ b/cluster-setup.sh @@ -132,10 +132,13 @@ create_cluster() { local hostname=$(hostname) local node_ip="192.168.100.1" - # Ask for lighthouse domain - read -p "Enter lighthouse domain (e.g., cluster.example.com): " lighthouse_domain - if [ -z "$lighthouse_domain" ]; then - echo -e "${RED}Lighthouse domain required!${NC}" + # Ask for lighthouse endpoints + echo -e "${YELLOW}Enter lighthouse endpoints (DNS names or IPs).${NC}" + echo -e "${YELLOW}Recommended: Use a DNS name with redundant backing for HA.${NC}" + echo -e "${YELLOW}You can enter multiple endpoints separated by commas.${NC}" + read -p "Lighthouse endpoints (e.g., cluster.example.com or 1.2.3.4,5.6.7.8): " lighthouse_endpoints + if [ -z "$lighthouse_endpoints" ]; then + echo -e "${RED}At least one lighthouse endpoint required!${NC}" exit 1 fi @@ -165,8 +168,8 @@ lighthouse: am_lighthouse: ${am_lighthouse} serve_dns: false interval: 60 - hosts: - - "${lighthouse_domain}:${NEBULA_PORT}" + hosts:$(echo "$lighthouse_endpoints" | tr ',' '\n' | while read endpoint; do echo " + - \"${endpoint}:${NEBULA_PORT}\""; done) listen: host: 0.0.0.0 @@ -237,10 +240,10 @@ EOF echo -e "${GREEN}Cluster created successfully!${NC}" echo -e "${GREEN}════════════════════════════════════════${NC}\n" echo -e "Share this cluster secret with joining nodes:\n" - echo -e "${GREEN}${lighthouse_domain}:${NEBULA_PORT}:${ca_cert_b64}${NC}\n" + echo -e "${GREEN}${lighthouse_endpoints}:${NEBULA_PORT}:${ca_cert_b64}${NC}\n" echo -e "${YELLOW}Status:${NC}" echo " - Nebula IP: ${node_ip}" - echo " - Lighthouse domain: ${lighthouse_domain}:${NEBULA_PORT}" + echo " - Lighthouse endpoints: ${lighthouse_endpoints}:${NEBULA_PORT}" echo " - This node is lighthouse: ${am_lighthouse}" echo " - GlusterFS volume: ${GLUSTER_VOLUME}" echo " - Mount point: ${GLUSTER_MOUNT_PATH}" @@ -254,7 +257,7 @@ join_cluster() { local my_ip=$(get_next_ip) # Get cluster details - read -p "Enter cluster secret (lighthouse_domain:port:ca_cert_base64): " cluster_secret + read -p "Enter cluster secret (lighthouse_endpoints:port:ca_cert_base64): " cluster_secret if [ -z "$cluster_secret" ]; then echo -e "${RED}Cluster secret required!${NC}" @@ -262,7 +265,7 @@ join_cluster() { fi # Parse secret - lighthouse_domain=$(echo "$cluster_secret" | cut -d: -f1) + lighthouse_endpoints=$(echo "$cluster_secret" | cut -d: -f1) nebula_port=$(echo "$cluster_secret" | cut -d: -f2) ca_cert_b64=$(echo "$cluster_secret" | cut -d: -f3-) @@ -297,8 +300,8 @@ pki: lighthouse: am_lighthouse: ${am_lighthouse} interval: 60 - hosts: - - "${lighthouse_domain}:${nebula_port}" + hosts:$(echo "$lighthouse_endpoints" | tr ',' '\n' | while read endpoint; do echo " + - \"${endpoint}:${nebula_port}\""; done) listen: host: 0.0.0.0