Redis 3.0 集群特性实验过程

本文涉及的产品
云数据库 Tair(兼容Redis),内存型 2GB
Redis 开源版,标准版 2GB
推荐场景:
搭建游戏排行榜
简介:

        Redis 3.0的集群功能很强大了, 最大的特点就是有了cluster的能力,使用redis-trib.rb工具可以轻松构建Redis Cluster。Redis Cluster采用无中心结构,每个节点保存数据和整个集群状态,每个节点都和其他所有节点连接。节点之间使用gossip协议传播信息以及发现新节点。其具体的原理请看官方文档,这里只是记录一下实验的过程。以便更好的了解集群的特性。


#安装依赖软件:

 yum install gcc rubyzlib rubygems

 wgethttps://rubygems.org/downloads/redis-3.2.2.gem

 gem installredis-3.2.2.gem

#版本:redis-3.2

#架构信息

192.168.100.41   master6379  slave7379

192.168.100.42   master6379  slave7379

192.168.100.43   master6379  slave7379

#通用配置:

more /usr/local/redis-3.2/conf/redis-common.conf

#GENERAL

daemonize yes

tcp-backlog 511

timeout 0

tcp-keepalive 0

loglevel notice

databases 16

dir /usr/local/redis-3.2/{data,data_7379}

slave-serve-stale-data yes

slave-read-only yes

#not use default

repl-disable-tcp-nodelay yes

slave-priority 100

appendonly yes

appendfsync everysec

no-appendfsync-on-rewrite yes

auto-aof-rewrite-min-size 64mb

lua-time-limit 5000

cluster-enabled yes

cluster-node-timeout 15000

cluster-migration-barrier 1

slowlog-log-slower-than 10000

slowlog-max-len 128

notify-keyspace-events ""

hash-max-ziplist-entries 512

hash-max-ziplist-value 64

list-max-ziplist-entries 512

list-max-ziplist-value 64

set-max-intset-entries 512

zset-max-ziplist-entries 128

zset-max-ziplist-value 64

activerehashing yes

client-output-buffer-limit normal 0 0 0

client-output-buffer-limit slave 256mb 64mb 60

client-output-buffer-limit pubsub 32mb 8mb 60

hz 10

aof-rewrite-incremental-fsync yes

 

 

#独立端口配置:{6379,7379}

 

more /usr/local/redis-3.2/conf/redis-{6379,7379}.conf

include/usr/local/redis-3.2/conf/redis-{common,common_7379}.conf

port {6379,7379}

logfile"/usr/local/redis-3.2/logs/redis-{6379,7379}.log"

maxmemory 100m

# volatile-lru -> remove the key with an expire set usingan LRU algorithm

# allkeys-lru -> remove any key accordingly to the LRUalgorithm

# volatile-random -> remove a random key with an expireset

# allkeys-random -> remove a random key, any key

# volatile-ttl -> remove the key with the nearest expiretime (minor TTL)

# noeviction -> don't expire at all, just return an erroron write operations

maxmemory-policy allkeys-lru

appendfilename "appendonly-{6379,7379}.aof"

dbfilename dump-{6379,7379}.rdb

cluster-config-file nodes-{6379,7379}.conf

auto-aof-rewrite-percentage 80-100

bind 192.168.100.{41,42,43}

 

#启动进程

/usr/local/redis-3.2/bin/redis-server/usr/local/redis-3.2/conf/redis-{6379,7379}.conf

#创建集群

 

/usr/local/redis-3.2/bin/redis-trib.rb create --replicas 1192.168.100.41:6379 192.168.100.42:6379 192.168.100.43:6379 192.168.100.41:7379192.168.100.42:7379

192.168.100.43:7379

 

>>> Creating cluster

>>> Performing hash slots allocation on 6 nodes...

Using 3 masters:

192.168.100.43:6379

192.168.100.42:6379

192.168.100.41:6379

Adding replica 192.168.100.42:7379 to 192.168.100.43:6379

Adding replica 192.168.100.41:7379 to 192.168.100.42:6379

Adding replica 192.168.100.42:7379 to 192.168.100.41:6379

M: c2b3c9cb4b040e4ce48c7a20b4000a1d02e674bd 192.168.100.41:6379

   slots:10923-16383(5461 slots) master

