Sismember: Whether it contains
Smembers: Get member
Smove: Moving Members
SPop: removing members
Srandmember: Get random Members
Srem: Delete
f) Sorted set
Zadd: Add one or more
Zcard: Number of Members
Zincrby: Incrementing member score
Zrange: Returns a member within an index range
Zrangebyscore: Returns members within the score range
Zscore: Get member Score
Zrem: Remove one or more members
For more information, please refer
communication.It's dangerous for everyone to connect to a Redis server, and we need to set a password for Redis on 103.How to set it up, you need to edit the Redis configuration file/etc/redis/6379.conf[Plain]View Plaincopy
[Email protected] utils]# vim/etc/redis/6
Match N count 20//Match the key starting with N, fetch 20, start with scan 0 for the first timeThe second time from the beginning of the cursor to fetch a key starting with n , equivalent to a page to fetch, when the last return 0 , the key is taken out Note: Progressive traversal can effectively resolve blocking problems that the keys command can causeIn addition to the scan string: There are also the followingThe SCAN command iterates over the dat
Redis series (1) use of StackExchange. Redis, stackexchange. redis1. DLL Installation
Search for StackExchange. Redis with NuGet and download it.
The ConnectionMultiplexer object is the most central object of StackExchange. Redis. Instances of this class need to be shared an
Redis server default link port is 6379, and it is a good idea to bind IP to a native IP as well.Distributed Cache Technology Redis Learning Series (i) Introduction to--redis and installation on LinuxArticle Home Directory
About Redis
Installing
(Append Only File也保存在此)dir /var/lib/redis/指定快照存放的场所
5.1.2 Creating a snapshot manuallyTo execute the Save or bgsave command at the command line
12
127.0.0.1:6379> SAVEOK
5.2Log Backups (Append only File)Similar to the MySQL Binlog, the operation is recorded in log. When snapshots do not reach the required precision, they are used in conjunction with snapshots and are not recommended for use alone. The default
Redis Research (10)-Redis transactions and survival time, redis transactions
I. Transaction Overview
Redis transactions are a collection of commands. A transaction is the smallest Execution Unit of Redis like a command, either exe
Redis Series 1-use Redis (download and install) in C ),
This article only describes the resources required to use Redis in Windows + C,Example of using Redis in C #The overall process is divided into three steps and implemented one by one in the order of titles.1. download a
), if there is no member element, return "nil" zrevrank (key, member) : Returns the rank (index, starting from 0) of the member element in the Zset with the name key (the element has been sorted by score from large to small), and if there is no member element, return "nil" zrange (key, start, end) : Returns all elements of the index from start to end (key, start, and end) of the Zset with the name key (the element has been sorted by score from small to large) Zrevrange : Returns the index of all
secondAppendfsync everysec #更新日志条件, default is EverysecNo-appendfsync-on-rewrite NoSlowlog-log-slower-than 10000 #设置redis Slow log time, which only includes command execution time, not including IO operation time, such as client connection, response time, etc. The unit is m
key form of the Redis K-V data structure. The key in Redis is binary security, which means that any binary sequence can be a key, such as the string "foo", the contents of a picture, and so on. Even empty strings are available.
a good key naming convention is as follows:
1.key not too long. The maximum capacity in Redis is 512M, but the actual key over 1024byte
Recent work requires Redis cache, because it is also the first time to find a lot of information on the Internet, in this record. Installing RedisThe system I am using is CentOS 6.6 and the installation steps are as follows:1. Download the source code, unzip and compile the source code. (If there is no wget command first download yum install wget from yum)$ wget http://download.redis.io/releases/
Through the introduction of two articles, our Redis server basically ran. DB has the most basic crud capabilities, and we're going to start learning the Redis rich data structure journey along this thread, starting with the simplest and most common string, of course.
1, new
A) Set
Syntax: Set key value
Explanation: Assign value to key, add if key does not exist, otherwise, update
[root@xsf001 ~]#
value $redis->append (' Key ', ' world '); #修改string类型值echo $redis->get (' key '); #获取redis the value of key, and the output shows echo $redis->type (' key '); #获取key data type echo $redis->echo (' would close ... '); # output string $r
the need to modify the redis.conf file, daemonize no---->daemonize yes. The Redis server default link port is 6379, and it is a good idea to bind IP to a native IP as well.Verify that startup is successful[Email protected] ~]# Ps-ef | grep Redis#或者[Email protected] ~]# NETSTAT-TUNPL | grep 6379Client Connections[Email protected] ~]#/usr/local/redis/bin/
integer to the value of field in the hash named key
Hexists (Key, field): A field with the key field in the hash named key
Hdel (Key, field): Delete The field with the key field in the hash named key
Hlen (Key): Returns the number of elements in a hash with the name key
Hkeys (Key): Returns all keys in a hash with the name key
Hvals (Key): Returns the value corresponding to all keys in a hash with the name key
Hgetall (Key): Returns all keys (field) and their corresponding value in
the same) Redis-benchmark:redis performance testing tools to test the read and write performance of Redis in your system and configuration, after installation of the directory/usr/local/bin/ Redis-benchmark (different operating system directories may not be the same) second, run Redis boot
server sucessfullystored string in Redis:: redisstored string I N Redis:: mongodbstored string in Redis:: MysqlKey instances for Redis and Javaimportredis.clients.jedis.jedis;publicclassrediskeyjava{public Staticvoidmain (String[]args) {//connectingto redisserveronlocalhostjedisjedis= newjedis ("localhost"); system.ou
Zset with the name key (the element has been sorted score from small to large), and returns "nil" Zrevrank (key, member) if there is no member element : Returns the rank of the member element (that is, index, starting from 0) of the Zset with the name key (the element has been sorted by score from large to small), and returns "nil" Zrange (key, start, end) If there is no member element : Returns all elements of index from start to end (key, start, end) in Zset with the name key (the element has
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.