[英]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.