M: 35fc4a46cfe68e941a18ca33e574df86db7beefb192.168.100.42:6379

   slots:5461-10922(5462 slots) master

M: 2ef9b515fac6159b37520afce1f75b38ba1e9a87192.168.100.43:6379

   slots:0-5460 (5461slots) master

S: 6a2d10792f17985d1e30e9e20fe92c890748487f192.168.100.41:7379

   replicates35fc4a46cfe68e941a18ca33e574df86db7beefb

S: eb921729e82925c6be859185efb58e77b49e7a89192.168.100.42:7379

   replicates2ef9b515fac6159b37520afce1f75b38ba1e9a87

S: eb921729e82925c6be859185efb58e77b49e7a89192.168.100.42:7379

   replicatesc2b3c9cb4b040e4ce48c7a20b4000a1d02e674bd

Can I set the above configuration? (type 'yes' to accept):YES

>>> Nodes configuration updated

>>> Assign a different config epoch to each node

>>> Sending CLUSTER MEET messages to join thecluster

Waiting for the cluster to join.

>>> Performing Cluster Check (using node192.168.100.41:6379)

M: c2b3c9cb4b040e4ce48c7a20b4000a1d02e674bd192.168.100.41:6379

   slots:10923-16383(5461 slots) master

M: 35fc4a46cfe68e941a18ca33e574df86db7beefb192.168.100.42:6379

   slots:5461-10922(5462 slots) master

M: 2ef9b515fac6159b37520afce1f75b38ba1e9a87192.168.100.43:6379

   slots:0-5460 (5461slots) master

M: 6a2d10792f17985d1e30e9e20fe92c890748487f 192.168.100.41:7379

   slots: (0 slots)master

   replicates35fc4a46cfe68e941a18ca33e574df86db7beefb

M: eb921729e82925c6be859185efb58e77b49e7a89192.168.100.42:7379

   slots: (0 slots)master

   replicates2ef9b515fac6159b37520afce1f75b38ba1e9a87

M: eb921729e82925c6be859185efb58e77b49e7a89192.168.100.42:7379

   slots: (0 slots)master

   replicatesc2b3c9cb4b040e4ce48c7a20b4000a1d02e674bd

[OK] All nodes agree about slots configuration.

>>> Check for open slots...

>>> Check slots coverage...

[OK] All 16384 slots covered.

 

#添加节点

master:192.168.100.41:8379 slave:192.168.100.42:8379 slave:192.168.100.43:8379

创建相关配置文件和数据目录同上述配置更改端口信息即可

 

#节点准备就绪

salt '*' cmd.run ' ps aux |grep redis-server|grep -v grep'

client.wboy.com:

    root     13452 0.0  0.7  36684 7716 ?        Ssl  11:20  0:13 /usr/local/redis-3.2/bin/redis-server 192.168.100.42:7379 [cluster]           

    root     13462 0.1  0.9  38732 9756 ?        Ssl  11:20  0:21 /usr/local/redis-3.2/bin/redis-server 192.168.100.42:6379 [cluster]            

    root     16566 0.0  0.7  36684 7560 ?        Ssl  16:02  0:00 /usr/local/redis-3.2/bin/redis-server 192.168.100.42:8379 [cluster]

master.weiboyi.com:

    root      3991 0.1  0.5  40780 9800 ?        Ssl  11:20  0:22 /usr/local/redis-3.2/bin/redis-server 192.168.100.41:6379[cluster]           

    root      4324 0.0  0.4 133520  7720 ?       Ssl  11:27   0:12 /usr/local/redis-3.2/bin/redis-server192.168.100.41:7379 [cluster]           

    root     16347 0.0  0.3  36684 7560 ?        Ssl 16:02   0:00/usr/local/redis-3.2/bin/redis-server 192.168.100.41:8379 [cluster]

client1.weiboyi.com:

    root     10014 0.1  0.3  36684 7736 ?        Ssl  12:19  0:31 /usr/local/redis-3.2/bin/redis-server 192.168.100.43:7379 [cluster]            

    root     10027 0.2  0.4  38732 9788 ?        Ssl  12:20  0:39 /usr/local/redis-3.2/bin/redis-server 192.168.100.43:6379 [cluster]           

    root     13153 0.0  0.3  36684 7564 ?        Ssl  17:02  0:00 /usr/local/redis-3.2/bin/redis-server 192.168.100.43:8379 [cluster]

 

