A simple, user-friendly CLI tool that sets up GlusterFS clusters using Docker. Just run it on any machine and it will help you create or join a distributed file system.
- Simple Setup: One command to set up a GlusterFS node
- Interactive: Prompts for local folder and peer IPs
- Docker-based: No complex installation, just needs Docker
- Cross-platform: Works on any system with Docker
- User-friendly: Clear prompts and status messages
# Download the latest release
curl -L https://github.com/your-repo/gluster-sync-cli/releases/latest/download/gluster-sync -o gluster-sync
chmod +x gluster-syncgit clone https://github.com/your-repo/gluster-sync-cli
cd gluster-sync-cli
go build -o gluster-sync main.go./gluster-sync setupThe CLI will ask you:
- Local folder path - Which folder to sync (e.g.,
/home/user/shared) - Peer IPs - Leave empty for the first node, OR enter ALL planned node IPs
On other machines:
./gluster-sync setupThe CLI will ask you:
- Local folder path - Same or different folder to sync
- Peer IPs - Enter ALL node IPs (including the first node and this node)
💡 Pro Tip: You can enter all IPs at once using comma-separated format:
192.168.1.10,192.168.1.20,192.168.1.30
./gluster-sync status| Command | Description |
|---|---|
setup |
Interactive setup of a GlusterFS node |
status |
Show cluster and container status |
remove |
Stop and remove the GlusterFS container |
--help |
Show help information |
- Creates a Docker container running GlusterFS on each machine
- Mounts your local folder into the container
- Connects nodes using GlusterFS peer probing
- Automatically replicates files between all nodes
- Files added to the local folder appear on all other nodes
# Machine 1 (192.168.1.10)
./gluster-sync setup
# Enter local folder: /home/user/documents
# Enter peer IPs: (leave empty - first node)
# Machine 2 (192.168.1.20)
./gluster-sync setup
# Enter local folder: /home/user/shared
# Enter peer IPs: 192.168.1.10
# Machine 3 (192.168.1.30)
./gluster-sync setup
# Enter local folder: /opt/shared-data
# Enter peer IPs: 192.168.1.10
# Now all three folders are synced!# On ALL machines, use the same IP list:
./gluster-sync setup
# Enter local folder: [respective folder]
# All peer IPs: 192.168.1.10,192.168.1.20,192.168.1.30
# Benefits:
# ✅ Every node knows about every other node
# ✅ Better fault tolerance
# ✅ Perfect mesh topology- Docker installed and running
- Network connectivity between machines
- Ports 24007 and 49152 open for GlusterFS communication
Q: What happens if a node goes down?
A: Other nodes continue working. When the node comes back up, files sync automatically.
Q: Can I use different local folders on each machine?
A: Yes! Each machine can have a different local path.
Q: How do I add a new machine to an existing cluster?
A: Just run ./gluster-sync setup and enter any existing node's IP.
Q: How do I remove a node from the cluster?
A: Run ./gluster-sync remove on that machine.
Container won't start:
# Check Docker is running
docker ps
# Check if port is available
netstat -tulpn | grep 24007Can't connect to peers:
# Check network connectivity
ping <peer-ip>
# Check firewall allows ports 24007 and 49152Files not syncing:
# Check cluster status
./gluster-sync status
# Check container logs
docker logs glusterfs-node┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Machine 1 │ │ Machine 2 │ │ Machine 3 │
│ │ │ │ │ │
│ /home/docs/ ────┼────┼─── /opt/data/ ──┼────┼─── /tmp/sync/ │
│ │ │ │ │ │
│ [GlusterFS] │ │ [GlusterFS] │ │ [GlusterFS] │
│ │ │ │ │ │
└─────────────────┘ └─────────────────┘ └─────────────────┘
↑ ↑ ↑
Docker Container Docker Container Docker Container
Files added to any folder automatically appear in all other folders across all machines.
MIT License - feel free to use this in your projects!