简体   繁体   English

如何在 Mac 上使用 TLS 构建 Redis 6

[英]How to build Redis 6 with TLS on Mac

I want to use TLS with Redis on Mac (macOS 10.15.4, kernel: Darwin 19.4.0).我想在 Mac 上将 TLS 与 Redis 一起使用(macOS 10.15.4、kernel:Darwin 19.4.0)。 This is what I tried according to Documentation :这是我根据文档尝试的:

export BUILD_TLS=yes
mkdir redis && cd redis
curl -O http://download.redis.io/redis-stable.tar.gz
tar xzvf redis-stable.tar.gz
cd redis-stable
make BUILD_TLS=yes
make test
sudo make install

All tests passed but when I run:所有测试都通过了,但是当我运行时:

% redis-server --tls-cluster yes

I get error:我得到错误:

*** FATAL CONFIG FILE ERROR (Redis 6.0.4) *** Reading the configuration file, at line 2
>>> 'tls-cluster "yes"'
Bad directive or wrong number of arguments

You did not specify the value for the tls-cluster configuration option.您没有指定tls-cluster配置选项的值。 This works (on my MacBook Catelina 10.15.5):这有效(在我的 MacBook Catelina 10.15.5 上):

% redis-server --tls-cluster yes

Give a try to brew install redis (currently in version 6.0.5 ) it includes already support for TLS, in any case, if you would like to compile it from the source you could check the brew formula: https://github.com/Homebrew/homebrew-core/blob/master/Formula/redis.rb#L18尝试brew install redis (当前版本为6.0.5 )它已经包含对 TLS 的支持,无论如何,如果您想从源代码编译它,您可以检查 brew 公式: https://github.com /Homebrew/homebrew-core/blob/master/Formula/redis.rb#L18

def install
    system "make", "install", "PREFIX=#{prefix}", "CC=#{ENV.cc}", "BUILD_TLS=yes"

    %w[run db/redis log].each { |p| (var/p).mkpath }

    # Fix up default conf file to match our paths
    inreplace "redis.conf" do |s|
      s.gsub! "/var/run/redis.pid", var/"run/redis.pid"
      s.gsub! "dir ./", "dir #{var}/db/redis/"
      s.sub!  /^bind .*$/, "bind 127.0.0.1 ::1"
    end

    etc.install "redis.conf"
    etc.install "sentinel.conf" => "redis-sentinel.conf"
  end

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM