Closed fang-da-mao closed 3 years ago
Here is more information about the my redis server conf:
port 6380 cluster-enabled yes cluster-config-file nodes.conf cluster-node-timeout 5000 appendonly yes protected-mode no
For other master nodes config file, only the port number is different.
Can you show me complete code that can reproduce the problem? Especially the code that failed to compile, i.e. 'connection_options' does not name a type. It seems that you didn't install redis-plus-plus correctly. Also please check if you installed more than one hiredis version. In this case, you'll get wired problems.
Regards
@fang-da-mao Since there's no update from you, I'll close this issue. If you still have problem with it, feel free to reopen it.
Regards
Hi @sewenew ,
I wanted to insert data into a redis cluster which contains three master nodes: port 6380, 6381, 6382.
I connected to certain node just as instructed: sw::redis::RedisCluster redis_cluster("tcp://hostname:6380"); (p.s. in reality, the hostname is my virtual machine's name)
Then I tried: redis_cluster.set("30", "value");
The error is: terminate called after throwing an instance of 'sw::redis::Error' what(): Failed to send command with key: 30 Abort
I also tried another way to connect to the cluster:
sw::redis::ConnectionOptions connection_options; connection_options.host = "hostname";
connection_options.port = 6380;
sw::redis::RedisCluster redis_cluster(connection_options);
But it tells me: 'connection_options' does not name a type connection_options.host = "hostname"; (p.s. in reality, the hostname is my virtual machine's name.)
Could you please help me by taking a look at this issue?
Thanks :)