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:
- Redis-server.exe Daemon Boot program for Redis server
- redis.conf Redis configuration file
- Redis-cli.exe Redis Command-line Operations tool. Of course, you can also use Telnet to manipulate it based on its plain text protocol.
- Redis-check-dump.exe Local Database Check
- Redis-check-aof.exe Update Log Check
- 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 >