-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
RedisCluster: Couldn't map cluster keyspace using any provided seed. Redis->connect works #1864
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
Comments
I've tried using the ./test/make-cluster.sh script to make redis, and it fails in the same way:
The Script:
Output:
|
I found how how to get it to work, but I still have a problem. If I remove $options from the new \RedisCluster() call, then it will connect. However, I eventually want this to use TLS, which requires the $options array yes? Having $options be null or empty array causes errors. |
Hi @Diamonds0a, I only scanned the logic quickly but I think this is a bug. That said, I believe you will be able to connect with TLS using the options array. The issue appears to be erroneously setting "ssl://" as the URL scheme if any options are passed at all. The specific line is here: scheme = redis_sock->stream_ctx ? "ssl" : "tcp"; When options are passed at all I'm not sure what the correct fix is but it should be pretty simple. Edit: To put it another way, not passing SSL options to an unsecured connection should work. Passing SSL options to a TLS secured connection should work. What doesn't work is passing options to an unsecured connection. |
@michael-grunder I don't know is this a bug because if you want to use TLS you need to specify stream context options array. Empty array may be used if you don't want to change any default settings. |
I think we may allow |
@Diamonds0a could you test 5.3.2? Issue should be fixed |
Works. |
FYI I think $redis->connect($host, $port, 5, null, 0, 0, $options); has the same problem. When $options is null. |
@Diamonds0a thanks |
I have a local redis cluster running (note that an IP is not provided in CLUSTER SLOTS, is this normal?):
With the following PHP script:
I can connect to it directly using Redis->connect(). However RedisCluster() generates an error.
This is the output of the script:
PHP Info:
Redis Support | enabled
Redis Version | 5.3.2RC2
Redis Sentinel Version | 0.1
Available serializers | php, json
Expected behaviour
Connecting to Redis Cluster in local environment using RedisCluster
Actual behaviour
I'm seeing this behaviour on
Steps to reproduce, backtrace or example script
I've checked
develop
branchThe text was updated successfully, but these errors were encountered: