3 Redis 配置文件

本文详细介绍了Redis的配置文件,包括全局配置如redis.conf启动和units单位,网络设置如bind、port和timeout,通用配置如守护进程和日志,安全设置如requirepass密码,以及客户端连接的最大数maxclients。理解这些配置有助于优化Redis服务。
摘要由CSDN通过智能技术生成

1 Redis 全局配置

1.1 redis.conf启动配置

redis启动必须的配置文件redis.conf

./redis-server /path/to/redis.conf

1.2 units单位

不区分大小写,大小写不敏感,需要指定单位

# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes
# 1gb => 1024*1024*1024 bytes
#
# units are case insensitive so 1GB 1Gb 1gB are all the same.

2 NETWORK

2.1 bind 绑定ip

注释掉bind 表示关闭本地访问,开启远程访问
protected-mode 由yes改为no 配合上面注释关闭保护模式,开启远程访问

# bind 127.0.0.1 -::1
protected-mode no

2.2 port端口

默认端口号 6379

# Accept connections on the specified port, default is 6379 (IANA #815344).
# If port 0 is
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值