[英]How to build Redis 6 with TLS on Mac
我想在 Mac 上将 TLS 与 Redis 一起使用(macOS 10.15.4、kernel:Darwin 19.4.0)。 这是我根据文档尝试的:
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
所有测试都通过了,但是当我运行时:
% redis-server --tls-cluster yes
我得到错误:
*** 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
您没有指定tls-cluster
配置选项的值。 这有效(在我的 MacBook Catelina 10.15.5 上):
% redis-server --tls-cluster yes
尝试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.