#先检查一下节点的信息状态等

/usr/local/redis-3.2/bin/redis-trib.rb check192.168.100.41:7379

>>> Performing Cluster Check (using node192.168.100.41:7379)

S: 589ff9053237d77131f4cc6f6cf0006b3e38ea56192.168.100.41:7379

   slots: (0 slots)slave

   replicatesc2b3c9cb4b040e4ce48c7a20b4000a1d02e674bd

M: c2b3c9cb4b040e4ce48c7a20b4000a1d02e674bd192.168.100.41:6379

   slots:9223-16383(7161 slots) master

   1 additionalreplica(s)

M: c10928731b4563ec3aa7a60c6837ee77b8b0f95a 192.168.100.43:6379

  slots:0-1879,5461-9222 (5642 slots) master

   1 additionalreplica(s)

S: dba4b4dca703cd2776e2771f8805139a2beaa306192.168.100.43:7379

   slots: (0 slots)slave

   replicatesc10928731b4563ec3aa7a60c6837ee77b8b0f95a

M: 389e7e2fa0a4fb494f6ecb854a677d04e6ed79af192.168.100.42:6379

   slots:1880-5460(3581 slots) master

   1 additionalreplica(s)

S: fec421bd36ad2730864d520240c77248494881cd192.168.100.42:7379

   slots: (0 slots)slave

   replicates389e7e2fa0a4fb494f6ecb854a677d04e6ed79af

[OK] All nodes agree about slots configuration.

>>> Check for open slots...

>>> Check slots coverage...

[OK] All 16384 slots covered.

#加入节点

 

/usr/local/redis-3.2/bin/redis-trib.rb add-node192.168.100.41:8379 192.168.100.41:7379

                                                 

>>> Adding node 192.168.100.41:8379 to cluster192.168.100.41:7379

>>> Performing Cluster Check (using node192.168.100.41:7379)

S: 589ff9053237d77131f4cc6f6cf0006b3e38ea56192.168.100.41:7379

   slots: (0 slots)slave

   replicatesc2b3c9cb4b040e4ce48c7a20b4000a1d02e674bd

M: c2b3c9cb4b040e4ce48c7a20b4000a1d02e674bd192.168.100.41:6379

   slots:9223-16383(7161 slots) master

   1 additionalreplica(s)

M: c10928731b4563ec3aa7a60c6837ee77b8b0f95a192.168.100.43:6379

   slots:0-1879,5461-9222(5642 slots) master

   1 additionalreplica(s)

S: dba4b4dca703cd2776e2771f8805139a2beaa306192.168.100.43:7379

   slots: (0 slots)slave

   replicatesc10928731b4563ec3aa7a60c6837ee77b8b0f95a

M: 389e7e2fa0a4fb494f6ecb854a677d04e6ed79af 192.168.100.42:6379

   slots:1880-5460(3581 slots) master

   1 additionalreplica(s)

S: fec421bd36ad2730864d520240c77248494881cd192.168.100.42:7379

   slots: (0 slots)slave

   replicates389e7e2fa0a4fb494f6ecb854a677d04e6ed79af

[OK] All nodes agree about slots configuration.

>>> Check for open slots...

>>> Check slots coverage...

[OK] All 16384 slots covered.

>>> Send CLUSTER MEET to node 192.168.100.41:8379to make it join the cluster.

[OK] New node added correctly.

 

#check 加入节点后的集群信息

 /usr/local/redis-3.2/bin/redis-trib.rbcheck 192.168.100.41:7379


>>> Performing Cluster Check (using node192.168.100.41:7379)

S: 589ff9053237d77131f4cc6f6cf0006b3e38ea56192.168.100.41:7379

   slots: (0 slots)slave

   replicatesc2b3c9cb4b040e4ce48c7a20b4000a1d02e674bd

M: 2c332aaea894f479c462f6d3eaac580b4833babd192.168.100.41:8379

   slots: (0 slots)master

   0 additionalreplica(s)

M: c2b3c9cb4b040e4ce48c7a20b4000a1d02e674bd192.168.100.41:6379

   slots:9223-16383(7161 slots) master

   1 additional replica(s)

