重定向到插槽后 redis-cli NOAUTH 错误

问题描述

为 redis 服务器启用身份验证后,每次请求重定向到不同的插槽时,sample_data = [{'param_one': 'x1','param_two': 'y2','distro': 'test1'},{'param_one': 'x1','distro': 'test2'},{'param_one': 'x2','param_two': 'y1','distro': 'test3'},'distro': 'test4'}] groupby_params(sample_data) [{'x1,y2': ['test1','test2']},{'x2,y1': ['test3','test4']}] 都会返回 redis-cli 错误。见下面的输出

(error) NOAUTH Authentication required.

有关如何解决此行为的任何建议?

解决方法

redis-cli 的 REPL 模式连接不存储交互输入的凭据。您必须像下面这样调用它才能自动验证每个连接:

redis-cli -c --user admin --pass password