我想在 Mac(macOS 10.15.4,内核:Darwin 19.4.0)上使用 TLS 和 Redis。这是我根据文档尝试的:
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
Run Code Online (Sandbox Code Playgroud)
所有测试都通过了,但是当我运行时:
% redis-server --tls-cluster yes
Run Code Online (Sandbox Code Playgroud)
我得到错误:
*** 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
Run Code Online (Sandbox Code Playgroud)
尝试一下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
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
915 次 |
| 最近记录: |