M: c10928731b4563ec3aa7a60c6837ee77b8b0f95a192.168.100.43:6379

  slots:0-1879,5461-9222 (5642 slots) master

   1 additionalreplica(s)

S: dba4b4dca703cd2776e2771f8805139a2beaa306192.168.100.43:7379

   slots: (0 slots)slave

   replicatesc10928731b4563ec3aa7a60c6837ee77b8b0f95a

M: 389e7e2fa0a4fb494f6ecb854a677d04e6ed79af192.168.100.42:6379

   slots:1880-5460(3581 slots) master

   1 additionalreplica(s)

S: fec421bd36ad2730864d520240c77248494881cd192.168.100.42:7379

   slots: (0 slots)slave

   replicates389e7e2fa0a4fb494f6ecb854a677d04e6ed79af

[OK] All nodes agree about slots configuration.

>>> Check for open slots...

>>> Check slots coverage...

[OK] All 16384 slots covered.

 

#继续添加192.168.100.42:8379  192.168.100.43:8379

#设置主从

/usr/local/redis-3.2/bin/redis-cli -c -h 192.168.100.42 -p8379

192.168.100.42:8379>

192.168.100.42:8379> cluster replicate2c332aaea894f479c462f6d3eaac580b4833babd

OK

192.168.100.42:8379>

/usr/local/redis-3.2/bin/redis-cli -c -h 192.168.100.43 -p8379

192.168.100.43:8379> cluster replicate2c332aaea894f479c462f6d3eaac580b4833babd

OK

 

 

/usr/local/redis-3.2/bin/redis-trib.rb check192.168.100.41:7379

>>> Performing Cluster Check (using node192.168.100.41:7379)

S: 589ff9053237d77131f4cc6f6cf0006b3e38ea56 192.168.100.41:7379

   slots: (0 slots)slave

   replicatesc2b3c9cb4b040e4ce48c7a20b4000a1d02e674bd

M: c10928731b4563ec3aa7a60c6837ee77b8b0f95a192.168.100.43:6379

  slots:0-1879,5461-9222 (5642 slots) master

   1 additionalreplica(s)

S: a2632a65e72f04eb4e3b7cda228908574438e1cb192.168.100.42:8379

   slots: (0 slots)slave

   replicates2c332aaea894f479c462f6d3eaac580b4833babd

S: fec421bd36ad2730864d520240c77248494881cd192.168.100.42:7379

   slots: (0 slots)slave

   replicates389e7e2fa0a4fb494f6ecb854a677d04e6ed79af

M: 2c332aaea894f479c462f6d3eaac580b4833babd192.168.100.41:8379

   slots: (0 slots)master

   2 additionalreplica(s)

M: c2b3c9cb4b040e4ce48c7a20b4000a1d02e674bd192.168.100.41:6379

   slots:9223-16383(7161 slots) master

   1 additionalreplica(s)

S: 744ee15ad1ec0ee98bf9a94c24262cd9242e7105192.168.100.43:8379

   slots: (0 slots)slave

   replicates2c332aaea894f479c462f6d3eaac580b4833babd

M: 389e7e2fa0a4fb494f6ecb854a677d04e6ed79af192.168.100.42:6379

   slots:1880-5460 (3581slots) master

   1 additionalreplica(s)

S: dba4b4dca703cd2776e2771f8805139a2beaa306192.168.100.43:7379

   slots: (0 slots)slave

   replicatesc10928731b4563ec3aa7a60c6837ee77b8b0f95a

#重新平衡slot

/usr/local/redis-3.2/bin/redis-trib.rb reshard 192.168.100.41:7379

 

Moving slot 10229 from 192.168.100.41:6379 to192.168.100.42:6379:

Moving slot 10230 from 192.168.100.41:6379 to192.168.100.42:6379:

Moving slot 10231 from 192.168.100.41:6379 to192.168.100.42:6379:

Moving slot 10232 from 192.168.100.41:6379 to192.168.100.42:6379:

Moving slot 10233 from 192.168.100.41:6379 to192.168.100.42:6379:

Moving slot 10234 from 192.168.100.41:6379 to192.168.100.42:6379:

Moving slot 10235 from 192.168.100.41:6379 to192.168.100.42:6379:

