redis-cli:无法识别的选项或错误数量的参数:“--tls”

ste*_*ste 2 redis

我正在尝试启动一个支持 tls 的 redis 服务器。根据文档(https://redis.io/topics/rediscli),我执行以下命令:

redis-cli -a xxxxxxxxx --tls --cacert ../config/certs/test-ca.crt

但它返回此错误:

无法识别的选项或错误数量的参数:“--tls”

我的 redis-cli 版本是 6.0.9

我无法弄清楚我错过了什么。我怎样才能解决这个问题?

Vai*_*ain 8

安装依赖项

从存储库更新包信息

sudo apt update
Run Code Online (Sandbox Code Playgroud)

安装构建依赖项

sudo apt install -y build-essential pkg-config libssl-dev tcl libjemalloc-dev wget
Download and extract the redis-cli source file
Run Code Online (Sandbox Code Playgroud)

下载包

wget http://download.redis.io/redis-stable.tar.gz
Run Code Online (Sandbox Code Playgroud)

提取包

tar xvzf redis-stable.tar.gz
Run Code Online (Sandbox Code Playgroud)

进入解压后的目录

cd redis-stable
Run Code Online (Sandbox Code Playgroud)

启用 tls 进行构建

删除之前生成的构建文件

make distclean
Run Code Online (Sandbox Code Playgroud)

使用 tls 选项构建

make BUILD_TLS=yes
Once completed you can validate the build and connect to Redis-server
Run Code Online (Sandbox Code Playgroud)

验证 redis-cli

Redis-CLI -h localhost -p 6379 --tls
Run Code Online (Sandbox Code Playgroud)

本地主机:6379> 信息 SSL

SSL协议

ssl_enabled:yes
ssl_current_certificate_not_before_date:Jul 27 00:00:00 2021 GMT
ssl_current_certificate_not_after_date:Aug 25 23:59:59 2022 GMT
ssl_current_certificate_serial:ABCDEFGKKSHDJKAHSD05A15BF008A57002E8
Run Code Online (Sandbox Code Playgroud)


小智 5

当您执行 redis 的 make 时,您应该运行为:make BUILD_TLS=yes