In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
# General #
# start the background process
Daemonize yes
# pid file storage location of background process
Pidfile / var/run/redis.pid
# default listening port
Port 6379
# in a highly concurrent environment, in order to avoid the connection problem of slow clients, you need to set up a high-speed background log
Tcp-backlog 511
# only accept the following bound IP requests
# Examples:
# bind 192.168.1.100 10.0.0.1
Bind 127.0.0.1
# set unix snooping. Default is empty.
# unixsocket / tmp/redis.sock
# unixsocketperm 700
# how long will the client be idle? close the link. 0 means not.
Timeout 0
# TCP keepalive.
# if it is a non-zero value, when the link is lost, the TCP ACKs will be sent to the client using SO_KEEPALIVE.
# this parameter has two functions:
# 1. Detect breakpoints.
# 2. From the point of view of the network intermediary device, it is to keep the link
# on Linux, the set time is the cycle of sending ACKs.
# Note: the link will not be closed until double the set time. On other kernels, cycles depend on kernel settings.
# A reasonable value is 60s
Tcp-keepalive 0
# specify the log level, and the following recording information decreases in turn
# debug for development / testing
# verbose is not as detailed as debug
# notice is suitable for production line
# warning only records very important information
Loglevel notice
# Log file name. If it is stdout, it will be output to the standard output side. If it is run as a background process, no log will be generated.
Logfile ""
# to enable the system logger, set the option to yes
# syslog-enabled no
# indicate syslog identity
# syslog-ident redis
# indicates the syslog device. Must be a user or one of local0 ~ local7
# syslog-facility local0
# set the number of databases. The first database is numbered as 0
Databases 16
# snapshot #
# under what conditions to save the database to disk, there can be many conditions, and snapshot storage will be carried out if any of the conditions are met
# there is a change in key within 900 seconds
Save 900 1
# within 300 seconds, there are 10 key changes
Save 300 10
# 10000 key changes in 60 seconds
Save 60 10000
# whether to continue to provide services when persistence fails
Stop-writes-on-bgsave-error yes
# whether to use LZF algorithm to compress data when writing to disk. Default is yes.
Rdbcompression yes
# whether to add CRC64 check to the end of each file-take time to ensure security
Rdbchecksum yes
# Save name of the database on disk
Dbfilename dump.rdb
# Redis working directory, which will be written to the above database files and AOF logs
Dir. /
# Master-slave synchronization #
# Master-slave replication, configured when the local machine is slave
# slaveof
# configure when the host needs password authentication
# masterauth
# when slave and master lose links or are in the process of synchronizing. Whether to respond to client requests
# set to yes to indicate response
# set it to no and return "SYNC with master in progress" directly (synchronizing with the master server)
Slave-serve-stale-data yes
# set whether slave is read-only.
# Note: even if slave is set to read-only, it cannot be exposed to an untrusted network environment
Slave-read-only yes
# No hard disk copy function
Repl-diskless-sync no
# interval between waiting for multiple slave to request together
Repl-diskless-sync-delay 5
# set the interval for slave to send ping to master
# repl-ping-slave-period 10
# set the data transfer Imax O, the timeout of host data and ping response. Default is 60s.
# this time must be larger than that of repl-ping-slave-period, otherwise timeouts will be detected continuously
# repl-timeout 60
# do you want to disable TCP_NODELAY on slave socket after SYNC?
# if you set it to yes,Redis, you will use a small amount of TCP messages and a small amount of bandwidth to send data to slave.
# but this will cause a delay on the slave side. If you use the default settings of the Linux kernel, about 40 milliseconds.
# if you set it to no, the research on the Slave side will be reduced, but the synchronization bandwidth will increase.
# by default, we are optimized for low latency.
# however, if the traffic is particularly heavy or the master and slave servers are far apart, it is reasonable to set it to yes.
Repl-disable-tcp-nodelay no
# set the background log size for replication.
# the larger the background log of replication, the longer it will take for slave to disconnect and possibly perform partial replication later.
# backend logs are allocated only once when there is at least one slave connection.
# repl-backlog-size 1mb
# after master no longer connects to slave, the backend log will be released. The following configuration defines the time (in seconds) to be released after being disconnected from the last slave.
# 0 means that background logs are never released
# repl-backlog-ttl 3600
# set slave priority. Default is 100.
# when the primary server does not work correctly, the low number is first promoted to the primary server, but 0 is disabled.
Slave-priority 100
# if there are less than N slave connections, and the delay time randomly removes a key with an expired Peugeot
# allkeys-random-> randomly remove a key
# volatile-ttl-> remove key that is about to expire recently
# noeviction-> do not delete key. An error is returned when there is a write request.
# default setting is volatile-lru
# maxmemory-policy noeviction
# LRU and minimum TTL algorithms are not accurately implemented
# to save memory and only select the least recently used key within a sample range, you can set the sample size
# maxmemory-samples 5
# AO mode #
# AOF and RDB persistence can be enabled simultaneously
# Redis reads AOF files when it starts, and AOF files have a better guarantee of persistence
Appendonly no
# the save name of AOF. Default is appendonly.aof.
Appendfilename "appendonly.aof"
# set when to write the append log, and three more modes
# no: indicates that the operating system decides when to write. The best performance, but the lowest reliability
# everysec: indicates that a write is performed every second. Compromise, recommended
# always: indicates that it is written to disk every time. The performance is the worst, which is safer than the above.
# appendfsync always
Appendfsync everysec
# appendfsync no
# when the AOF synchronization policy is set to alway or everysec
# when background storage process (background storage or AOF log background writing) will incur a lot of disk overhead
# some Linux configurations can cause Redis to block for a long time because of fsync () calls
# there are no patches yet, and even using different threads for fsync will block our synchronous write (2) calls.
# to alleviate this problem, use the following options when a BGSAVE or BGREWRITEAOF runtime
# can prevent fsync () from being called in the main program
No-appendfsync-on-rewrite no
# AOF automatic rewrite (merge command to reduce log size)
# when the AOF log size increases to a specific ratio, Redis calls BGREWRITEAOF to automatically rewrite the log file
# principle: Redis records the file size of the AOF file after the last rewrite.
# if you have just started, record the AOF size at startup
# this basic size will be used to compare with the current size. If the current size is larger than a certain ratio, an override is triggered.
# you also need to specify a minimum AOF that needs to be rewritten to avoid reaching the ratio.
# but rewrite the AOF file when the AOF file is still very small.
# set to 0 to disable automatic rewriting
Auto-aof-rewrite-percentage 100
Auto-aof-rewrite-min-size 64mb
# redis can load truncated AOF files at startup without first executing the redis-check-aof tool
Aof-load-truncated yes
# LUA script #
# maximum execution time of Lua script (in milliseconds)
# an error will be reported after timeout and will be counted in the log
# when the running time of a script exceeds the maximum execution time
# only SCRIPT KILL and SHUTDOWN NOSAVE commands can be used.
# SCRIPT KILL is used to stop scripts that do not call write commands.
# SHUTDOWN NOSAVE is the only one where the script write command is being executed
# the method of shutting down the server when the user does not want to wait for the normal end of the script.
# setting the following option to 0 or a negative number will remove the script execution time limit
Lua-time-limit 5000
# redis Cluster #
# whether to enable clustering
# cluster-enabled yes
# Cluster configuration file
# automatically write the change file when the cluster configuration is changed
# cluster-config-file nodes-6379.conf
# threshold for node interconnection timeout
# Node timeout, after which the primary Master node cannot be connected, the query service will be stopped.
# cluster-node-timeout 15000
# controls the settings related to FailOver from the slave node, set to 0, and the slave node will always try to start FailOver.
# set it to a positive number, lose contact for more than a certain period of time (factor* node TimeOut), and no longer perform FailOver
# cluster-slave-validity-factor 10
# minimum number of slave node connections
# cluster-migration-barrier 1
# default is Yes. After a certain percentage of Key is lost (Node may not be able to connect or hang up), the cluster stops accepting write operations
# set to No, and provide query service even if the cluster loses Key
# cluster-require-full-coverage yes
# slow query #
# Redis slow query logs record queries that exceed the set time, and only record the time when the command is executed
# do not record Icano operations, such as interacting with the client, sending replies, etc.
# time in subtlety, 1000000 subtleties = 1 second
# setting it to a negative number disables the slow query log, while setting it to 0 records all query commands
Slowlog-log-slower-than 10000
There is no limit to the length of the log, but it consumes memory. When the log length is exceeded, the oldest record is removed
# use the SLOWLOG RESET command to reclaim memory
Slowlog-max-len 128
# delay monitoring #
# the system only records operations that exceed the set value (in milliseconds). 0 means to disable this feature.
# can be set directly with the command "CONFIG SET latency-monitor-threshold" without the need to restart redis
Latency-monitor-threshold 0
# event notification #
# Redis can notify the Pub/Sub client when an event occurs.
# you can select the type of event to be notified by Redis in the following table. The event type is identified by a single character:
# K Keyspace event, published with the prefix of _ keyspace@_
# E Keyevent event, published with the prefix of _ keysevent@_
# g generic events (no type specified), such as DEL, EXPIRE, RENAME, …
# $String command
# s Set command
# h Hash command
# z ordered collection command
# x Expiration event (generated each time key expires)
# e clear event (generated when key is cleared of memory)
A nickname for g$lshzxe, so "AKE" means all events
# notify-keyspace-events takes a string parameter consisting of 0 to multiple characters. An empty string means that notification is disabled.
# example: enable list and generic events:
# notify-keyspace-events Elg
# the notification used by default is disabled because the user usually does not need to change the feature, and the feature has a performance penalty.
# Note if you do not specify at least one of K or E, no events will be sent.
Notify-keyspace-events ""
# notify-keyspace-events AKE
# Advanced Settings #
# Hash uses efficient in-memory data structures when there are a small number of entries. The largest entry cannot exceed the set threshold. # "small amount" is defined as follows:
Hash-max-ziplist-entries 512
Hash-max-ziplist-value 64
# like hash coding, a small number of lists are encoded in a special way to save memory. The "few" settings are as follows:
List-max-ziplist-entries 512
List-max-ziplist-value 64
# collections use special encoding to save memory only in the following cases
The #-- > collection consists entirely of strings of 64-bit signed decimal integers
The options below set the size of this particular collection.
Set-max-intset-entries 512
# when the length and elements of the ordered set are set to the following numbers, special coding saves memory
Zset-max-ziplist-entries 128
Zset-max-ziplist-value 64
# HyperLogLog sparse indicates byte limit
# this limit contains 16-byte headers, when a HyperLogLog uses sparse representation
# beyond this display, it will be converted to dense representation
Hll-sparse-max-bytes 3000
# Hash refresh uses 1 millisecond out of every 100 CPU milliseconds to help refresh the main hash table (top-level key-value mapping table).
The # Redis hash table uses a delayed refresh mechanism. The more operations, the more refreshes.
# if the server is idle, the refresh operation will not take place and more memory will be consumed by the hash table
# by default, the main dictionary is refreshed 10 times per second to free memory.
# if you have a hard delay and the occasional 2 millisecond delay is unbearable. Set to no
# otherwise set to yes
Activerehashing yes
# client output cache limit forced to disconnect clients with slow reading speed
# there are three types of restrictions
# normal-> normal
# slave-> slave and MONITOR
# pubsub-> client subscribes to at least one channel or mode
# the syntax of client output cache limit is as follows (time unit: seconds)
# client-output-buffer-limit
# if you reach the mandatory limit on the cache size, disconnect the link immediately.
# when the soft limit is reached, there will still be a link time of soft time.
# by default, the normal client has no limit. Only after the request, the asynchronous client requests data faster than it can read the data.
# subscription mode and master-slave clients are restricted by default because they both accept push.
# both mandatory and soft limits can be set to 0 to disable this feature
Client-output-buffer-limit normal 0 0 0
Client-output-buffer-limit slave 256mb 64mb 60
Client-output-buffer-limit pubsub 32mb 8mb 60
# set the frequency of Redis background tasks, such as clearing expired keys.
# the range is 1 to 500, and the default is 10. The greater the CPU consumption, the smaller the latency.
# it is recommended not to exceed 100
Hz 10
# when the child process rewrites the AOF file, when the following option is enabled, the AOF file will be synchronized every 32 megabytes.
# this helps to write files to disk faster to avoid latency
Aof-rewrite-incremental-fsync yes
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.