Moving slot 10236 from 192.168.100.41:6379 to192.168.100.42:6379:

Moving slot 10237 from 192.168.100.41:6379 to192.168.100.42:6379:

Moving slot 10238 from 192.168.100.41:6379 to192.168.100.42:6379:

Moving slot 10239 from 192.168.100.41:6379 to192.168.100.42:6379:

 

#删除节点

 /usr/local/redis-3.2/bin/redis-trib.rbdel-node 192.168.100.41:8379 2c332aaea894f479c462f6d3eaac580b4833babd

>>> Removing node2c332aaea894f479c462f6d3eaac580b4833babd from cluster 192.168.100.41:8379

>>> Sending CLUSTER FORGET messages to thecluster...

>>> SHUTDOWN the node.

 

 /usr/local/redis-3.2/bin/redis-trib.rbdel-node 192.168.100.42:8379 a2632a65e72f04eb4e3b7cda228908574438e1cb

>>> Removing nodea2632a65e72f04eb4e3b7cda228908574438e1cb from cluster 192.168.100.42:8379

>>> Sending CLUSTER FORGET messages to thecluster...

>>> SHUTDOWN the node.

 /usr/local/redis-3.2/bin/redis-trib.rbdel-node 192.168.100.43:8379 744ee15ad1ec0ee98bf9a94c24262cd9242e7105

>>> Removing node744ee15ad1ec0ee98bf9a94c24262cd9242e7105 from cluster 192.168.100.43:8379

>>> Sending CLUSTER FORGET messages to thecluster...

>>> SHUTDOWN the node.

 

#failover 关闭主节点192.168.100.418379

[root@master conf]# redis-cli -h  192.168.100.41 -p 8379 debug segfault

Error: Server closed the connection

[root@master conf]# /usr/local/redis-3.2/bin/redis-trib.rbcheck 192.168.100.41:7379

[ERR] Sorry, can't connect to node 192.168.100.41:8379

*** WARNING: 192.168.100.43:8379 claims to be slave ofunknown node ID c7c4a1fb3d86f047276385b5695aaca1e1137818.

*** WARNING: 192.168.100.42:8379 claims to be slave ofunknown node ID c7c4a1fb3d86f047276385b5695aaca1e1137818.

>>> Performing Cluster Check (using node192.168.100.41:7379)

S: 589ff9053237d77131f4cc6f6cf0006b3e38ea56192.168.100.41:7379

   slots: (0 slots)slave

   replicatesc10928731b4563ec3aa7a60c6837ee77b8b0f95a

M: c10928731b4563ec3aa7a60c6837ee77b8b0f95a192.168.100.43:6379

   slots:1250-5119(3870 slots) master

   1 additionalreplica(s)

S: fec421bd36ad2730864d520240c77248494881cd192.168.100.42:7379

   slots: (0 slots)slave

   replicates c2b3c9cb4b040e4ce48c7a20b4000a1d02e674bd

S: d25b0f21422628ca876459675895b0ca6e5cb3ec192.168.100.43:8379

   slots: (0 slots)slave

   replicatesc7c4a1fb3d86f047276385b5695aaca1e1137818

M: c2b3c9cb4b040e4ce48c7a20b4000a1d02e674bd192.168.100.41:6379

   slots:11740-16383(4644 slots) master

   1 additionalreplica(s)

S: 96dbe347b4ceeb419005ab1a3f98a11c7821ff07192.168.100.42:8379

   slots: (0 slots)slave

   replicatesc7c4a1fb3d86f047276385b5695aaca1e1137818

M: 389e7e2fa0a4fb494f6ecb854a677d04e6ed79af 192.168.100.42:6379

   slots:6370-10239(3870 slots) master

   1 additionalreplica(s)

S: dba4b4dca703cd2776e2771f8805139a2beaa306192.168.100.43:7379

   slots: (0 slots)slave

   replicates389e7e2fa0a4fb494f6ecb854a677d04e6ed79af

[OK] All nodes agree about slots configuration.

>>> Check for open slots...

>>> Check slots coverage...

[ERR] Not all 16384 slots are covered by nodes.

 

#M: 96dbe347b4ceeb419005ab1a3f98a11c7821ff07192.168.100.42:8379  变成主节点

 

