macbook 上的 redis.conf 在哪里

文章讲述了如何在Homebrew中管理Redis,包括Redis的安装路径、配置文件redis.conf的位置以及如何重启并设置为守护模式。重点在于`brewlist`和`redis.conf`的管理和操作。

寻找方式

brew list redis
#结果
/opt/homebrew/Cellar/redis/7.2.3/.bottle/etc/ (2 files)
/opt/homebrew/Cellar/redis/7.2.3/bin/redis-benchmark
/opt/homebrew/Cellar/redis/7.2.3/bin/redis-check-aof
/opt/homebrew/Cellar/redis/7.2.3/bin/redis-check-rdb
/opt/homebrew/Cellar/redis/7.2.3/bin/redis-cli
/opt/homebrew/Cellar/redis/7.2.3/bin/redis-sentinel
/opt/homebrew/Cellar/redis/7.2.3/bin/redis-server
/opt/homebrew/Cellar/redis/7.2.3/homebrew.mxcl.redis.plist 

code /opt/homebrew/Cellar/redis/7.2.3/homebrew.mxcl.redis.plist 文件

<?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>LimitLoadToSessionType</key>
	<array>
		<string>Aqua</string>
		<string>Background</string>
		<string>LoginWindow</string>
		<string>StandardIO</string>
		<string>System</string>
	</array>
	<key>ProgramArguments</key>
	<array>
		<string>/opt/homebrew/opt/redis/bin/redis-server</string>
		<string>/opt/homebrew/etc/redis.conf</string> 
	</array>
	<key>RunAtLoad</key>
	<true/>
	<key>StandardErrorPath</key>
	<string>/opt/homebrew/var/log/redis.log</string>
	<key>StandardOutPath</key>
	<string>/opt/homebrew/var/log/redis.log</string>
	<key>WorkingDirectory</key>
	<string>/opt/homebrew/var</string>
</dict>
</plist>

从里面可以看到 redis.conf 的路径是 /opt/homebrew/etc/redis.conf。
修改完 redis.conf 后重启 redis

redis-server --daemonize yes
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值