Redis installation and simple example < first >

Source: Internet
Author: User
Tags redis server

One, the installation of Redis

Redis is as follows: Https://github.com/dmajkic/redis/downloads

After decompression, according to the actual situation of their own machine choose 32 or 64 bits. Download the following image:

  

    1. Redis-server.exe Daemon Boot program for Redis server
    2. redis.conf Redis configuration file
    3. Redis-cli.exe Redis Command-line Operations tool. Of course, you can also use Telnet to manipulate it based on its plain text protocol.
    4. Redis-check-dump.exe Local Database Check
    5. Redis-check-aof.exe Update Log Check
    6. Redis-benchmark.exe performance test to simulate the simultaneous sending of M-Sets/gets queries by n clients (similar to the Apache AB tool)

The Redis-server.exe in is its service-side program. Double-click it to run.

  

If you want to set up this service as a Windows system service, download the Redis Service installation software (https://github.com/rgl/redis/downloads) and install it.

Installation is complete in the service ( right-click My Computer-management-services and applications-services ) to find this service, set it to automatically delay startup.

  

Under the Redis folder, locate the Redis-cli.exe file, which is the Redis client program.

  Open input: Set name Jerry

That is, the data is inserted in Redis with a key of Name,value as Jerry.

  Continue input: Get name

Get the value of the data saved by Jerry.

  

Use: Keys * To find out how many data Redis has saved

  

Ii. using Redis in ASP.

1. First use NuGet to install a C # Redis client for the Redis NoSQL DB.

  

Actually is Servicestack.redis, this is the website recommended C # client.

Here's a look at the simplest example:

Public ActionResult Index () {    Redisclientmanagerconfig redisconfig = new Redisclientmanagerconfig ();    Redisconfig.autostart = true;    Redisconfig.maxreadpoolsize =;    Redisconfig.maxwritepoolsize =;    Pooledredisclientmanager PRCM = new Pooledredisclientmanager (new list<string> () {"127.0.0.1"}, New list< String> () {"127.0.0.1"}, Redisconfig);    using (iredisclient rclient = prcm. Getclient ())    {        rclient.add ("P", "Shake Sacred Ox");    using (iredisclient rclient = prcm. Getclient ())    {        Response.Write (rclient.get<string> ("P"));    }    Return Content ("");}

For more information on Redis operations, it is recommended to watch the red pill "Redis combat" and this nice URL: http://redis.readthedocs.org/en/latest/.

Redis installation and simple example < first >

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.