Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 PHP 中使用 Predis 使用 Redis 集群,我做的很简单
$image_urls = $client->get($key)
现在我想获取 Redis 找到键值对的主机地址,因为它还包含本地图像,我需要获取这些图像的完整链接。
您可以使用getConnectionByKey()来获取该信息。
getConnectionByKey()
例如:
$cluster = new PredisCluster(); $cluster->add($connection); $cluster->add($connection2); $connection = $cluster->getConnectionByKey($key);
来源:PredisClusterTest.php