【问题标题】:redis fails to get CONFIG when using redis-benchmarkredis使用redis-benchmark时获取CONFIG失败
【发布时间】:2022-11-29 04:57:55
【问题描述】:

我有 redis 7 服务器设置以仅提供安全的 TLS 连接并使用 redis-cli 验证它是否正常工作。 但是当我做 redis-benchmark 时,我得到这个错误:

ERROR: failed to fetch CONFIG from 127.0.0.1:6379
WARNING: Could not fetch server CONFIG

我该如何解决这个错误?

【问题讨论】:

  • 您是否已重命名CONFIG 命令?您是否能够在未启用 TLS 的情况下运行基准测试?
  • 我没有重命名 CONFIG 命令。我没有测试过没有 TLS 的运行。

标签: ssl redis tls1.2


【解决方案1】:

此命令在仅 TLS Redis 服务器上对我来说工作正常。

./src/redis-benchmark --tls --cert ./tests/tls/redis.crt --key ./tests/tls/redis.key --cacert ./tests/tls/ca.crt

====== PING_INLINE ======
  100000 requests completed in 1.76 seconds
  50 parallel clients
...

Redis 服务器已经开始使用

./src/redis-server --tls-port 6379 --port 0 --tls-cert-file ./tests/tls/redis.crt --tls-key-file ./tests/tls/redis.key --tls-ca-cert-file ./tests/tls/ca.crt 

密钥和证书已使用Redis TLS documentation生成

你可以检查所有redis-benchmarktls 相关选项

./src/redis-benchmark --help
Usage: redis-benchmark [OPTIONS] [COMMAND ARGS...]

Options:
 --tls              Establish a secure TLS connection.
 --cacert <file>    CA Certificate file to verify with.
 --cacertdir <dir>  Directory where trusted CA certificates are stored.
                    If neither cacert nor cacertdir are specified, the default
                    system-wide trusted root certs configuration will apply.
 --insecure         Allow insecure TLS connection by skipping cert validation.
 --cert <file>      Client certificate to authenticate with.
 --key <file>       Private key file to authenticate with.
 --tls-ciphers <list> Sets the list of preferred ciphers (TLSv1.2 and below)
                    in order of preference from highest to lowest separated by colon (":").
                    See the ciphers(1ssl) manpage for more information about the syntax of this string.
 --tls-ciphersuites <list> Sets the list of preferred ciphersuites (TLSv1.3)
                    in order of preference from highest to lowest separated by colon (":").
                    See the ciphers(1ssl) manpage for more information about the syntax of this string,
                    and specifically for TLSv1.3 ciphersuites.

与 tls 无关的选项已被省略。

【讨论】:

    【解决方案2】:

    关于如何在启用 TLS 选项的情况下构建/编译 redis-benchmark 的任何想法,因为我在 redis-benchmark 帮助菜单中没有看到 TLS 选项???

    【讨论】:

    • 这篇文章看起来不像是试图回答这个问题。这里的每个帖子都应该是一个明确的尝试回答这个问题;如果你有批评或需要澄清问题或其他答案,你可以直接在它下面post a comment(就像这个)。请删除此答案并创建评论或新问题。见:Ask questions, get answers, no distractions
    猜你喜欢
    • 2019-10-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-16
    • 1970-01-01
    • 2013-09-04
    相关资源
    最近更新 更多