Execute Redis command with LUA script in C #To directly post the code to implement the Lua script method, the Third-party class library used is Stackexchange.redis (nuget) Note: The following code is simplified, the actual use to modify,
Using
Redis Common Command set
1 Connection operation Command quit: Close the connection (connection) Auth: simple password Authentication help cmd: View cmd assistance, for example: helping quit
2 Persistent Save: Synchronize data to disk Bgsave:
Expiration time of keys
Typically, the Redis keys are created without setting the associated expiration time. They will always exist unless you use the displayed command to remove them, for example, by using the Del command.
Expire a class of
1. Redis Lock ClassificationRedis can be used in the lock command table is INCR, SETNX, SET
2. The first type of lock command incr
The idea is that the key does not exist, then the value of the key will be initialized to 0, and then perform the
Redis is very different in Linux and installed under Windows, and the usual software installation is the same.
Download Redis installation package
To Redis website Download Reids installation package, Redis official website defaults to provide only
One: Make compile, there is an error
Solution: Take a closer look at the error location information, it is possible that some things are not installed, put these things installed will be no problem
Two:
Warning:no config file specified, using
1. Compile and install
1.1, install the compilation tool
First you need to install a variety of required tools:
gcc
gcc-c++
[Root@myhost/]# yum install gcc gcc-c++ 1.2, starting installation
installation, first need to download from the Redis
Redis can be used not only as a caching server, but also as a message queue. Its list type is inherently supported as a message queue. As shown in the following illustration:
Because the list of Redis is implemented using a two-way link, the root
Redis Services (transaction)
This document is translated from: Http://redis.io/topics/transactions.
MULTI, EXEC, discard and WATCH are the basis of the Redis transaction.
A transaction can execute more than one command at a time with the following
Redis is a non-relational database, and unlike MongoDB, Redis is a memory database, so access is fast. Commonly used as a cache and publish-subscribe message queue. The Redis official does not provide the Windows version of the software. The Windows
Using the shell to write a quick install Redis service#!/bin/bashyum Install CPP binutils glibc-kernheaders glibc-common glibc-devel gcc make wget #安装依赖库wget http://download . redis.io/releases/redis-4.0.1.tar.gzif [-f/root/redis-4.0.1.tar.gz];then
Brief introductionRedis is a cache database, but it is useful not only for databases, but for use as message queues and caches.As with RABBITMQ, it is also based on socket communication, so be aware that the format of the data is byte.BasicUsing
SOURCE structureJeesz-Driven Project constructionBuilt-in efficient and reliable code generatorSupport a variety of data models, based on database tables to generate regular repetitive code, so that research and development engineers focus on the
Https://github.com/alroy233/PowerPMS/issues/171, open the local redise:\powerpms\powerpms\redis2.8Redis-Server redis.windows.conf2, attribute heapdir: Temporary file path maxmemory: Temp file size Save: Write to disk temp file3, Command Redis-CLI:
Make cleanThe Redis compilation failure may be:1. gcc,gcc-c++ not installedYum Install GCCYum Install gcc-c++2. Tcl not installedYum Install Tcl[email protected] src]$ make testyou need TCL 8.5 or newer on order to run the Redis testmake: ***[test]
Collection ObjectThe encoding of a collection object can be either Intset or Hashtable,intset-encoded collection objects using an integer collection as the underlying implementation, and all the elements contained in the collection object are stored
Key)Del Syntax: Del key [Key...] deleting a given key or multiple keys that do not exist will be ignored.Return Value: Number of deleted rough keys# Delete a single keyredis> Set Name huangzokredis> Del name (integer) 1 # delete a nonexistent
List Function
Lpush command/method/function descriptionadds the string value to the head (left) of the list. creates the list if the key didn't exist. if the key exists and is not a list, false is returned. add a string value to the top (left) of
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