Docker 部署常用中间件(redis,rabbitMQ,mysql8,es,kibana,nginx等)亲测成功~~~

Docker 部署常用中间件

在日常开发中必要的环境,大多数都是单点后续持续更新集群模式~~~ 

docker 安装reids

docker pull redis:7.2.5

编辑redis.conf

# 绑定地址,默认只允许本机访问
# bind 192.168.1.100 10.0.0.1
bind 127.0.0.1 ::1
# 允许所有地址访问
bind 0.0.0.0
# 保护模式,默认为yes,建议只在开发环境中设置为no
protected-mode no
# Redis监听的端口号
port 6379
# TCP连接队列长度,默认为511
tcp-backlog 511
# 设置密码,访问Redis需要密码验证
requirepass root
# 客户端空闲多少秒后关闭连接(0表示禁用)
timeout 0
# TCP保活时间,单位为秒
tcp-keepalive 300
# 是否以守护进程方式运行,默认为no
daemonize no
# 是否通过upstart或systemd管理Redis守护进程,默认为no
supervised no
# PID文件位置
pidfile /var/run/redis_6379.pid
# 日志级别,可选项有debug, verbose, notice, warning
loglevel notice
# 日志文件位置,默认为空,表示输出到标准输出
logfile ""
# 数据库数量,默认为16个
databases 16
# 是否显示Redis徽标,默认为no
always-show-logo yes
# RDB持久化策略
save 900 1
save 300 10
save 60 10000
# 当RDB持久化出错时,是否停止写入操作,默认为yes
stop-writes-on-bgsave-error yes
# 是否压缩RDB文件,默认为yes
rdbcompression yes
# 是否对RDB文件进行校验,默认为yes
rdbchecksum yes
# RDB文件名
dbfilename dump.rdb
# 数据目录位置
dir ./
# 当从节点无法同步主节点数据时,是否继续提供服务,默认为yes
replica-serve-stale-data yes
# 从节点是否只读,默认为yes
replica-read-only yes
# 是否使用无盘同步,默认为no
repl-diskless-sync no
# 是否禁用TCP_NODELAY,默认为no
repl-disable-tcp-nodelay no
# 从节点的优先级,用于选举主节点时使用,默认为100
replica-priority 100
# 内存清理策略
lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
replica-lazy-flush no
# 是否开启AOF持久化,默认为no
appendonly yes
# AOF文件名
appendfilename "appendonly.aof"
# 在AOF重写期间是否执行fsync,默认为no
no-appendfsync-on-rewrite no
# AOF文件自动重写百分比,默认为100
auto-aof-rewrite-percentage 100
# AOF文件自动重写最小大小,默认为64mb
auto-aof-rewrite-min-size 64mb
# 是否加载被截断的AOF文件,默认为yes
aof-load-truncated yes
# 是否使用RDB前缀来加速AOF重写,默认为yes
aof-use-rdb-preamble yes
# Lua脚本执行的最大时间,单位为毫秒
lua-time-limit 5000
# 慢查询日志的最大长度,默认为128
slowlog-max-len 128
# keyspace事件通知,用于监听键的操作事件
notify-keyspace-events "KEA"
# 哈希表相关配置
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
# 列表相关配置
list-max-ziplist-size -2
list-compress-depth 0
# 集合相关配置
set-max-intset-entries 512
# 有序集合相关配置
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
# HyperLogLog相关配置
hll-sparse-max-bytes 3000
# 流相关配置
stream-node-max-bytes 4096
stream-node-max-entries 100
# 是否开启rehash,默认为yes
activerehashing yes
# Redis服务器周期性任务执行频率,默认为10
hz

你可能感兴趣的:(工具,docker,docker,中间件,redis)