当前位置: 首页 > news >正文

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   

http://www.lryc.cn/news/341899.html

相关文章:

  • 安卓应用开发(一):工具与环境
  • 基于springboot+vue+Mysql的在线动漫信息平台
  • C++设计模式-结构型设计模式
  • open-webui+ollama本地部署Llama3
  • 个人对行为型设计模式的理解 @by_TWJ
  • 苹果挖走大量谷歌人才,建立神秘人工智能实验室;李飞飞创业成立「空间智能」公司丨 RTE 开发者日报 Vol.197
  • 行业唯一!易保全牵头编制的《区块链数据访问安全技术通则》发布
  • Rust Rocket创建第一个hello world的Web程序 Rust Rocket开发常用网址和Rust常用命令
  • 第G9周:ACGAN理论与实战
  • Linux网络部分——DNS域名解析服务
  • 预处理详解
  • Python的创建和使用自定义模块
  • Python根据预设txt生成“你画我猜”题目PPT(素拓活动小工具)
  • 小程序地理位置接口权限直接抄作业
  • 【Osek网络管理测试】[TG3_TC6]等待总线睡眠状态_2
  • BEV下统一的多传感器融合框架 - FUTR3D
  • c#和python的flask接口的交互
  • Python测试框架Pytest的参数化详解
  • KernelSU 如何不通过模块,直接修改系统分区
  • 红日靶场ATTCK 1通关攻略
  • CellMarker | 人骨骼肌组织细胞Marker大全!~(强烈建议火速收藏!)
  • 游戏名台词大赏
  • OpenCV如何在图像中寻找轮廓(60)
  • java 泛型题目讲解
  • pptx 文件版面分析-- python-pptx(python 文档解析提取)
  • http的basic 认证方式
  • 【信息系统项目管理师练习题】信息系统治理
  • RabbitMQ之顺序消费
  • 轻松上手的LangChain学习说明书
  • 【论文笔记】Training language models to follow instructions with human feedback A部分