In [8]: def redis_cluster():
...: redis_nodes = [{'host':'192.168.100.60','port':7000},
...: {'host':'192.168.100.60','port':7001},
...: {'host':'192.168.100.60','port':7002},
...: {'host':'192.168.100.60','port':7003},
...: {'host':'192.168.100.60','port':7004},
...: {'host':'192.168.100.60','port':7005}
...: ]
...: redisconn = StrictRedisCluster(startup_nodes=redis_nodes)
...: redisconn.set('name','admin')
...: redisconn.set('age',18)
...: print("name is:",redisconn.get('name'))
...: print(redisconn.get('name'),redisconn.get('age'))
...:

In [9]: redis_cluster()
name is: b'admin'
b'admin' b'18'

In [10]: 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-13
  • 2021-06-01
  • 2022-12-23
猜你喜欢
  • 2021-10-21
  • 2021-12-05
  • 2021-11-12
  • 2022-12-23
  • 2022-12-23
  • 2021-09-14
  • 2022-12-23
相关资源
相似解决方案