# Detailed description of the redis configuration file, for 2.6.3 -- 2.6.7
# Note on units: when memory size is needed, it is possible to specify
# It in the usual form of 1 k 5 GB 4 M and so forth:
#
#1 k = & gt; 1000 bytes
# 1kb => 1024 bytes
#1 m => 1000000 bytes
#1 mb => 1024*1024 bytes
#1g => 1000000000 bytes
#1 gb => 1024*1024*1024 bytes
#
# Units are case insensitive so 1 GB 1 Gb 1 gB are all the same.
# Redis is not run as a daemon by default. You can set this to "yes" to run as a daemon.
# Note: when used as a daemon, Redis writes the process ID to/var/run/redis. pid.
Daemonize yes
# When running as a daemon, Redis writes the process ID to/var/run/redis. pid by default. You can modify the path here.
Pidfile/var/run/redis. pid
# The port that accepts the connection. The default value is 6379.
# If the port is set to 0, Redis will not listen to TCP sockets
Port 6379
# If the port is set to 0, Redis will not listen to TCP sockets
Port 6379
# If you want to bind a single interface, if not set separately, all interfaces will be listened.
#
# Bind 127.0.0.1
# Specify the path for listening to the connected unxi socket. There is no default value for this, so if you do not specify it, Redis will not pass the unix socket
# Unixsocket/tmp/redis. sock
# Unixsocketperm 755
# How many seconds after a client is idle. (0 indicates disabled and never disabled)
Timeout 0
# Set the server debugging level.
# Debug (a lot of information, useful for development/Testing)
# Verbose (many simple and useful information, but not as many debug levels)
# Notice)
# Warning (only important/serious information is recorded)
Loglevel notice
# Specify the log file name. You can also use "stdout" to force Redis to write log information to the standard output.
# Note: If Redis runs as a daemon, and you set the log to display the standard output, the log will be sent to/dev/null.
Logfile stdout
# It is easy to use the system logger. You only need to set "syslog-enabled" to "yes.
# Set other syslog parameters as needed.
# Syslog-enabled no
# Specify syslog identity
# Syslog-ident redis
# Specify the syslog device. It must be a user or LOCAL0 ~ LOCAL7.
# Syslog-facility local0
# Set the number of databases. The default database is DB 0. You can use SELECT <dbid> WHERE dbid (0 ~ 'Databases'-1) to select a server for each link
Databases 16
################################ Snapshot ####### #################
# Save the database to the disk:
# Save <seconds> <changes>
#
# The database will be written to the disk after the specified number of seconds and the number of data changes.
#
# The following example writes data to the disk:
# After 900 seconds (15 minutes), and at least one change
# After 300 seconds (5 minutes), and at least 10 Changes
#60 seconds later, and at least 10000 changes
#
# Note: if you do not want to write a disk, just comment out all the "save" settings.
# Save 900 1
Save 300 30
# Save 60 10000
# Stop writing due to a storage error in the background.
Stop-writes-on-bgsave-error yes
# Whether to use LZF to compress string objects when exporting data to the. rdb database.
# The default value is "yes", so it almost always takes effect.
# If you want to save CPU, you can set this to "no", but if you have compress keys, the data file will be larger.
Rdbcompression yes
# Since verison 5 of RDB a CRC64 checksum is placed at the end of the file.
# This makes the format more resistant to upload uption but there is a performance
# Hit to pay (around 10%) when saving and loading RDB files, so you can disable it
# For maximum performances.
#
# Verify when storing and loading rdb files.
Rdbchecksum yes
# Database file name
Dbfilename dump. rdb
# Working directory
# The database will write to this directory, and the file name is the value of "dbfilename" above.
# Add files here.
# Note that you must specify a directory instead of a file name.
Dir ./
################################# Synchronization ###### ###########################
#
# Master-slave Synchronization. Use slaveof configuration to back up Redis instances.
# Note: Data is locally copied from the remote end. That is to say, local hosts can have different database files, bind different IP addresses, and listen on different ports.
#
# Slaveof <masterip> <masterport>
# If the master has set a password (configured using the "requirepass" option below), slave must perform authentication before starting synchronization, otherwise its synchronization request will be rejected.
#
# Masterauth <master-password>
# When an slave loses its connection to the master or the synchronization is in progress, there are two possible slave actions:
#
#1) If slave-serve-stale-data is set to "yes" (default), slave will continue to respond to client requests, which may be normal data, it may also be that empty data has not yet been obtained.
#2) If slave-serve-stale-data is set to "no", slave will reply "synchronizing with master in progress" to process various requests, besides the INFO and SLAVEOF commands.
Slave-serve-stale-data yes
# If yes, the slave instance is read-only. If no, the slave instance can be read and written.
Slave-read-only yes
# Slave sends a ping request to the server based on the specified interval.
# The time interval can be set through repl_ping_slave_period.
# The default value is 10 seconds.
#
# Repl-ping-slave-period 10
# The options below set the expiration time for large data I/O, Data Request to master, and ping response.
# The default value is 60 seconds.
#
# Make sure that the value is greater than repl-ping-slave-period. Otherwise, the transmission expiration time between the master and slave is shorter than expected.
# Repl-timeout 60
# If the master node cannot work normally, in multiple Server Load balancer instances, select one Server Load balancer instance with the smallest priority value as the master node. If the priority value is 0, the master node cannot be upgraded.
Slave-priority 100
Redis details: click here
Redis: click here
Recommended reading:
Redis cluster details
Install Redis in Ubuntu 12.10 (graphic explanation) + Jedis to connect to Redis
Redis series-installation, deployment, and maintenance
Install Redis in CentOS 6.3
Redis. conf