Closed mlanzuisi closed 1 year ago
Yes, you need to use generic command interface to send cluster related command, e.g. cluster slots, to get the nodes info. Check this issue for an example on how to parse the reply.
Regards
I don't know why, but I have an error in compilation for this line
auto slots = r.command<std::vector
the error is
cache-lib.cc.o.d -o CMakeFiles/cache.dir/cache-lib.cc.o -c /home/mlanzuisi/redis-library/cache-lib/cache-lib.cc
/home/mlanzuisi/redis-library/cache-lib/cache-lib.cc: In member function ‘std::unordered_set<std::basic_string
This is the cmake output
Detected version: 1.1.0 -- redis-plus-plus version: 1.3.7 -- redis-plus-plus build type: Release -- redis-plus-plus build with CXX standard: c++11 -- redis-plus-plus TLS support: ON -- redis-plus-plus build static library: ON -- redis-plus-plus build static library with position independent code: ON -- redis-plus-plus build shared library: ON -- redis-plus-plus build test: ON -- Debian package name: .deb -- Configuring done -- Generating done -- Build files have been written to:
That issue is related to async interface, which returns a future
object, and you need to call future::get
.
If you don't use async interface, you don't need to do the get
call:
auto slots = r.command<std::vector>("CLUSTER", "SLOTS");
Regards
Thank you so much. It works
I'll close this issue, since the problem has been solved. If you still have problem feel free to open a new one. If you like it, feel free to star it :)
Regards
I would like to understand if there is any specific command to use to ask for the list of nodes in a cluster, like to have "redis-cli cluster nodes" output, or if it done via the generic command() interface.