[root@master conf]# /usr/local/redis-3.2/bin/redis-trib.rbcheck 192.168.100.41:7379

>>> Performing Cluster Check (using node192.168.100.41:7379)

S: 589ff9053237d77131f4cc6f6cf0006b3e38ea56192.168.100.41:7379

   slots: (0 slots)slave

   replicatesc10928731b4563ec3aa7a60c6837ee77b8b0f95a

M: c10928731b4563ec3aa7a60c6837ee77b8b0f95a192.168.100.43:6379

   slots:1250-5119(3870 slots) master

   1 additionalreplica(s)

S: fec421bd36ad2730864d520240c77248494881cd192.168.100.42:7379

   slots: (0 slots)slave

   replicatesc2b3c9cb4b040e4ce48c7a20b4000a1d02e674bd

S: d25b0f21422628ca876459675895b0ca6e5cb3ec192.168.100.43:8379

   slots: (0 slots)slave

   replicates96dbe347b4ceeb419005ab1a3f98a11c7821ff07

M: c2b3c9cb4b040e4ce48c7a20b4000a1d02e674bd192.168.100.41:6379

   slots:11740-16383(4644 slots) master

   1 additionalreplica(s)

M: 96dbe347b4ceeb419005ab1a3f98a11c7821ff07192.168.100.42:8379

  slots:0-1249,5120-6369,10240-11739 (4000 slots) master

   1 additionalreplica(s)

M: 389e7e2fa0a4fb494f6ecb854a677d04e6ed79af192.168.100.42:6379

   slots:6370-10239 (3870slots) master

   1 additionalreplica(s)

S: dba4b4dca703cd2776e2771f8805139a2beaa306192.168.100.43:7379

   slots: (0 slots)slave

   replicates389e7e2fa0a4fb494f6ecb854a677d04e6ed79af

[OK] All nodes agree about slots configuration.

>>> Check for open slots...

>>> Check slots coverage...

[OK] All 16384 slots covered.

#启动失败的主节点,自动变成从节点

 

[root@master conf]# salt 'master.wboy.cn' cmd.run  '/usr/local/redis-3.2/bin/redis-server/usr/local/redis-3.2/conf/redis-8379.conf'

master.wboy.com:

[root@master conf]# /usr/local/redis-3.2/bin/redis-trib.rbcheck 192.168.100.41:7379

>>> Performing Cluster Check (using node192.168.100.41:7379)

S: 589ff9053237d77131f4cc6f6cf0006b3e38ea56192.168.100.41:7379

   slots: (0 slots)slave

   replicatesc10928731b4563ec3aa7a60c6837ee77b8b0f95a

M: c10928731b4563ec3aa7a60c6837ee77b8b0f95a192.168.100.43:6379

   slots:1250-5119(3870 slots) master

   1 additionalreplica(s)

S: c7c4a1fb3d86f047276385b5695aaca1e1137818192.168.100.41:8379

   slots: (0 slots) slave

   replicates96dbe347b4ceeb419005ab1a3f98a11c7821ff07

S: fec421bd36ad2730864d520240c77248494881cd192.168.100.42:7379

   slots: (0 slots)slave

   replicatesc2b3c9cb4b040e4ce48c7a20b4000a1d02e674bd

S: d25b0f21422628ca876459675895b0ca6e5cb3ec 192.168.100.43:8379

   slots: (0 slots)slave

   replicates96dbe347b4ceeb419005ab1a3f98a11c7821ff07

M: c2b3c9cb4b040e4ce48c7a20b4000a1d02e674bd192.168.100.41:6379

   slots:11740-16383(4644 slots) master

   1 additionalreplica(s)

M: 96dbe347b4ceeb419005ab1a3f98a11c7821ff07192.168.100.42:8379

  slots:0-1249,5120-6369,10240-11739 (4000 slots) master

   2 additionalreplica(s)

M: 389e7e2fa0a4fb494f6ecb854a677d04e6ed79af192.168.100.42:6379

   slots:6370-10239(3870 slots) master

   1 additionalreplica(s)

S: dba4b4dca703cd2776e2771f8805139a2beaa306192.168.100.43:7379

   slots: (0 slots)slave

   replicates389e7e2fa0a4fb494f6ecb854a677d04e6ed79af

[OK] All nodes agree about slots configuration.

