Mac brew安装Redis之后更新配置文件的方法

安装命令

brew install redis

查看安装位置命令

brew list redis  #查看redis安装的位置

% brew list redis
/usr/local/Cellar/redis/6.2.5/.bottle/etc/ (2 files)
/usr/local/Cellar/redis/6.2.5/bin/redis-benchmark
/usr/local/Cellar/redis/6.2.5/bin/redis-check-aof
/usr/local/Cellar/redis/6.2.5/bin/redis-check-rdb
/usr/local/Cellar/redis/6.2.5/bin/redis-cli
/usr/local/Cellar/redis/6.2.5/bin/redis-sentinel
/usr/local/Cellar/redis/6.2.5/bin/redis-server
/usr/local/Cellar/redis/6.2.5/homebrew.mxcl.redis.plist
/usr/local/Cellar/redis/6.2.5/homebrew.redis.service

对应安装目录是/usr/local/Cellar/redis/6.2.5/

查看配置文件

配置文件位置记录在homebrew.mxcl.redis.plist properties list文件中

cd /usr/local/Cellar/redis/6.2.5/

% open .
% vim /usr/local/etc/redis.conf

对应内容:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>KeepAlive</key>
	<true/>
	<key>Label</key>
	<string>homebrew.mxcl.redis</string>
	<key>ProgramArguments</key>
	<array>
		<string>/usr/local/opt/redis/bin/redis-server</string>
		<string>/usr/local/etc/redis.conf</string>
	</array>
	<key>RunAtLoad</key>
	<true/>
	<key>StandardErrorPath</key>
	<string>/usr/local/var/log/redis.log</string>
	<key>StandardOutPath</key>
	<string>/usr/local/var/log/redis.log</string>
	<key>WorkingDirectory</key>
	<string>/usr/local/var</string>
</dict>
</plist>

所以配置文件是/usr/local/etc/redis.conf

修改配置文件

遇到下面连接问题:

原因:

这个错误表明你的应用程序(consumer)试图连接到本地运行的Redis服务器实例,但是连接认证失败了。这通常是因为提供的密码(通常以<password>表示)与Redis服务器配置的密码不匹配。

解决办法

redis的保护模式关闭
# By default protected mode is enabled. You should disable it only if
# you are sure you want clients from other hosts to connect to Redis
# even if no authentication is configured, nor a specific set of interfaces
# are explicitly listed using the "bind" directive.
# 受保护模式, 默认是开启的
# protected-mode yes
protected-mode no

重启redis命令

brew services restart redis

尝试celery连接成功

关闭Redis

brew services stop redis   
相关推荐
甜可儿24 分钟前
redis序列化设置
数据库·redis
技术咖啡馆C1 小时前
二、IDE集成DeepSeek保姆级教学(使用篇)
ide·ai编程·idea-plugin·deepseek
吃汤圆的抹香鲸1 小时前
GoLand 安装包 绿色版 Win,Mac,Linux 包含IntelliJ全家桶 专为Go语言设计的集成开发环境(IDE)
linux·windows·macos·go·intellij-idea·go1.19
千层冷面2 小时前
Redis除了做缓存还能做什么?
数据库·redis·缓存
吃汤圆的抹香鲸2 小时前
Rider 安装包 绿色版 Win/Mac/Linux 适合.NET和游戏开发者使用 2025全栈开发终极指南:从零配置到企业级实战
linux·运维·windows·sql·游戏·macos·.net
码有余悸3 小时前
Redis:高性能的键值存储系统
数据库·redis·缓存
老朋友此林10 小时前
浅析 Redis 分片集群 Cluster 原理、手动搭建、动态伸缩集群、故障转移
java·数据库·redis
寻道码路11 小时前
深度剖析 Video-RAG:厦门大学和罗切斯特大学联合推出的一种用于长视频理解的检索增强生成技术
人工智能·语言模型·开源·aigc·音视频·ai编程
因兹菜12 小时前
[LeetCode]day29 232.用栈实现队列
redis·算法·leetcode
甜于酸13 小时前
MuMu模拟器Pro for Mac 安卓手机平板模拟器
android·macos·智能手机