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   
相关推荐
一休哥助手6 分钟前
Redis 五种数据类型及底层数据结构详解
数据结构·数据库·redis
乌恩大侠1 小时前
【Xcode Command Line Tools】安装指南
macos·fpga开发·c
盒马盒马1 小时前
Redis:zset类型
数据库·redis
Jay_fearless2 小时前
Redis SpringBoot项目学习
spring boot·redis
Wang's Blog3 小时前
Redis: 集群环境搭建,集群状态检查,分析主从日志,查看集群信息
数据库·redis
GEEKVIP3 小时前
手机使用技巧:8 个 Android 锁屏移除工具 [解锁 Android]
android·macos·ios·智能手机·电脑·手机·iphone
GEEKVIP3 小时前
如何在 Windows 10 上恢复未保存/删除的 Word 文档
macos·ios·智能手机·电脑·word·笔记本电脑·iphone
奇客软件4 小时前
iPhone使用技巧:如何恢复变砖的 iPhone 或 iPad
数码相机·macos·ios·电脑·笔记本电脑·iphone·ipad
前端张三5 小时前
Mac 电脑pink 后端ip地址进行本地联调
服务器·tcp/ip·macos
wclass-zhengge8 小时前
Redis篇(最佳实践)(持续更新迭代)
redis·缓存·bootstrap