Setting up Redis under Windows

Source: Internet
Author: User

When the site loads a large amount of data from the database, it will encounter a particularly slow page response, in order to be able to get data from the database to load into memory, you can consider using Memcached To do the data cache, or use the memory database (such as Redis The contents of the database are loaded into memory and stored as key-value pairs, which can be obtained directly from the in-memory database when the page requests data, thus improving the response speed of the website.

RedisIn the official documentation, declare the recommendationLinuxenvironment, but in practice there are many developers who need toWindowsenvironment to solve these similar problems and want to takeRedisSolutions to solve the problem, Microsoft has opened up this technology,Githubwas released onWindowsunder the EnvironmentRedisversion, making theWindowsunder DeploymentRedisbecome possible. This article mainly describes theWindowsHow to build the environmentRedisas well as the problems and solutions that may be encountered during the construction process.

Construction process:

  1. get Windows environment Redis Source (the current highest version is redis-3.0 , The stable version is redis-2.8 This version only supports bit, if 32 bit system, which can be found under this site redis-2.4
  2. Then open \msvs\redisserver.slnwith Visual Studio ,F6 to compile.

[ note ] you may encounter the following issues during the compilation process:

The problem is that after the project is imported into VS2012 or later to import the project solution, the project's platform toolset defaults to v120, and that version of VS does not support , the solution to the problem is to examine the platform toolset for each project (project right-> Properties-> Configuration Properties-> General- > Platform toolset), modified to v110.

After the compilation is successful, the originalbinThere will be one more in the directory .Releasefolder, with two compressed packages below,Releasebin.zipand theReleasebin64.zip, respectively, corresponding +bits and -bits of the system, creating a directory asRedisinstallation directory, such asC:\Redis, move the extracted files to the folder below, and set the configuration file\msvs\rediswainst\samples\ redis.confCopy to the folder below and the installation is complete.

3. Under console switch to C:\Redis\bin directory, type command redis-cli, you may receive the following error:

The reason is that the Redis-serveris not started, so the client cannot connect to the redis server.

Type exit, and then type the following command to start Redis-server according to the configuration file :

Redis-server redis.conf

The server starts successfully, re-opens a console and then type redis-cliagainto successfully connect to the redis server.

On the server side you can see that there is a client connected.

On the client side, type the following command:

Ping

The client returns a "PONG" indicating that the test was successful.

Resources:

[1] Redis start:http://www.cnblogs.com/shanyou/archive/2012/01/28/2330451.html;

[2] beginner Redis:http://blog.csdn.net/qtyl1988/article/details/39553339, here are four blog posts about how to a scenario in which data from a Mysql database is stored in Redis ;

[3] running on Windows as a service Msopentech/redis: http://www.cnblogs.com/shanyou/archive/2013/01/ 17/redis-on-windows.html;

[4] How does I run Redis on Windows? :http://stackoverflow.com/questions/6476945/how-do-i-run-redis-on-windows/24046565#24046565.

Setting up Redis under Windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.