use rocket_db_pools::{deadpool_redis, Database};
#[derive(Database)]
#[database("redis_tests")]
pub struct TestRedisPool(deadpool_redis::Pool);
As above, we are connecting to redis using deadpool_redis in rocket_db_pools. The address of the connection is specified in Cargo.toml and Rocket.toml using tls for the cluster endpoint. The cluster consists of one shard with three nodes in it.
Cargo.toml
[dependencies]
async-std = "1.11.0"
futures = "0.3.21"
http = "0.2.6"
serde = "1.0.136"
redis = { version =" 0.21.5", features = ["tls","tokio-native-tls-comp","async-std-tls-comp","cluster"]}
[dependencies.rocket]
version = "0.5.0-rc.1"
features = ["json"]
[dependencies.rocket_db_pools]
version = "0.1.0-rc.2"
features = ["deadpool_redis"]
Rocket.toml
[default.databases.dev_actionConfigures]
url = 'rediss://<cluster endpoint>:6379'
When I try to hmget in this state, I get the following error. It appears that perhaps the cluster connection is established, but there is an error when connecting to the subsequent nodes. How can this be resolved?
error log
redis.hmget err: An error was signalled by the server: 853 <node address>:6379
It works well with a single node in a shard of a cluster. More than one node will result in an error.