Practice of installing Redis cluster under Windows

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

Enter image description

  • 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:

Enter image description

4. Create a new redis.conf configuration file: must add protected-mode no

Enter image description

Enter image description

Enter image description

Enter image description

5. Create a new log file for redis to store logs

Enter image description

Enter image description

5. Prepare to install the service, start redis, uninstall the service, and close the bat configuration file of redis

Enter image description

Enter image description

Enter image description

Enter image description

Enter image description

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

Enter image description

8. Ruby driver for Redis

Enter image description

  • Copy the file to the Ruby22-x64 directory and install the driver with the following command:

gem install--local path_to_gem/filename.gem

Enter image description

9. Install the cluster configuration tool 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.

Enter image description

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

Enter image description

  • When prompted, you need to manually enter yes. After entering, when the following content appears, the Redis cluster has been created

Enter image description

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

Enter image description

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

Enter image description

  • 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

Enter image description

14. Analysis of installation problems

Enter image description

Enter image description

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326397073&siteId=291194637