Learning Redis
上QQ阅读APP看书,第一时间看更新

Installing Redis on Windows

Microsoft Open Tech group has ported Redis and maintains it for win32/win64 machines. There are two ways in which we can get started with installing Redis on Windows, and these are listed as follows:

  • Working with prebuilt binaries
  • Getting the code and compiling it in the Microsoft environment

For the impatient, downloading the binaries of Redis 2.8 is an easier option. First things first, we need to do the following in order to get started:

  1. Go to https://github.com/MSOpenTech/redis and download the ZIP file under the Clone in Desktop button. For this book, we are going to download the latest version of Redis, that is, the redis-2.8.zip file.
  2. Right-click on the link and save it in a suitable location on your Windows machine. I have saved it at F:\sw2\redis\redis-2.8.zip.
  3. Right-click and unzip the compressed file to a suitable folder. I have named the folder as redis-2.8, and the folder structure after unzipping looks similar to what is shown in the following screenshot:

    Folder structure after unzipping the compressed file

  4. Get inside the bin folder. You will find the release folder; when you click on it, you will have a list of the files inside this folder, as shown in the following screenshot:

    Folder structure inside the bin/release folder

  5. Open Command Prompt and run redis-server.exe. Provide the redis-server.exe --maxheap 1024mb heap size and you should see a console window popping up, similar to the following screenshot. In the case of Windows 7, the user might be asked to trust the software to proceed further.

    Redis server's default startup

  6. Note the last line showing on the Command Prompt: The servers now ready to accept connections on port 6379.
  7. Now, let's start a prebuilt client, which is shipped with the distribution, and connect to the server. The client that we will execute is a command-line interpreter, and when we click on it, the client program will be launched:

    The Redis client is started with the Redis server running

  8. Your simple installation is complete (clustered setup and other management topics will be taken up in later chapters).
    Tip

    Downloading the example code

    You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.