# 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 # bind 192.168.1.100 10.0.0.1 bind 127.0.0.1 # Protected mode is a layer of security protection protected-mode yes # Accept connections on the specified port port 6379 # Close the connection after a client is idle for N seconds (0 to disable) timeout 300 # TCP keepalive. tcp-keepalive 60 # Set the number of databases. databases 16 # By default Redis does not run as a daemon. Use 'yes' if you need it. daemonize no # If you run Redis from upstart or systemd, Redis can interact with your # supervision tree. Options: supervised no, supervised upstart, supervised systemd, supervised auto supervised no # Specify the pid file name. pidfile /var/run/redis/redis-server.pid # 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 log file name. Also the empty string can be used to force # Redis to log on the standard output. logfile /var/log/redis/redis-server.log # To enable logging to the system logger, just set 'syslog-enabled' to yes, # and optionally update the other syslog parameters to suit your needs. syslog-enabled no # Set the number of databases. The default database is DB 0, you can select # a different one on a per-connection basis using SELECT where # dbid is a number between 0 and 'databases'-1 databases 16 # By default Redis shows an ASCII art logo only when started to log to the # standard output and if the standard output is a TTY. Basically this means # that normally a logo is displayed only in interactive sessions. always-show-logo no # Set the process title visible by tools like ps and top. set-proc-title yes ################################ SNAPSHOTTING ################################ # Save the DB on disk: # save save 900 1 save 300 10 save 60 10000 stop-writes-on-bgsave-error yes # Compress string objects using LZF when dump .rdb databases? rdbcompression yes # Since version 5 of RDB a CRC64 checksum is placed at the end of the file. rdbchecksum yes # The filename where to dump the DB dbfilename dump.rdb # The working directory. The DB will be written inside this directory, with # the filename specified above using the 'dbfilename' configuration directive. dir /var/lib/redis ############################## REPLICATION ################################# # Master-Replica replication. Use replicaof to make a Redis instance a copy of # another Redis server. A few things to understand ASAP about Redis replication. # +------------------+ +---------------+ # | Master | ---> | Replica | # | (receive writes) | | (exact copy) | # +------------------+ +---------------+ replicaof 192.168.1.50 6379 # If the master is password protected (using the "requirepass" configuration # directive below) it is possible to tell the replica to authenticate before # starting the replication synchronization process, otherwise the master will # refuse the replica request. masterauth SuperSecretMasterPass123 ############################## SECURITY ################################### # Require clients to issue AUTH before processing any other # commands. requirepass StrongPassword123! # ACL # Using an external ACL file aclfile /etc/redis/users.acl # Or define users directly in config file user worker on +@all ~* >workerpass user readonly off -@all +get +mget ################################### LIMITS #################################### # Set the max number of connected clients at the same time. maxclients 10000 # Don't use more memory than the specified amount of bytes. maxmemory 256mb # MAXMEMORY POLICY: how Redis will select what to remove when maxmemory # is reached. maxmemory-policy allkeys-lru ############################## APPEND ONLY MODE ############################### appendonly yes appendfsync everysec # The name of the append only file (default: "appendonly.aof") appendfilename "appendonly.aof" ############################### ADVANCED CONFIG ############################### # Redis supports loading modules at startup. loadmodule /usr/lib/redis/modules/redisbloom.so # Include one or more other config files. include /etc/redis/redis-local.conf