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   
相关推荐
Monkey的自我迭代5 小时前
微服务架构实践:K8s、RocketMQ、Nacos、Redis、MinIO、Nexus 组件落地经验
redis·nacos·k8s·rocketmq
wangruofeng5 小时前
八巨头联署催促抗量子迁移,比特币为什么一度跌至约 52,000 美元?
aigc·ai编程
TheBlackHoleLab5 小时前
WorkBuddy+REA macOs下的安装以及配置教程
macos·rea·workbuddy·逆向agent
霸道流氓气质5 小时前
分布式序列号生成:基于 Redis 原子自增的编号方案
数据库·redis·分布式
好好沉淀5 小时前
Spring Boot 中 consumes 和 isSaveRequestData=false 到底有什么用?
java·后端·ai编程
byte轻骑兵6 小时前
异构混合环境远程控制工具适配对比(Windows / Mac / Linux / 国产系统 / arm64 / 鸿蒙)
linux·windows·macos·远程办公
标书客7 小时前
电子投标前,怎么自查电脑 MAC 地址、硬件序列号?
网络·macos·电脑
大鹏说大话7 小时前
深入拆解 iOS 消息转发:从 Runtime 底层原理到实战业务落地
macos·objective-c·cocoa
echoVic8 小时前
多个 Coding Agent 并行,终端该怎么组织?
go·agent·ai编程
jiecy8 小时前
用AI做了个吉他调音器节奏器
python·ai编程