Install and use Redis for Windows (C # cache)

Source: Internet
Author: User
Tags couchbase

I wrote two simple articles about Memcached cache some time ago. Of course, it's just how to get started. I have discovered the magic of Redis in the last two days. I have certainly seen it before. It is a small dish and I have never paid much attention to what it is, unexpectedly, it was recently discovered that it was also a cache artifact, so I came to a simple entry to learn.

Introduction to using Couchbase -- Memcached caching in Asp. Net http://www.cnblogs.com/aehyok/p/3436721.html

Using Couchbase -- Memcached cache using http://www.cnblogs.com/aehyok/p/3438838.html in Asp. Net

Use https://github.com/mythz/redis-windowsto download the file directly and decompress it later.

Decompress the package

Now I have created a redis folder on the elastic drive (of course, it is also possible to create a folder on another disk ). Copy all the files in the decompressed folder to the redis folder.

 

Service end redis-server.exe client redis-cli.exe

First, you can view the service degree.

The default port is 6379. No configuration file is configured, so the default configuration is used.

Then open the client in the corresponding folder

The input command set test "aehyok" is equivalent to adding a key value with the key as test and the value as aehyok to redis for data.

Enter get test again to retrieve "aehyok ".

Of course, you can also download the relevant version from another address. Windows 32-bit or 64-bit version https://github.com/dmajkic/redis/downloads

First, open Visual Studio to create a simple console application. I am currently using the VS2013 version.

Then, install ServiceStack. Redis, a common component of Redis, through Nuget.

After the installation is complete, corresponding references will be added to the project.

Use the code to obtain the test: aehyok key-value pair.

            RedisClient Client =  RedisClient(,  str = Client.Get<>(

Similarly, you can directly set key-value pairs through code and set the corresponding values.

 

We can use the cmd command to configure the specified configuration file step by step.

1. First open the cmd command, and then enter the drive letter where the installation file is located. You can see that I have placed the installation file on the elastic drive. [E :]

2. in step 2, enter the directory of the Installation File [cd redis]

3. Step 3 enter the following command redis-server.exe redis. conf, the front is the server executable file, followed by the specified configuration file.

4. Repeat the above three steps and modify the prot port number in redis. conf for testing. I will change it to 6666 here.

If the test is successful.

A simple example is the simplest to use in the project, from download to installation. The next article explains how to configure the redis configuration file.

I suddenly thought of how to use this as a built-in boot service for windows. I don't know if my shoes have been used. Thank you for your advice.

Bytes. I have used srvinstw for production, but it has not been successfully created on the local machine. Thank you for your advice.

 

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.