1. Hardware requirements: one Windows computer, system win7 or above
2. Software components:
- redis installation package
- Ruby language runtime environment
- Redis' Ruby driver redis-xxxx.gem;
- A tool for creating a Redis cluster redis-trib.rb
3. Download and install Redis
- Its GitHub path is as follows: https://github.com/MSOpenTech/redis/releases/
- Redis provides download files in msi and zip formats, choose any one to download to the local, and then install it to the local directory:
4. Create a new redis.conf configuration file: must add protected-mode no
5. Create a new log file for redis to store logs
5. Prepare to install the service, start redis, uninstall the service, and close the bat configuration file of redis
6. Start the redis service and enable remote access
-
Change bind 127.0.0.1 in redis6380.windows.conf, redis6381.windows.conf, redis6382.windows.conf to #bind 127.0.0.1
-
protected-mode no
-
Execute s-install.bat to install the service
-
Execute start.bat to start three redis services
7. Install ruby locale
8. Ruby driver for Redis
- Copy the file to the Ruby22-x64 directory and install the driver with the following command:
gem install--local path_to_gem/filename.gem
9. Install the cluster configuration tool redis-trib.rb
- Download the ruby script file redis-trib.rb officially provided by Redis to create a Redis cluster, the path is as follows: https://raw.githubusercontent.com/MSOpenTech/redis/3.0/src/redis-trib.rb
If you open the link without downloading, but open a page, save the page as redis-trib.rb, and it is recommended to save it to the Redis directory.
10. Redis cluster creation
-
Switch to the ruby directory under CMD and use redis-trib.rb to create a Redis cluster:
-
redis-trib.rbcreate --replicas 0 127.0.0.1:6380 127.0.0.1:6381 127.0.0.1:6382
- When prompted, you need to manually enter yes. After entering, when the following content appears, the Redis cluster has been created
11. Verify that the redis cluster is successfully created
- Enter the following command: redis-trib.rbcheck 127.0.0.1:6380, the following information appears, indicating that the created Redis cluster is OK
12. Using redis client
- Enter the redis installation directory: Execute the following command: redis-cli.exe -c -p 6380 -c means cluster, -p means port port number
- You can see the total number of dbsize records in redis. Enter clusterinfo to view the cluster information from the client:
13. Test whether the cluster is available in eclipse
14. Analysis of installation problems