Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test with standalone mode #11

Closed
csfreebird opened this issue Feb 2, 2019 · 2 comments
Closed

test with standalone mode #11

csfreebird opened this issue Feb 2, 2019 · 2 comments

Comments

@csfreebird
Copy link

I installed redis 5 and run it as standalone server.
When try test application with following command:
./compile/test/test_redis++ -h localhost -p 6379 -n localhost -c 6379

But get following error:
Test failed: ERR This instance has cluster support disabled

Need a way to run test with standalone server.

@sewenew
Copy link
Owner

sewenew commented Feb 2, 2019

Hi @csfreebird

As I mentioned in the doc, in order to run the test, you need to setup both a standalone server, and a Redis Cluster. Because the test program also sends commands to Redis Cluster.

You can use the following method to setup a one node Redis Cluster for test.

Start Redis in Cluster Mode

./redis-server --port 9999 --cluster-enabled yes &>/dev/null &

Assign Slots

Run the following script to assign all slots to this node.

#!/bin/bash

redis_cli='./redis-cli -p 9999 -c'
cluster_node=`$redis_cli cluster nodes | awk '{print $1}'`

for i in {0..16383}
do
    $redis_cli CLUSTER SETSLOT $i node $cluster_node &>/dev/null
done

It might take a while to run the script. After that, you can run the test command:

./compile/test/test_redis++ -h localhost -p 6379 -n localhost -c 9999

Regards

@csfreebird
Copy link
Author

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants