Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Redis Test Environment Scripts

MIT License Redis

One-click scripts for setting up various Redis environments locally. Supports standalone, master-slave, Sentinel, and 3-master-3-slave cluster modes. Perfect for development, testing, and learning.


📂 Directory Structure

.
├── 3master3slave/   # Scripts & configs for 3-master 3-slave Redis Cluster
├── master-slave/    # Scripts & configs for master-slave Redis
├── sentinel/        # Scripts & configs for Redis Sentinel HA cluster
├── standalone/      # Scripts & configs for standalone Redis

🧩 Supported Redis Architectures

1. Standalone Mode (standalone)

  • One-click start/stop/status for a single Redis instance
  • Best for basic development and testing

2. Master-Slave Mode (master-slave)

  • One master, two slaves; supports one-click start, stop, status, log management, and data cleanup
  • Default ports: master 6379, slaves 6380/6381 (configurable)
  • See master-slave/README.md for details

3. Sentinel High Availability (sentinel)

  • One master, two slaves, three sentinels; one-click start/stop
  • Default ports: Redis 6379/6380/6381, Sentinel 26379/26380/26381
  • For high availability testing

4. 3-Master 3-Slave Cluster (3master3slave)

  • 3-master 3-slave Redis Cluster; supports one-click create, start, stop, status, and cleanup
  • Default ports: masters 7001/7002/7003, slaves 7004/7005/7006
  • See 3master3slave/README.md for details

⚡ Quick Start

Example: 3-master 3-slave cluster

# 1. Enter the directory
cd 3master3slave

# 2. Create the cluster
./redis_cluster_manager.sh create

# 3. Check status
./redis_cluster_manager.sh status

# 4. Stop the cluster
./redis_cluster_manager.sh stop

# 5. Clean up data
./redis_cluster_manager.sh cleanup

For other modes, enter the corresponding directory and refer to its README.md or script help.


🛠️ Requirements

  • OS: Linux or macOS
  • Redis 6.0+
  • Bash 4.0+
  • Recommended: lsof, netstat, and other common tools

❓ FAQ

  • Port already in use: Free the port or change the config file
  • Redis not installed: Please install Redis first
  • Permission denied: Make scripts executable with chmod +x *.sh

⚠️ Notes

  • For development/testing only. Do NOT use in production
  • Cleanup will delete all data—use with caution
  • To customize ports, directories, etc., edit the relevant .conf files

🤝 Contributing

Pull requests and issues are welcome!


📄 License

MIT License


For detailed instructions, parameter configuration, and architecture principles, see the README.md or comments in each subdirectory.


About

One-click setup of various Redis testing environments, supporting single-node, master-slave, Sentinel, three-master three-slave clusters, and other architectures, suitable for development, testing, learning, and other scenarios.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages