This is not a bug/issue report. This is a heads up for people upgrading to 2.0.11
I am sorry if this does not belong here (feel free to remove)
Problem
If you encounter "ERR This instance has cluster support disabled" Redis Exception, chances are you are, like me, overriding yii\redis\Connection::executeCommand() and NOT using Redis cluster mode.
This happens because 2.0.11 introduced a bunch of fixes for working with Redis in cluster, and one of them is a getIsCluster() check, that calls redis->executeCommand('CLUSTER INFO') internally. Consequentially, this raises forementioned exception, which is ignored in source code, but in case you are overriding executeCommand, you might need to handle it yourself.
Solutions
A. Handle the exception. For instance, "ERR This instance has cluster support disabled" is a yii\db\Exception, so you can differentiate it from e.g. yii\redis\SocketException
B. If you don't intend on working in cluster mode, specify 'forceClusterMode' => false, in your Redis cache component config. This way, exception is never thrown:
Foreword
This is not a bug/issue report. This is a heads up for people upgrading to 2.0.11 I am sorry if this does not belong here (feel free to remove)
Problem
If you encounter "ERR This instance has cluster support disabled" Redis Exception, chances are you are, like me, overriding
yii\redis\Connection::executeCommand()
and NOT using Redis cluster mode.This happens because 2.0.11 introduced a bunch of fixes for working with Redis in cluster, and one of them is a getIsCluster() check, that calls
redis->executeCommand('CLUSTER INFO')
internally. Consequentially, this raises forementioned exception, which is ignored in source code, but in case you are overridingexecuteCommand
, you might need to handle it yourself.Solutions
A. Handle the exception. For instance, "ERR This instance has cluster support disabled" is a
yii\db\Exception
, so you can differentiate it from e.g.yii\redis\SocketException
B. If you don't intend on working in cluster mode, specify
'forceClusterMode' => false,
in your Redis cache component config. This way, exception is never thrown:C. Use Redis in cluster :)
In this case, I think it's preferrable to set
'forceClusterMode' => true
Additional info