Mup (MongoDB Utility Platform) is a cluster management tool for MongoDB, inspired by TiDB's TiUP. It simplifies deployment, configuration, and lifecycle management of MongoDB clusters (standalone, replica sets, and sharded clusters) across distributed infrastructure.
- Playground Mode: Quick local MongoDB cluster for development and testing
- Declarative Configuration: Define cluster topology in YAML
- SSH-based Remote Management: Agentless architecture using SSH
- Version Flexibility: Support multiple MongoDB versions (3.6 through 8.0)
- Rolling Operations: Zero-downtime configuration changes and upgrades
- State Management: Centralized state tracking in YAML metadata
git clone https://github.com/zph/mup.git
cd mup
go build -o mup ./cmd/mup
sudo mv mup /usr/local/bin/Download the latest binary from the releases page.
The fastest way to get started with Mup is using the playground feature, which creates a local MongoDB cluster for development and testing.
# Start a local MongoDB 7.0 cluster
mup playground start
# Start with a specific version
mup playground start --version 8.0Output:
Starting playground cluster (MongoDB 7.0)...
✓ Playground cluster started successfully!
Connection URI: mongodb://localhost:27017
Data directory: /Users/you/.mup/playground/data
To connect: mongosh "mongodb://localhost:27017"
mup playground statusOutput:
Playground Cluster Status
========================
Name: playground
Status: running
MongoDB: 7.0
Started: 2025-01-15T10:30:00Z
Connection URI: mongodb://localhost:27017
Data directory: /Users/you/.mup/playground/data
Uptime: 2h15m30s
# Using mup playground connect (recommended - uses the correct mongo/mongosh binary)
mup playground connect
# Or manually (check cluster status for the connection URI)
mongosh "mongodb://localhost:27017" # For newer MongoDB versions
mongo "mongodb://localhost:27017" # For older MongoDB versions
# Using mongo driver in your application
mongodb://localhost:27017The mup playground connect command automatically reads the cluster info and uses the appropriate MongoDB shell binary (legacy mongo for older versions, mongosh for newer versions) with the correct connection string.
mup playground stopRemove the playground cluster and all data:
mup playground destroyThe playground feature is perfect for:
- Local Development: Test MongoDB features without affecting production
- CI/CD Pipelines: Spin up temporary databases for integration tests
- Learning: Experiment with MongoDB sharding and replica sets
- Prototyping: Quick database for proof-of-concept projects
# Start a playground cluster
make build
./bin/mup playground start --version 7.0
# Check the status
./bin/mup playground status
# Connect to the cluster
./bin/mup playground connect
# When done, stop the cluster
./bin/mup playground stop
# Or completely remove it
./bin/mup playground destroyMup will support full production cluster management with features like:
# Deploy a replica set
mup cluster deploy prod-rs 7.0.5 topology.yaml
# Scale out cluster
mup cluster scale-out prod-rs --node 192.168.1.20
# Upgrade MongoDB version
mup cluster upgrade prod-rs 8.0.0 --rolling
# Reload configuration
mup cluster reload prod-rs --rollingSee DESIGN.md for the complete architecture and roadmap.
Mup stores its state and configuration in:
~/.mup/
├── playground/
│ ├── cluster-info.json # Cluster connection details
│ └── state.json # Playground state
└── storage/
└── clusters/ # Production cluster metadata (coming soon)
Note: The actual cluster data is stored in temporary directories managed by mongo-scaffold.
Mup follows these design principles:
- Declarative Configuration: Define what you want, Mup handles how
- Idempotent Operations: Safe to re-run commands
- State Management: Central source of truth for cluster state
- Zero Downtime: Rolling operations for production changes
See DESIGN.md for detailed architecture documentation.
- Go 1.21 or later
- MongoDB binaries (automatically downloaded by mongo-scaffold)
go build -o mup ./cmd/mupgo test ./...mup/
├── cmd/
│ └── mup/ # CLI commands
├── pkg/
│ ├── playground/ # Playground cluster management
│ ├── cluster/ # Production cluster lifecycle (planned)
│ ├── config/ # Configuration management (planned)
│ ├── deploy/ # Deployment orchestration (planned)
│ └── ssh/ # SSH operations (planned)
└── DESIGN.md # Detailed design document
- Local MongoDB cluster management
- Start/stop/status/connect commands
- State persistence
- Automatic mongosh connection
- Deploy standalone MongoDB instance
- Deploy 3-node replica set
- SSH-based remote management
- Configuration templates
- Configuration reload
- Rolling operations
- Scale out/in
- Version upgrades
- Sharded cluster support
See DESIGN.md for the complete roadmap.
| Feature | Mup | mongo-orchestration | mtools |
|---|---|---|---|
| Playground | ✓ | ✓ | ✓ |
| Production Clusters | Planned | Limited | No |
| State Management | YAML | JSON API | No |
| Remote Management | SSH | No | No |
| Rolling Operations | Planned | No | No |
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Apache License 2.0 - see LICENSE for details.
- Inspired by TiUP - TiDB cluster manager
- Uses mongo-scaffold for local cluster management
- Built with Cobra CLI framework
- GitHub Issues: github.com/zph/mup/issues
- Documentation: DESIGN.md