Linux redis配置文件路径:
/usr/local/redis/etc/redis.conf
# Redis configuration file example.## Note that in order to read the configuration file, Redis must be# started with the file path as first argument:## ./redis-server /path/to/redis.conf
################################## INCLUDES ###################################
################################## MODULES #####################################
# Load modules at startup. If the server is not able to load modules# it will abort. It is possible to use multiple loadmodule directives.## loadmodule /path/to/my_module.so# loadmodule /path/to/other_module.so
################################## NETWORK #####################################
# Close the connection after a client is idle for N seconds (0 to disable)timeout 0
################################# GENERAL #####################################
# Specify the server verbosity level.# This can be one of:# debug (a lot of information, useful for development/testing)# verbose (many rarely useful info, but not a mess like the debug level)# notice (moderately verbose, what you want in production probably)# warning (only very important / critical messages are logged)loglevel notice
# Specify the syslog identity.# syslog-ident redis
#默认值为yes.当启用了RDB且最后一次后台保存数据失败,Redis是否停止接收数据.#这会让用户意识到数据没有正确持久化到磁盘上,否则没有人会注意到灾难(disaster)发生了.#如果Redis重启了,那么又可以重新开始接收数据了stop-writes-on-bgsave-error yes
# 默认值是yes.对于存储到磁盘中的快照,可以设置是否进行压缩存储.# 如果是的话,redis会采用LZF算法进行压缩.# 如果你不想消耗CPU来进行压缩的话,可以设置为关闭此功能,但是存储在磁盘上的快照会比较大.rdbcompression yes
# 设置快照的文件名,默认是 dump.rdbdbfilename dump.rdb
# 设置快照文件的存放路径,这个配置项一定是个目录,而不能是文件名.默认是和当前配置文件保存在同一目录.dir ./
################################# REPLICATION #################################
# Set the replication backlog size. The backlog is a buffer that accumulates# slave data when slaves are disconnected for some time, so that when a slave# wants to reconnect again, often a full resync is not needed, but a partial# resync is enough, just passing the portion of data the slave missed while# disconnected.## The bigger the replication backlog, the longer the time the slave can be# disconnected and later be able to perform a partial resynchronization.## The backlog is only allocated once there is at least a slave connected.## repl-backlog-size 1mb
################################## SECURITY ###################################
################################### CLIENTS ####################################
############################## MEMORY MANAGEMENT ################################
############################# LAZY FREEING ####################################
lazyfree-lazy-eviction nolazyfree-lazy-expire nolazyfree-lazy-server-del noslave-lazy-flush no
############################## APPEND ONLY MODE ###############################
# 默认值为no,也就是说redis 默认使用的是rdb方式持久化,#如果想要开启 AOF 持久化方式,需要将 appendonly 修改为 yes.appendonly no
# aof持久化策略的配置;## no表示不执行fsync,由操作系统保证数据同步到磁盘,速度最快,但是不太安全;## always表示每次写入都执行fsync,以保证数据同步到磁盘,效率很低;## everysec表示每秒执行一次fsync,可能会导致丢失这1s数据.通常选择 everysec ,兼顾安全性和效率appendfsync everysec
no-appendfsync-on-rewrite no
# 默认值为100.aof自动重写配置,当目前aof文件大小超过上一次重写的aof文件大小的百分之多少进行重写,#即当aof文件增长到一定大小的时候,Redis能够调用bgrewriteaof对日志文件进行重写.#当前AOF文件大小是上次日志重写得到AOF文件大小的二倍(设置为100)时,自动启动新的日志重写过程.
auto-aof-rewrite-percentage 100
aof-load-truncated yes
################################ LUA SCRIPTING ###############################
# By default Redis Cluster nodes stop accepting queries if they detect there# is at least an hash slot uncovered (no available node is serving it).# This way if the cluster is partially down (for example a range of hash slots# are no longer covered) all the cluster becomes, eventually, unavailable.# It automatically returns available as soon as all the slots are covered again.## However sometimes you want the subset of the cluster which is working,# to continue to accept queries for the part of the key space that is still# covered. In order to do so, just set the cluster-require-full-coverage# option to no.## cluster-require-full-coverage yes
# This option, when set to yes, prevents slaves from trying to failover its# master during master failures. However the master can still perform a# manual failover, if forced to do so.## This is useful in different scenarios, especially in the case of multiple# data center operations, where we want one side to never be promoted if not# in the case of a total DC failure.## cluster-slave-no-failover no
# In order to setup your cluster make sure to read the documentation# available at http://redis.io web site.
########################## CLUSTER DOCKER/NAT support ########################
################################## SLOW LOG ###################################
# The Redis Slow Log is a system to log queries that exceeded a specified# execution time. The execution time does not include the I/O operations# like talking with the client, sending the reply and so forth,# but just the time needed to actually execute the command (this is the only# stage of command execution where the thread is blocked and can not serve# other requests in the meantime).## You can configure the slow log with two parameters: one tells Redis# what is the execution time, in microseconds, to exceed in order for the# command to get logged, and the other parameter is the length of the# slow log. When a new command is logged the oldest one is removed from the# queue of logged commands.
# The following time is expressed in microseconds, so 1000000 is equivalent# to one second. Note that a negative number disables the slow log, while# a value of zero forces the logging of every command.slowlog-log-slower-than 10000
################################ LATENCY MONITOR ##############################
############################# EVENT NOTIFICATION ##############################
############################### ADVANCED CONFIG ###############################
# Client query buffers accumulate new commands. They are limited to a fixed# amount by default in order to avoid that a protocol desynchronization (for# instance due to a bug in the client) will lead to unbound memory usage in# the query buffer. However you can configure it here if you have very special# needs, such us huge multi/exec requests or alike.## client-query-buffer-limit 1gb
# Enabled active defragmentation# activedefrag yes
# Minimum amount of fragmentation waste to start active defrag# active-defrag-ignore-bytes 100mb
# Minimum percentage of fragmentation to start active defrag# active-defrag-threshold-lower 10
# Maximum percentage of fragmentation at which we use maximum effort# active-defrag-threshold-upper 100
以上就是土嘎嘎小编为大家整理的docker redis安装及配置_外网访问 关闭安全限制 设置密码)相关主题介绍,如果您觉得小编更新的文章只要能对粉丝们有用,就是我们最大的鼓励和动力,不要忘记讲本站分享给您身边的朋友哦!!