key expires true if it does not expire false
Mset (Redis version 1.1 or above only available)
Assign values to multiple keys at the same time
$redis->mset (Array (' key0 ' = ' value0 ', ' key1 ' = ' value1 '));
Multi, exec, discard
Enter or exit Transaction mode
Parameter optional Redis::multi or
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-> setex ('key', 3600, 'value'); // sets key → value, with 1 h TTL.Setnx determines whether the data is repeated and the written value$ Redis-> setnx ('key', 'value ');$ Redis-> setnx ('key', 'value ');Delete deletes the value of a specified key.Returns the number of deleted keys (long integer)$ Redis-> delete (
is repeated and the written Value$ Redis-> setnx ('key', 'value ');$ Redis-> setnx ('key', 'value ');
Delete deletes the value of a specified key.Returns the number of deleted keys (long integer)$ Redis-> Delete ('key1', 'key2 ');$ Redis-> Delete (Array ('key3', 'key4', 'key5 '));
TTLGet the survival time of a key
Per
it finds that the current memory usage is already greater than or equal to MaxMemory, the expired portion of the cache is gone until memory usage is less than maxmemory. It is clear that this cache-free memory operation will affect the Redis Rt. During the peak of the message, the memory usage of the Redis instance has been maxmemory the additional wandering, resulting in the
subscriptions implement mail systems, senders (referred to as publishers in Redis terminology), and receivers (users) receive them. The link sent by this message is called a channel.The Redis client can subscribe to any number of channels.ExampleThe following example shows how to publish a user's conceptual work. In the following example, a client subscription is given a channel named RedischatRedis 127.0.
, write value$redis->setnx (' key ', ' value ');$redis->setnx (' key ', ' value ');Delete Deletes the value of the specified keyReturns the number of keys that have been deleted (long integers)$redis->delete (' Key1 ', ' key2 ');$redis->delete (Array (' Key3 ', ' key4 ', ' key5 '));TtlGet a key to the time of survivalP
the value of the specified keyReturns the number of keys that have been deleted (long integers)$redis->delete (' Key1 ', ' key2 ');$redis->delete (Array (' Key3 ', ' key4 ', ' key5 '));TtlGet a key to the time of survivalPersistRemove key for lifetime expirationIf the key expires true if it does not expire falseMset (Redis version 1.1 or above only available)Ass
the value of the specified keyReturns the number of keys that have been deleted (long integers)$redis->delete (' Key1 ', ' key2 ');$redis->delete (Array (' Key3 ', ' key4 ', ' key5 '));TtlGet a key to the time of survivalPersistRemove key for lifetime expirationIf the key expires true if it does not expire falseMset (Redis version 1.1 or above only available)Ass
', ' value ');Delete Deletes the value of the specified keyReturns the number of keys that have been deleted (long integers)$redis->delete (' Key1 ', ' key2 ');$redis->delete (Array (' Key3 ', ' key4 ', ' key5 '));TtlGet a key to the time of survivalPersistRemove key for lifetime expirationIf the key expires true if it does not expire falseMset (Redis version 1.
Requirepass beijing
3. enable authentication in redis. conf.
Method 1: Auth beijing
Method 2:./redis-cli-a beijing
4. add the following configuration in the redis. conf configuration file to bind redis to a single interface (but not only accept the data of this NIC ).
Bind 127.0.0.1)
5. SSL proxy
6. disable the specif
timePersistRemove key that expires in lifetimeIf the key expires true if it does not expire falseMset (more than 1.1 Redis version can be used)Assigning multiple keys at the same time$redis-gt;mset (Array (' key0′=gt; ' value0′, ' key1′=gt; ' value1′));Multi, exec, discardEnter or exit Transaction modeParameter optional Redi
Detailed description of Transaction Management in Spring (focusing on Transaction Manager) and spring transactionDetailed description of Transaction Management in Spring: Transaction Introduction
Transaction Management is an essential technology in enterprise application dev
Redis basic 4-redis service, redis basic 4-redis
Redis configuration file
The main problem was that redis. pid was not found.
Below is my configuration file
# By default Redis does not
; setex ('key', 3600, 'value'); // sets key → value, with 1 h TTL.Setnx determines whether the data is repeated and the written value$ Redis-> setnx ('key', 'value ');$ Redis-> setnx ('key', 'value ');Delete deletes the value of a specified key.Returns the number of deleted keys (long integer)$ Redis-> delete ('key1', 'key2 ');$
duplicate, write value$redis->setnx (' key ', ' value ');$redis->setnx (' key ', ' value '); Delete Deletes the value of the specified keyReturns the number of keys that have been deleted (long integers)$redis->delete (' Key1 ', ' key2 ');$redis->delete (Array (' Key3 ', ' key4 ', ' key5 ')); TtlGet a key to the time
Deletes the value of the specified keyReturns the number of keys that have been deleted (long integers)$redis->delete (' Key1 ', ' key2 ');$redis->delete (Array (' Key3 ', ' key4 ', ' key5 ')); TtlGet a key to the time of survival PersistRemove key for lifetime expirationIf the key expires true if it does not expire false Mset (Redis version 1.1 or above only av
'); Delete Deletes the value of the specified keyReturns the number of keys that have been deleted (long integers)$redis->delete (' Key1 ', ' key2 ');$redis->delete (Array (' Key3 ', ' key4 ', ' key5 ')); TtlGet a key to the time of survival PersistRemove key for lifetime expirationIf the key expires true if it does not expire false Mset (Redis version 1.1 o
1h TTL.Setnx determine if duplicate, write value$redis->setnx (' key ', ' value ');$redis->setnx (' key ', ' value ');Delete Deletes the value of the specified keyReturns the number of keys that have been deleted (long integers)$redis->delete (' Key1 ', ' key2 ');$redis->delete (Array (' Key3 ', ' key4 ', ' key5 '));T
;delete (Array (' Key3 ', ' key4 ', ' key5 '));TtlGet a key to the time of survivalPersistRemove key for lifetime expirationIf the key expires true if it does not expire falseMset (Redis version 1.1 or above only available)Assign values to multiple keys at the same time$redis->mset (Array (' key0 ' = ' value0 ', ' key1 ' = ' value1 '));Multi, exec, discardEnter or exit
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.