Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Writing and querying Redis Cluster data (experiment)

2025-03-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Data write test:

# redis-cli-h 192.168.2.100-c-p 6379 / /-c indicates connection to the cluster

192.168.2.100Suzhou 6379 > set name zhangsan

-> Redirected to slot [5798] located at 192.168.2.200

OK

192.168.2.200 6379 > get name

"zhangsan"

192.168.2.200 6379 >

Through the process, you can see:

We logged in at 92.168.2.100 6379 and wrote a key

After the new key is fetched through the CRC16 algorithm, the result is 5798.

Because slot 5798 is responsible for 192.168.2.200

So, the newly created key is redirected to 192.168.2.2006379

Data query test:

# redis-cli-h 192.168.2.201-c-p 6380

192.168.2.201pur6380 > get name

-> Redirected to slot [5798] located at 192.168.2.200

"zhangsan"

192.168.2.200 6379 >

Through the process, you can see:

We logged in at 192.168.2.201virtual 6380 and sent a query request.

After the key of the query is taken by the CRC16 algorithm (and 16384), the result is 5798.

Because slot 5798 is responsible for 192.168.2.200

Therefore, the query request is redirected to 192.168.2.200 VRO 6379.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report