在 CentOS 上,Redis 的配置文件通常是:
/etc/redis.conf
或(某些版本/安装方式):
/etc/redis/redis.conf
yum 安装(CentOS 官方源或 EPEL):
yum install redis
配置文件一般在:
/etc/redis.conf
systemd 启动方式:
systemctl start redis
systemctl enable redis
配置文件中常见项:
bind 127.0.0.1
port 6379
daemonize yes
requirepass yourpassword
ps -ef | grep redis
通常会看到类似:
redis-server *:6379 /etc/redis.conf
一般在:
/usr/local/redis/redis.conf
(路径取决于你编译时的设置)
如果你告诉我 CentOS 版本 和 Redis 安装方式(yum / 编译 / Docker),我可以给你更准确的路径。