>>> Check for open slots...

>>> Check slots coverage...

[OK] All 16384 slots covered.



     本文转自andylhz 51CTO博客,原文链接:http://blog.51cto.com/andylhz2009/1844181,如需转载请自行联系原作者




相关实践学习
基于Redis实现在线游戏积分排行榜
本场景将介绍如何基于Redis数据库实现在线游戏中的游戏玩家积分排行榜功能。
云数据库 Redis 版使用教程
云数据库Redis版是兼容Redis协议标准的、提供持久化的内存数据库服务,基于高可靠双机热备架构及可无缝扩展的集群架构,满足高读写性能场景及容量需弹性变配的业务需求。 产品详情:https://www.aliyun.com/product/kvstore     ------------------------------------------------------------------------- 阿里云数据库体验:数据库上云实战 开发者云会免费提供一台带自建MySQL的源数据库 ECS 实例和一台目标数据库 RDS实例。跟着指引,您可以一步步实现将ECS自建数据库迁移到目标数据库RDS。 点击下方链接,领取免费ECS&RDS资源,30分钟完成数据库上云实战!https://developer.aliyun.com/adc/scenario/51eefbd1894e42f6bb9acacadd3f9121?spm=a2c6h.13788135.J_3257954370.9.4ba85f24utseFl
相关文章
|
4月前
|
存储 缓存 NoSQL
Redis常见面试题(二):redis分布式锁、redisson、主从一致性、Redlock红锁;Redis集群、主从复制,哨兵模式,分片集群;Redis为什么这么快,I/O多路复用模型
redis分布式锁、redisson、可重入、主从一致性、WatchDog、Redlock红锁、zookeeper;Redis集群、主从复制,全量同步、增量同步;哨兵,分片集群,Redis为什么这么快,I/O多路复用模型——用户空间和内核空间、阻塞IO、非阻塞IO、IO多路复用,Redis网络模型
Redis常见面试题(二):redis分布式锁、redisson、主从一致性、Redlock红锁;Redis集群、主从复制,哨兵模式,分片集群;Redis为什么这么快,I/O多路复用模型
|
3月前
|
监控 NoSQL Redis
看完这篇就能弄懂Redis的集群的原理了
看完这篇就能弄懂Redis的集群的原理了
138 0
|
27天前
|
存储 缓存 监控
利用 Redis 缓存特性避免缓存穿透的策略与方法
【10月更文挑战第23天】通过以上对利用 Redis 缓存特性避免缓存穿透的详细阐述,我们对这一策略有了更深入的理解。在实际应用中,我们需要根据具体情况灵活运用这些方法,并结合其他技术手段,共同保障系统的稳定和高效运行。同时,要不断关注 Redis 缓存特性的发展和变化,及时调整策略,以应对不断出现的新挑战。
62 10
|
1月前
|
存储 消息中间件 NoSQL
【redis】redis的特性和主要应用场景
【redis】redis的特性和主要应用场景
110 1
|
1月前
|
NoSQL 关系型数据库 MySQL
Redis 事务特性、原理、具体命令操作全方位诠释 —— 零基础可学习
本文全面阐述了Redis事务的特性、原理、具体命令操作,指出Redis事务具有原子性但不保证一致性、持久性和隔离性,并解释了Redis事务的适用场景和WATCH命令的乐观锁机制。
259 0
Redis 事务特性、原理、具体命令操作全方位诠释 —— 零基础可学习
|
4月前
|
消息中间件 缓存 NoSQL
Redis快速度特性及为什么支持多线程及应用场景
Redis快速度特性及为什么支持多线程及应用场景
115 11
|
4月前
|
存储 NoSQL 算法
Redis 集群模式搭建
Redis 集群模式搭建
95 5
|
3月前
|
缓存 NoSQL Redis
【Azure Redis 缓存】Windows版创建 Redis Cluster 实验 (精简版)
【Azure Redis 缓存】Windows版创建 Redis Cluster 实验 (精简版)
|
4月前
|
存储 缓存 NoSQL
高并发架构设计三大利器:缓存、限流和降级问题之Redis用于搭建分布式缓存集群问题如何解决
高并发架构设计三大利器:缓存、限流和降级问题之Redis用于搭建分布式缓存集群问题如何解决
下一篇
无影云桌面