日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

Redis系列(一)--安装、helloworld以及读懂配置文件

發(fā)布時(shí)間:2024/1/18 数据库 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Redis系列(一)--安装、helloworld以及读懂配置文件 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

再開個(gè)redis系列,本系列打算不詳細(xì)講一系列的命名的了(會(huì)推薦別人寫的,人家寫的夠詳細(xì)了),我直接就是做redis方案提供,當(dāng)然一開始還是講下helloworld和配置文件好了。會(huì)逐步更新,歡迎關(guān)注。

文章結(jié)構(gòu):

(1)安裝;
(2)helloworld;
(3)解析配置文件(一一羅列方便復(fù)習(xí));
(4)重點(diǎn)配置


一、安裝:把到官網(wǎng)下載好的redis壓縮包放置到你想要的位置。并解壓。

然后進(jìn)入redis-3.0.4目錄,執(zhí)行make命令

jackfrost@jackfrost-pc:~/MyResource/Redis/redis-3.0.4$ make

問題:

如果遇到gcc沒找到,那么請(qǐng)看以下說明:

原因:

redis是c語音編寫的,需要gcc環(huán)境支持。

gcc是linux下的一個(gè)編譯程序,是c程序的編譯工具。GCC是GNU計(jì)劃提供的編譯器家族,支持C,C++,Objective-C,Java等多語音,同時(shí)能運(yùn)行在x86,x86-64,IA-64,PowerPC等幾乎所有硬件平臺(tái)。

解決:一個(gè)安裝命令(centos下的命令)

yum install gcc-c++

二、helloworld:

(1)關(guān)注第一個(gè)目錄!/usr

這是一個(gè)重要目錄,用戶的很多應(yīng)用程序和文件都放在這個(gè)目錄下面,類似windows的program file目錄

而我們的redis安裝好后,一般就是在/usr/local/bin下面啦

(2)關(guān)注的第二個(gè)目錄:

我們在玩redis,當(dāng)然關(guān)注自己的redis目錄啦!!,同時(shí)重點(diǎn)關(guān)注reids.conf

注意,一般我們不直接操作我們安裝好的reids配置文件,因?yàn)樗苤匾?#xff0c;關(guān)乎生死,redis架構(gòu)好壞。

(3)于是為了安全,我們要另建一個(gè)目錄去操作redis.conf

然后就把原來的那個(gè)redis.conf復(fù)制到我們新建的目錄嘛

想要多少份就多少份,反正操作對(duì)應(yīng)好的配置文件就ok啦。

redis關(guān)鍵:能備份的先備份

(4)修改配置文件

把此處的no改成yes
意思是:默認(rèn)情況下 redis 不是作為守護(hù)進(jìn)程運(yùn)行的,如果你想讓它在后臺(tái)運(yùn)行,你就把它改成 yes。我們必須保證它不被殺死!!!

(5)啟動(dòng)并觀察redis進(jìn)程

使用下面命令可以看到,現(xiàn)在并沒有開啟redis嘛。

那么我們就啟動(dòng)他嘛,進(jìn)入/usr/local/bin目錄

要求:1.找到我們剛剛復(fù)制并修改過來的redis.conf全路徑,使用redis-server命令;2. 1的命令啟動(dòng)后沒有報(bào)錯(cuò),繼續(xù)使用redis-cli -p 6379 命令,ping連接一下。返回pong即成功啟動(dòng)!

這個(gè)時(shí)候我們再來觀察redis的進(jìn)程:就可以看到啦

于是我們就可以開始寫我們熟悉的helloworld啦!

先暫時(shí)給個(gè)常見錯(cuò)誤解決:

錯(cuò)誤)misconf redis被配置以保存數(shù)據(jù)庫快照,但misconf redis目前不能在硬盤上持久化。用來修改數(shù)據(jù)集合的命令不能用,請(qǐng)使用日志的錯(cuò)誤詳細(xì)信息。

原因:

這是由于強(qiáng)制停止redis快照,不能持久化引起的。edis在保存數(shù)據(jù)到硬盤時(shí)為了避免主進(jìn)程假死,需要Fork一份主進(jìn)程,然后在Fork進(jìn)程內(nèi)完成數(shù)據(jù)保存到硬盤的操作,如果主進(jìn)程使用了4GB的內(nèi)存,Fork子進(jìn)程的時(shí)候需要額外的4GB,此時(shí)內(nèi)存就不夠了,Fork失敗,進(jìn)而數(shù)據(jù)保存硬盤也失敗了。

解決:

config set stop-writes-on-bgsave-error no 命令來關(guān)閉配置項(xiàng)stop-writes-on-bgsave-error。詳細(xì)解析


三、解析配置文件:

一開始就先全部羅列解析一次吧(其實(shí)是基本的翻譯啦),,不過下面會(huì)有重點(diǎn)關(guān)注提醒!!

# Redis configuration file example //redis 配置文件示例 # Note on units: when memory size is needed, it is possible to specify //當(dāng)你需要為某個(gè)配置項(xiàng)指定內(nèi)存大小的時(shí)候,必須要帶上單位 # it in the usual form of 1k 5GB 4M and so forth: //通常的格式就是 1k 5gb 4m # 1k => 1000 bytes # 1kb => 1024 bytes # 1m => 1000000 bytes # 1mb => 1024*1024 bytes # 1g => 1000000000 bytes # 1gb => 1024*1024*1024 bytes # # units are case insensitive so 1GB 1Gb 1gB are all the same. //單位是不區(qū)分大小寫的,你寫 1K 5GB 4M 也行 ################################## INCLUDES ################################### # Include one or more other config files here. This is useful if you # have a standard template that goes to all Redis servers but also need //假如說你有一個(gè)可用于所有的 redis server 的標(biāo)準(zhǔn)配置模板, # to customize a few per-server settings. Include files can include # other files, so use this wisely. //但針對(duì)某些 server 又需要一些個(gè)性化的設(shè)置,可以使用 include 來包含一些其他的配置文件,這對(duì)你來說是非常有用的。 # Notice option "include" won't be rewritten by command "CONFIG REWRITE" //但是要注意,include 是不能被 config rewrite 命令改寫的 # from admin or Redis Sentinel. Since Redis always uses the last processed //由于 redis 總是以最后的加工前作為一個(gè)配置指令值,所以你最好是把 include 放在這個(gè)文件的最前面,以避免在運(yùn)行時(shí)覆蓋配置的改變,相反,你就把它放在后面 # line as value of a configuration directive, you'd better put includes # at the beginning of this file to avoid overwriting config change at runtime. //如果您感興趣的是使用包括重寫配置選項(xiàng),最好使用include作為最后一行。 # If instead you are interested in using includes to override configuration # options, it is better to use include as the last line. # # include /path/to/local.conf # include /path/to/other.conf################################ GENERAL常用 ##################################### //默認(rèn)情況下 redis 不是作為守護(hù)進(jìn)程運(yùn)行的,如果你想讓它在后臺(tái)運(yùn)行,你就把它改成 yes。 # By default Redis does not run as a daemon. Use 'yes' if you need it. //當(dāng)redis作為守護(hù)進(jìn)程運(yùn)行的時(shí)候,它會(huì)寫一個(gè) pid 到 /var/run/redis.pid 文件里面。 # Note that Redis will write a pid file in /var/run/redis.pid when daemonized. daemonize no //當(dāng)redis作為守護(hù)進(jìn)程運(yùn)行的時(shí)候,它會(huì)把 pid 默認(rèn)寫到 /var/run/redis.pid 文件里面,但是你可以在這里自己制定它的文件位置。 # When running daemonized, Redis writes a pid file in /var/run/redis.pid by # default. You can specify a custom pid file location here. pidfile /var/run/redis.pid //監(jiān)聽端口號(hào),默認(rèn)為 6379,如果你設(shè)為 0 ,redis 將不在 socket 上監(jiān)聽任何客戶端連接。 # Accept connections on the specified port, default is 6379. # If port 0 is specified Redis will not listen on a TCP socket. port 6379 //TCP 監(jiān)聽的最大容納數(shù)量 # TCP listen() backlog. //在高并發(fā)的環(huán)境下,你需要把這個(gè)值調(diào)高以避免客戶端連接緩慢的問題。 # In high requests-per-second environments you need an high backlog in order # to avoid slow clients connections issues. Note that the Linux kernel # will silently truncate it to the value of /proc/sys/net/core/somaxconn so //Linux 內(nèi)核會(huì)一聲不響的把這個(gè)值縮小成 /proc/sys/net/core/somaxconn 對(duì)應(yīng)的值,所以你要修改這兩個(gè)值才能達(dá)到你的預(yù)期。 # make sure to raise both the value of somaxconn and tcp_max_syn_backlog # in order to get the desired effect. tcp-backlog 511 //默認(rèn)情況下,redis 在 server 上所有有效的網(wǎng)絡(luò)接口上監(jiān)聽客戶端連接。 //你如果只想讓它在一個(gè)網(wǎng)絡(luò)接口上監(jiān)聽,那你就綁定一個(gè)IP或者多個(gè)IP。 # By default Redis listens for connections from all the network interfaces # available on the server. It is possible to listen to just one or multiple //示例,多個(gè)IP用空格隔開 # interfaces using the "bind" configuration directive, followed by one or # more IP addresses. # # Examples: # # bind 192.168.1.100 10.0.0.1 # bind 127.0.0.1 //指定 unix socket 的路徑。 # Specify the path for the Unix socket that will be used to listen for # incoming connections. There is no default, so Redis will not listen # on a unix socket when not specified. # # unixsocket /tmp/redis.sock # unixsocketperm 700 //指定在一個(gè) client 空閑多少秒之后關(guān)閉連接(0 就是不管它) # Close the connection after a client is idle for N seconds (0 to disable) timeout 0 //tcp 心跳包。 # TCP keepalive. //如果設(shè)置為非零,則在與客戶端缺乏通訊的時(shí)候使用 SO_KEEPALIVE 發(fā)送 tcp acks 給客戶端。 # If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence //這個(gè)之所有有用,主要由兩個(gè)原因: //1.防止死的 peers //2.從網(wǎng)絡(luò)的角度看連接的活躍性中間設(shè)備。 # of communication. This is useful for two reasons: # # 1) Detect dead peers. # 2) Take the connection alive from the point of view of network # equipment in the middle. # # On Linux, the specified value (in seconds) is the period used to send ACKs. # Note that to close the connection the double of the time is needed. # On other kernels the period depends on the kernel configuration. //推薦一個(gè)合理的值就是60秒 # A reasonable value for this option is 60 seconds. tcp-keepalive 0 //定義日志級(jí)別。 # Specify the server verbosity level. # This can be one of: //可以是下面的這些值: //debug (適用于開發(fā)或測試階段) # debug (a lot of information, useful for development/testing) //基本不用的級(jí)別.許多很少有用的信息,但不是像調(diào)試級(jí)別混亂 # verbose (many rarely useful info, but not a mess like the debug level) // (適用于生產(chǎn)環(huán)境) # 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. Note that if you use standard # output for logging but daemonize, logs will be sent to /dev/null //指定日志文件的位置 logfile "" //要想把日志記錄到系統(tǒng)日志,就把它改成 yes, # To enable logging to the system logger, just set 'syslog-enabled' to yes, //也可以可選擇性的更新其他的syslog 參數(shù)以達(dá)到你的要求 # and optionally update the other syslog parameters to suit your needs. # syslog-enabled no //設(shè)置 syslog 的 identity。 # Specify the syslog identity. # syslog-ident redis //設(shè)置 syslog 的 facility,必須是 USER 或者是 LOCAL0-LOCAL7 之間的值。 # Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7. # syslog-facility local0 //設(shè)置數(shù)據(jù)庫的數(shù)目。默認(rèn)數(shù)據(jù)庫是 DB 0,你可以在每個(gè)連接上使用 select <dbid> 命令選擇一個(gè)不同的數(shù)據(jù)庫, # Set the number of databases. The default database is DB 0, you can select # a different one on a per-connection basis using SELECT <dbid> where //但是 dbid 必須是一個(gè)介于 0 到 databasees - 1 之間的值 # dbid is a number between 0 and 'databases'-1 databases 16################################ SNAPSHOTTING快照 ################################ //存 DB 到磁盤: # Save the DB on disk: //格式:save <間隔時(shí)間(秒)> <寫入次數(shù)> # save <seconds> <changes> //根據(jù)給定的時(shí)間間隔和寫入次數(shù)將數(shù)據(jù)保存到磁盤 # Will save the DB if both the given number of seconds and the given # number of write operations against the DB occurred. //下面的例子的意思是: /* 900 秒內(nèi)如果至少有 1 個(gè) key 的值變化,則保存 300 秒內(nèi)如果至少有 10 個(gè) key 的值變化,則保存 60 秒內(nèi)如果至少有 10000 個(gè) key 的值變化,則保存 */ # In the example below the behaviour will be to save: # after 900 sec (15 min) if at least 1 key changed # after 300 sec (5 min) if at least 10 keys changed # after 60 sec if at least 10000 keys changed //注意:你可以注釋掉所有的 save 行來停用保存功能,也可以直接一個(gè)空字符串來實(shí)現(xiàn)停用. # Note: you can disable saving completely by commenting out all "save" lines. # # It is also possible to remove all the previously configured save # points by adding a save directive with a single empty string argument # like in the following example: # # save ""save 900 1 save 300 10 save 60 10000 /*默認(rèn)情況下,如果 redis 最后一次的后臺(tái)保存失敗,redis 將停止接受寫操作,這樣以一種強(qiáng)硬的方式讓用戶知道數(shù)據(jù)不能正確的持久化到磁盤,否則就會(huì)沒人注意到災(zāi)難的發(fā)生。 */ # By default Redis will stop accepting writes if RDB snapshots are enabled # (at least one save point) and the latest background save failed. # This will make the user aware (in a hard way) that data is not persisting # on disk properly, otherwise chances are that no one will notice and some # disaster will happen. //如果后臺(tái)保存進(jìn)程重新啟動(dòng)工作了,redis 也將自動(dòng)的允許寫操作。 # If the background saving process will start working again Redis will # automatically allow writes again. //然而你要是安裝了靠譜的監(jiān)控,你可能不希望 redis 這樣做,那你就改成 no 好了。或者您可能希望禁用此功能,Redis會(huì)繼續(xù)工作,即使磁盤有問題。 # However if you have setup your proper monitoring of the Redis server # and persistence, you may want to disable this feature so that Redis will # continue to work as usual even if there are problems with disk, # permissions, and so forth. stop-writes-on-bgsave-error yes //是否在 dump .rdb 數(shù)據(jù)庫的時(shí)候使用 LZF 壓縮字符串 # Compress string objects using LZF when dump .rdb databases? //默認(rèn)都設(shè)為 yes # For default that's set to 'yes' as it's almost always a win. //如果你希望保存子進(jìn)程節(jié)省點(diǎn) cpu ,你就設(shè)置它為 no , # If you want to save some CPU in the saving child set it to 'no' but //不過這個(gè)數(shù)據(jù)集可能就會(huì)比較大 # the dataset will likely be bigger if you have compressible values or keys. rdbcompression yes# Since version 5 of RDB a CRC64 checksum is placed at the end of the file. # This makes the format more resistant to corruption but there is a performance # hit to pay (around 10%) when saving and loading RDB files, so you can disable it # for maximum performances. # # RDB files created with checksum disabled have a checksum of zero that will # tell the loading code to skip the check. //是否校驗(yàn)rdb文件 rdbchecksum yes //設(shè)置 dump 的文件位置 # The filename where to dump the DB dbfilename dump.rdb //工作目錄 # The working directory. //例如上面的 dbfilename 只指定了文件名, # The DB will be written inside this directory, with the filename specified # above using the 'dbfilename' configuration directive. # # The Append Only File will also be created inside this directory. //但是它會(huì)寫入到這個(gè)目錄下。這個(gè)配置項(xiàng)一定是個(gè)目錄,而不能是文件名。 # Note that you must specify a directory here, not a file name. dir ./################################# REPLICATION主從復(fù)制 ################################# //主從復(fù)制。使用 slaveof 來讓一個(gè) redis 實(shí)例成為另一個(gè)reids 實(shí)例的副本。 //注意這個(gè)只需要在 slave 上配置。 # Master-Slave replication. Use slaveof to make a Redis instance a copy of # another Redis server. A few things to understand ASAP about Redis replication. //對(duì)redis復(fù)制需要了解: //Redis復(fù)制是異步的,但你可以配置一個(gè)主停止接受寫入,如果它似乎與至少一個(gè)給定數(shù)量的叢屬?zèng)]有連接。 # 1) Redis replication is asynchronous, but you can configure a master to # stop accepting writes if it appears to be not connected with at least # a given number of slaves. //Redis從屬可以執(zhí)行部分同步主redis,如果復(fù)制鏈路則丟失相對(duì)少量的時(shí)間。 # 2) Redis slaves are able to perform a partial resynchronization with the # master if the replication link is lost for a relatively small amount of //你可以配置復(fù)制積壓大小,并根據(jù)需要選擇合理的值。 # time. You may want to configure the replication backlog size (see the next # sections of this file) with a sensible value depending on your needs. //復(fù)制是自動(dòng)的,不需要用戶干預(yù)。在網(wǎng)絡(luò)分區(qū)的從屬會(huì)自動(dòng)嘗試重新連接到他們的主redis并同步。 # 3) Replication is automatic and does not need user intervention. After a # network partition slaves automatically try to reconnect to masters # and resynchronize with them. # # slaveof <masterip> <masterport> //如果master設(shè)置了requirepass,那么slave要連上master,需要有master的密碼才行。masterauth就是用來配置master的密碼,這樣可以在連上master后進(jìn)行認(rèn)證。 # If the master is password protected (using the "requirepass" configuration # directive below) it is possible to tell the slave to authenticate before # starting the replication synchronization process, otherwise the master will # refuse the slave request. # # masterauth <master-password> //當(dāng)從庫同主機(jī)失去連接或者復(fù)制正在進(jìn)行,從機(jī)庫有兩種運(yùn)行方式:1) 如果slave-serve-stale-data設(shè)置為yes(默認(rèn)設(shè)置),從庫會(huì)繼續(xù)響應(yīng)客戶端的請(qǐng)求。2) 如果slave-serve-stale-data設(shè)置為no,除去INFO和SLAVOF命令之外的任何請(qǐng)求都會(huì)返回一個(gè)錯(cuò)誤”SYNC with master in progress”。 # When a slave loses its connection with the master, or when the replication # is still in progress, the slave can act in two different ways: # # 1) if slave-serve-stale-data is set to 'yes' (the default) the slave will # still reply to client requests, possibly with out of date data, or the # data set may just be empty if this is the first synchronization. # # 2) if slave-serve-stale-data is set to 'no' the slave will reply with # an error "SYNC with master in progress" to all the kind of commands # but to INFO and SLAVEOF. # slave-serve-stale-data yes /*你可以配置一個(gè) slave 實(shí)體是否接受寫入操作。 通過寫入操作來存儲(chǔ)一些短暫的數(shù)據(jù)對(duì)于一個(gè) slave 實(shí)例來說可能是有用的, 因?yàn)橄鄬?duì)從 master 重新同步數(shù)而言,據(jù)數(shù)據(jù)寫入到 slave 會(huì)更容易被刪除。 但是如果客戶端因?yàn)橐粋€(gè)錯(cuò)誤的配置寫入,也可能會(huì)導(dǎo)致一些問題。 */ # You can configure a slave instance to accept writes or not. Writing against # a slave instance may be useful to store some ephemeral data (because data # written on a slave will be easily deleted after resync with the master) but # may also cause problems if clients are writing to it because of a # misconfiguration. //從 redis 2.6 版起,默認(rèn) slaves 都是只讀的。 # Since Redis 2.6 by default slaves are read-only. # # Note: read only slaves are not designed to be exposed to untrusted clients # on the internet. It's just a protection layer against misuse of the instance. # Still a read only slave exports by default all the administrative commands # such as CONFIG, DEBUG, and so forth. To a limited extent you can improve # security of read only slaves using 'rename-command' to shadow all the # administrative / dangerous commands. //作為從服務(wù)器,默認(rèn)情況下是只讀的(yes),可以修改成NO,用于寫(不建議)。 slave-read-only yes# Replication SYNC strategy: disk or socket. # # ------------------------------------------------------- # WARNING: DISKLESS REPLICATION IS EXPERIMENTAL CURRENTLY # ------------------------------------------------------- /* 是否使用socket方式復(fù)制數(shù)據(jù)。目前redis復(fù)制提供兩種方式,disk和socket。如果新的slave連上來或者重連的slave無法部分同步,就會(huì)執(zhí)行全量同步,master會(huì)生成rdb文件。有2種方式:disk方式是master創(chuàng)建一個(gè)新的進(jìn)程把rdb文件保存到磁盤,再把磁盤上的rdb文件傳遞給slave。socket是master創(chuàng)建一個(gè)新的進(jìn)程,直接把rdb文件以socket的方式發(fā)給slave。disk方式的時(shí)候,當(dāng)一個(gè)rdb保存的過程中,多個(gè)slave都能共享這個(gè)rdb文件。socket的方式就的一個(gè)個(gè)slave順序復(fù)制。在磁盤速度緩慢,網(wǎng)速快的情況下推薦用socket方式。 */ # New slaves and reconnecting slaves that are not able to continue the replication # process just receiving differences, need to do what is called a "full # synchronization". An RDB file is transmitted from the master to the slaves. # The transmission can happen in two different ways: # # 1) Disk-backed: The Redis master creates a new process that writes the RDB # file on disk. Later the file is transferred by the parent # process to the slaves incrementally. # 2) Diskless: The Redis master creates a new process that directly writes the # RDB file to slave sockets, without touching the disk at all. # # With disk-backed replication, while the RDB file is generated, more slaves # can be queued and served with the RDB file as soon as the current child producing # the RDB file finishes its work. With diskless replication instead once # the transfer starts, new slaves arriving will be queued and a new transfer # will start when the current one terminates. # # When diskless replication is used, the master waits a configurable amount of # time (in seconds) before starting the transfer in the hope that multiple slaves # will arrive and the transfer can be parallelized. # # With slow disks and fast (large bandwidth) networks, diskless replication # works better. repl-diskless-sync no# When diskless replication is enabled, it is possible to configure the delay # the server waits in order to spawn the child that transfers the RDB via socket # to the slaves. # # This is important since once the transfer starts, it is not possible to serve # new slaves arriving, that will be queued for the next RDB transfer, so the server # waits a delay in order to let more slaves arrive. # # The delay is specified in seconds, and by default is 5 seconds. To disable # it entirely just set it to 0 seconds and the transfer will start ASAP. //diskless復(fù)制的延遲時(shí)間,防止設(shè)置為0。一旦復(fù)制開始,節(jié)點(diǎn)不會(huì)再接收新slave的復(fù)制請(qǐng)求直到下一個(gè)rdb傳輸。所以最好等待一段時(shí)間,等更多的slave連上來。 repl-diskless-sync-delay 5# Slaves send PINGs to server in a predefined interval. It's possible to change # this interval with the repl_ping_slave_period option. The default value is 10 # seconds. //slave根據(jù)指定的時(shí)間間隔向服務(wù)器發(fā)送ping請(qǐng)求。時(shí)間間隔可以通過 repl_ping_slave_period 來設(shè)置,默認(rèn)10秒 # repl-ping-slave-period 10# The following option sets the replication timeout for: # # 1) Bulk transfer I/O during SYNC, from the point of view of slave. # 2) Master timeout from the point of view of slaves (data, pings). # 3) Slave timeout from the point of view of masters (REPLCONF ACK pings). # # It is important to make sure that this value is greater than the value # specified for repl-ping-slave-period otherwise a timeout will be detected # every time there is low traffic between the master and the slave. //復(fù)制連接超時(shí)時(shí)間。master和slave都有超時(shí)時(shí)間的設(shè)置。master檢測到slave上次發(fā)送的時(shí)間超過repl-timeout,即認(rèn)為slave離線,清除該slave信息。slave檢測到上次和master交互的時(shí)間超過repl-timeout,則認(rèn)為master離線。需要注意的是repl-timeout需要設(shè)置一個(gè)比repl-ping-slave-period更大的值,不然會(huì)經(jīng)常檢測到超時(shí)。 # repl-timeout 60# Disable TCP_NODELAY on the slave socket after SYNC? # # If you select "yes" Redis will use a smaller number of TCP packets and # less bandwidth to send data to slaves. But this can add a delay for # the data to appear on the slave side, up to 40 milliseconds with # Linux kernels using a default configuration. # # If you select "no" the delay for data to appear on the slave side will # be reduced but more bandwidth will be used for replication. # # By default we optimize for low latency, but in very high traffic conditions # or when the master and slaves are many hops away, turning this to "yes" may # be a good idea. //是否禁止復(fù)制tcp鏈接的tcp nodelay參數(shù),可傳遞yes或者no。默認(rèn)是no,即使用tcp nodelay。如果master設(shè)置了yes來禁止tcp nodelay設(shè)置,在把數(shù)據(jù)復(fù)制給slave的時(shí)候,會(huì)減少包的數(shù)量和更小的網(wǎng)絡(luò)帶寬。但是這也可能帶來數(shù)據(jù)的延遲。默認(rèn)我們推薦更小的延遲,但是在數(shù)據(jù)量傳輸很大的場景下,建議選擇yes。 repl-disable-tcp-nodelay no# 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. //復(fù)制緩沖區(qū)大小,這是一個(gè)環(huán)形復(fù)制緩沖區(qū),用來保存最新復(fù)制的命令。這樣在slave離線的時(shí)候,不需要完全復(fù)制master的數(shù)據(jù),如果可以執(zhí)行部分同步,只需要把緩沖區(qū)的部分?jǐn)?shù)據(jù)復(fù)制給slave,就能恢復(fù)正常復(fù)制狀態(tài)。緩沖區(qū)的大小越大,slave離線的時(shí)間可以更長,復(fù)制緩沖區(qū)只有在有slave連接的時(shí)候才分配內(nèi)存。沒有slave的一段時(shí)間,內(nèi)存會(huì)被釋放出來,默認(rèn)1m。 # repl-backlog-size 1mb# After a master has no longer connected slaves for some time, the backlog # will be freed. The following option configures the amount of seconds that # need to elapse, starting from the time the last slave disconnected, for # the backlog buffer to be freed. # # A value of 0 means to never release the backlog. //master沒有slave一段時(shí)間會(huì)釋放復(fù)制緩沖區(qū)的內(nèi)存,repl-backlog-ttl用來設(shè)置該時(shí)間長度。單位為秒。 # repl-backlog-ttl 3600# The slave priority is an integer number published by Redis in the INFO output. # It is used by Redis Sentinel in order to select a slave to promote into a # master if the master is no longer working correctly. # # A slave with a low priority number is considered better for promotion, so # for instance if there are three slaves with priority 10, 100, 25 Sentinel will # pick the one with priority 10, that is the lowest. # # However a special priority of 0 marks the slave as not able to perform the # role of master, so a slave with priority of 0 will never be selected by # Redis Sentinel for promotion. # # By default the priority is 100. //當(dāng)master不可用,Sentinel會(huì)根據(jù)slave的優(yōu)先級(jí)選舉一個(gè)master。最低的優(yōu)先級(jí)的slave,當(dāng)選master。而配置成0,永遠(yuǎn)不會(huì)被選舉。 slave-priority 100# It is possible for a master to stop accepting writes if there are less than # N slaves connected, having a lag less or equal than M seconds. # # The N slaves need to be in "online" state. # # The lag in seconds, that must be <= the specified value, is calculated from # the last ping received from the slave, that is usually sent every second. # # This option does not GUARANTEE that N replicas will accept the write, but # will limit the window of exposure for lost writes in case not enough slaves # are available, to the specified number of seconds. # # For example to require at least 3 slaves with a lag <= 10 seconds use: //redis提供了可以讓master停止寫入的方式,如果配置了min-slaves-to-write,健康的slave的個(gè)數(shù)小于N,mater就禁止寫入。master最少得有多少個(gè)健康的slave存活才能執(zhí)行寫命令。這個(gè)配置雖然不能保證N個(gè)slave都一定能接收到master的寫操作,但是能避免沒有足夠健康的slave的時(shí)候,master不能寫入來避免數(shù)據(jù)丟失。設(shè)置為0是關(guān)閉該功能。 # min-slaves-to-write 3 //延遲小于min-slaves-max-lag秒的slave才認(rèn)為是健康的slave。 # min-slaves-max-lag 10 # # Setting one or the other to 0 disables the feature. # # By default min-slaves-to-write is set to 0 (feature disabled) and //設(shè)置1或另一個(gè)設(shè)置為0禁用這個(gè)特性。 # min-slaves-max-lag is set to 10.################################## SECURITY安全 ################################### //requirepass配置可以讓用戶使用AUTH命令來認(rèn)證密碼,才能使用其他命令。這讓redis可以使用在不受信任的網(wǎng)絡(luò)中。為了保持向后的兼容性,可以注釋該命令,因?yàn)榇蟛糠钟脩粢膊恍枰J(rèn)證。使用requirepass的時(shí)候需要注意,因?yàn)閞edis太快了,每秒可以認(rèn)證15w次密碼,簡單的密碼很容易被攻破,所以最好使用一個(gè)更復(fù)雜的密碼。 # Require clients to issue AUTH <PASSWORD> before processing any other # commands. This might be useful in environments in which you do not trust # others with access to the host running redis-server. # # This should stay commented out for backward compatibility and because most # people do not need auth (e.g. they run their own servers). # # Warning: since Redis is pretty fast an outside user can try up to # 150k passwords per second against a good box. This means that you should # use a very strong password otherwise it will be very easy to break. # # requirepass foobared# Command renaming. # # It is possible to change the name of dangerous commands in a shared # environment. For instance the CONFIG command may be renamed into something # hard to guess so that it will still be available for internal-use tools # but not available for general clients. # # Example: //把危險(xiǎn)的命令給修改成其他名稱。比如CONFIG命令可以重命名為一個(gè)很難被猜到的命令,這樣用戶不能使用,而內(nèi)部工具還能接著使用。 # rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52 # # It is also possible to completely kill a command by renaming it into # an empty string: //設(shè)置成一個(gè)空的值,可以禁止一個(gè)命令 # rename-command CONFIG "" # # Please note that changing the name of commands that are logged into the # AOF file or transmitted to slaves may cause problems.################################### LIMITS 限制##################################### Set the max number of connected clients at the same time. By default # this limit is set to 10000 clients, however if the Redis server is not # able to configure the process file limit to allow for the specified limit # the max number of allowed clients is set to the current file limit # minus 32 (as Redis reserves a few file descriptors for internal uses). # # Once the limit is reached Redis will close all the new connections sending # an error 'max number of clients reached'. //設(shè)置能連上redis的最大客戶端連接數(shù)量。默認(rèn)是10000個(gè)客戶端連接。由于redis不區(qū)分連接是客戶端連接還是內(nèi)部打開文件或者和slave連接等,所以maxclients最小建議設(shè)置到32。如果超過了maxclients,redis會(huì)給新的連接發(fā)送’max number of clients reached’,并關(guān)閉連接。 # maxclients 10000# Don't use more memory than the specified amount of bytes. # When the memory limit is reached Redis will try to remove keys # according to the eviction policy selected (see maxmemory-policy). # # If Redis can't remove keys according to the policy, or if the policy is # set to 'noeviction', Redis will start to reply with errors to commands # that would use more memory, like SET, LPUSH, and so on, and will continue # to reply to read-only commands like GET. # # This option is usually useful when using Redis as an LRU cache, or to set # a hard memory limit for an instance (using the 'noeviction' policy). # # WARNING: If you have slaves attached to an instance with maxmemory on, # the size of the output buffers needed to feed the slaves are subtracted # from the used memory count, so that network problems / resyncs will # not trigger a loop where keys are evicted, and in turn the output # buffer of slaves is full with DELs of keys evicted triggering the deletion # of more keys, and so forth until the database is completely emptied. # # In short... if you have slaves attached it is suggested that you set a lower # limit for maxmemory so that there is some free RAM on the system for slave # output buffers (but this is not needed if the policy is 'noeviction'). //redis配置的最大內(nèi)存容量。當(dāng)內(nèi)存滿了,需要配合maxmemory-policy策略進(jìn)行處理。注意slave的輸出緩沖區(qū)是不計(jì)算在maxmemory內(nèi)的。所以為了防止主機(jī)內(nèi)存使用完,建議設(shè)置的maxmemory需要更小一些。 # maxmemory <bytes># MAXMEMORY POLICY: how Redis will select what to remove when maxmemory # is reached. You can select among five behaviors: # # volatile-lru -> remove the key with an expire set using an LRU algorithm # allkeys-lru -> remove any key according to the LRU algorithm # volatile-random -> remove a random key with an expire set # allkeys-random -> remove a random key, any key # volatile-ttl -> remove the key with the nearest expire time (minor TTL) # noeviction -> don't expire at all, just return an error on write operations # # Note: with any of the above policies, Redis will return an error on write # operations, when there are no suitable keys for eviction. # # At the date of writing these commands are: set setnx setex append # incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd # sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby # zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby # getset mset msetnx exec sort # # The default is: /* 內(nèi)存容量超過maxmemory后的處理策略。 #volatile-lru:利用LRU算法移除設(shè)置過過期時(shí)間的key。 #volatile-random:隨機(jī)移除設(shè)置過過期時(shí)間的key。 #volatile-ttl:移除即將過期的key,根據(jù)最近過期時(shí)間來刪除(輔以TTL) #allkeys-lru:利用LRU算法移除任何key。 #allkeys-random:隨機(jī)移除任何key。 #noeviction:不移除任何key,只是返回一個(gè)寫錯(cuò)誤。 #上面的這些驅(qū)逐策略,如果redis沒有合適的key驅(qū)逐,對(duì)于寫命令,還是會(huì)返回錯(cuò)誤。redis將不再接收寫請(qǐng)求,只接收get請(qǐng)求。 */ # maxmemory-policy noeviction# LRU and minimal TTL algorithms are not precise algorithms but approximated # algorithms (in order to save memory), so you can tune it for speed or # accuracy. For default Redis will check five keys and pick the one that was # used less recently, you can change the sample size using the following # configuration directive. # # The default of 5 produces good enough results. 10 Approximates very closely # true LRU but costs a bit more CPU. 3 is very fast but not very accurate. //lru檢測的樣本數(shù)。使用lru或者ttl淘汰算法,從需要淘汰的列表中隨機(jī)選擇sample個(gè)key,選出閑置時(shí)間最長的key移除。 # maxmemory-samples 5############################## APPEND ONLY MODE ################################ By default Redis asynchronously dumps the dataset on disk. This mode is # good enough in many applications, but an issue with the Redis process or # a power outage may result into a few minutes of writes lost (depending on # the configured save points). # # The Append Only File is an alternative persistence mode that provides # much better durability. For instance using the default data fsync policy # (see later in the config file) Redis can lose just one second of writes in a # dramatic event like a server power outage, or a single write if something # wrong with the Redis process itself happens, but the operating system is # still running correctly. # # AOF and RDB persistence can be enabled at the same time without problems. # If the AOF is enabled on startup Redis will load the AOF, that is the file # with the better durability guarantees. # # Please check http://redis.io/topics/persistence for more information. /* 默認(rèn)redis使用的是rdb方式持久化,這種方式在許多應(yīng)用中已經(jīng)足夠用了。但是redis如果中途宕機(jī),會(huì)導(dǎo)致可能有幾分鐘的數(shù)據(jù)丟失,根據(jù)save來策略進(jìn)行持久化,Append Only File是另一種持久化方式,可以提供更好的持久化特性。Redis會(huì)把每次寫入的數(shù)據(jù)在接收后都寫入 appendonly.aof 文件,每次啟動(dòng)時(shí)Redis都會(huì)先把這個(gè)文件的數(shù)據(jù)讀入內(nèi)存里,先忽略RDB文件。 */ appendonly no //aof文件名 # The name of the append only file (default: "appendonly.aof")appendfilename "appendonly.aof"# The fsync() call tells the Operating System to actually write data on disk # instead of waiting for more data in the output buffer. Some OS will really flush # data on disk, some other OS will just try to do it ASAP. # # Redis supports three different modes: # # no: don't fsync, just let the OS flush the data when it wants. Faster. # always: fsync after every write to the append only log. Slow, Safest. # everysec: fsync only one time every second. Compromise. # # The default is "everysec", as that's usually the right compromise between # speed and data safety. It's up to you to understand if you can relax this to # "no" that will let the operating system flush the output buffer when # it wants, for better performances (but if you can live with the idea of # some data loss consider the default persistence mode that's snapshotting), # or on the contrary, use "always" that's very slow but a bit safer than # everysec. # # More details please check the following article: # http://antirez.com/post/redis-persistence-demystified.html # # If unsure, use "everysec".# appendfsync always /* #aof持久化策略的配置 #no表示不執(zhí)行fsync,由操作系統(tǒng)保證數(shù)據(jù)同步到磁盤,速度最快。 #always表示每次寫入都執(zhí)行fsync,以保證數(shù)據(jù)同步到磁盤。 #everysec表示每秒執(zhí)行一次fsync,可能會(huì)導(dǎo)致丟失這1s數(shù)據(jù)。 */ appendfsync everysec # appendfsync no# When the AOF fsync policy is set to always or everysec, and a background # saving process (a background save or AOF log background rewriting) is # performing a lot of I/O against the disk, in some Linux configurations # Redis may block too long on the fsync() call. Note that there is no fix for # this currently, as even performing fsync in a different thread will block # our synchronous write(2) call. # # In order to mitigate this problem it's possible to use the following option # that will prevent fsync() from being called in the main process while a # BGSAVE or BGREWRITEAOF is in progress. # # This means that while another child is saving, the durability of Redis is # the same as "appendfsync none". In practical terms, this means that it is # possible to lose up to 30 seconds of log in the worst scenario (with the # default Linux settings). # # If you have latency problems turn this to "yes". Otherwise leave it as # "no" that is the safest pick from the point of view of durability. /* 在aof重寫或者寫入rdb文件的時(shí)候,會(huì)執(zhí)行大量IO,此時(shí)對(duì)于everysec和always的aof模式來說,執(zhí)行fsync會(huì)造成阻塞過長時(shí)間,no-appendfsync-on-rewrite字段設(shè)置為默認(rèn)設(shè)置為no。如果對(duì)延遲要求很高的應(yīng)用,這個(gè)字段可以設(shè)置為yes,否則還是設(shè)置為no,這樣對(duì)持久化特性來說這是更安全的選擇。設(shè)置為yes表示rewrite期間對(duì)新寫操作不fsync,暫時(shí)存在內(nèi)存中,等rewrite完成后再寫入,默認(rèn)為no,建議yes。Linux的默認(rèn)fsync策略是30秒。可能丟失30秒數(shù)據(jù) */ no-appendfsync-on-rewrite no# Automatic rewrite of the append only file. # Redis is able to automatically rewrite the log file implicitly calling # BGREWRITEAOF when the AOF log size grows by the specified percentage. # # This is how it works: Redis remembers the size of the AOF file after the # latest rewrite (if no rewrite has happened since the restart, the size of # the AOF at startup is used). # # This base size is compared to the current size. If the current size is # bigger than the specified percentage, the rewrite is triggered. Also # you need to specify a minimal size for the AOF file to be rewritten, this # is useful to avoid rewriting the AOF file even if the percentage increase # is reached but it is still pretty small. # # Specify a percentage of zero in order to disable the automatic AOF # rewrite feature. /* aof自動(dòng)重寫配置。當(dāng)目前aof文件大小超過上一次重寫的aof文件大小的百分之多少進(jìn)行重寫,即當(dāng)aof文件增長到一定大小的時(shí)候Redis能夠調(diào)用bgrewriteaof對(duì)日志文件進(jìn)行重寫。當(dāng)前AOF文件大小是上次日志重寫得到AOF文件大小的二倍(設(shè)置為100)時(shí),自動(dòng)啟動(dòng)新的日志重寫過程。 */ auto-aof-rewrite-percentage 100 //設(shè)置允許重寫的最小aof文件大小,避免了達(dá)到約定百分比但尺寸仍然很小的情況還要重寫 auto-aof-rewrite-min-size 64mb# An AOF file may be found to be truncated at the end during the Redis # startup process, when the AOF data gets loaded back into memory. # This may happen when the system where Redis is running # crashes, especially when an ext4 filesystem is mounted without the # data=ordered option (however this can't happen when Redis itself # crashes or aborts but the operating system still works correctly). # # Redis can either exit with an error when this happens, or load as much # data as possible (the default now) and start if the AOF file is found # to be truncated at the end. The following option controls this behavior. # # If aof-load-truncated is set to yes, a truncated AOF file is loaded and # the Redis server starts emitting a log to inform the user of the event. # Otherwise if the option is set to no, the server aborts with an error # and refuses to start. When the option is set to no, the user requires # to fix the AOF file using the "redis-check-aof" utility before to restart # the server. # # Note that if the AOF file will be found to be corrupted in the middle # the server will still exit with an error. This option only applies when # Redis will try to read more data from the AOF file but not enough bytes # will be found. /* aof文件可能在尾部是不完整的,當(dāng)redis啟動(dòng)的時(shí)候,aof文件的數(shù)據(jù)被載入內(nèi)存。重啟可能發(fā)生在redis所在的主機(jī)操作系統(tǒng)宕機(jī)后,尤其在ext4文件系統(tǒng)沒有加上data=ordered選項(xiàng)(redis宕機(jī)或者異常終止不會(huì)造成尾部不完整現(xiàn)象。)出現(xiàn)這種現(xiàn)象,可以選擇讓redis退出,或者導(dǎo)入盡可能多的數(shù)據(jù)。如果選擇的是yes,當(dāng)截?cái)嗟腶of文件被導(dǎo)入的時(shí)候,會(huì)自動(dòng)發(fā)布一個(gè)log給客戶端然后load。如果是no,用戶必須手動(dòng)redis-check-aof修復(fù)AOF文件才可以。 */ aof-load-truncated yes################################ LUA SCRIPTING ################################ Max execution time of a Lua script in milliseconds. # # If the maximum execution time is reached Redis will log that a script is # still in execution after the maximum allowed time and will start to # reply to queries with an error. # # When a long running script exceeds the maximum execution time only the # SCRIPT KILL and SHUTDOWN NOSAVE commands are available. The first can be # used to stop a script that did not yet called write commands. The second # is the only way to shut down the server in the case a write command was # already issued by the script but the user doesn't want to wait for the natural # termination of the script. # # Set it to 0 or a negative value for unlimited execution without warnings. //如果達(dá)到最大時(shí)間限制(毫秒),redis會(huì)記個(gè)log,然后返回error。當(dāng)一個(gè)腳本超過了最大時(shí)限。只有SCRIPT KILL和SHUTDOWN NOSAVE可以用。第一個(gè)可以殺沒有調(diào)write命令的東西。要是已經(jīng)調(diào)用了write,只能用第二個(gè)命令殺。 lua-time-limit 5000################################ REDIS CLUSTER ############################### # # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # WARNING EXPERIMENTAL: Redis Cluster is considered to be stable code, however # in order to mark it as "mature" we need to wait for a non trivial percentage # of users to deploy it in production. # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # # Normal Redis instances can't be part of a Redis Cluster; only nodes that are # started as cluster nodes can. In order to start a Redis instance as a # cluster node enable the cluster support uncommenting the following: //集群開關(guān),默認(rèn)是不開啟集群模式。 # cluster-enabled yes# Every cluster node has a cluster configuration file. This file is not # intended to be edited by hand. It is created and updated by Redis nodes. # Every Redis Cluster node requires a different cluster configuration file. # Make sure that instances running in the same system do not have # overlapping cluster configuration file names. //集群配置文件的名稱,每個(gè)節(jié)點(diǎn)都有一個(gè)集群相關(guān)的配置文件,持久化保存集群的信息。這個(gè)文件并不需要手動(dòng)配置,這個(gè)配置文件有Redis生成并更新,每個(gè)Redis集群節(jié)點(diǎn)需要一個(gè)單獨(dú)的配置文件,請(qǐng)確保與實(shí)例運(yùn)行的系統(tǒng)中配置文件名稱不沖突 # cluster-config-file nodes-6379.conf# Cluster node timeout is the amount of milliseconds a node must be unreachable # for it to be considered in failure state. # Most other internal time limits are multiple of the node timeout. //節(jié)點(diǎn)互連超時(shí)的閥值。集群節(jié)點(diǎn)超時(shí)毫秒數(shù) # cluster-node-timeout 15000# A slave of a failing master will avoid to start a failover if its data # looks too old. # # There is no simple way for a slave to actually have a exact measure of # its "data age", so the following two checks are performed: # # 1) If there are multiple slaves able to failover, they exchange messages # in order to try to give an advantage to the slave with the best # replication offset (more data from the master processed). # Slaves will try to get their rank by offset, and apply to the start # of the failover a delay proportional to their rank. # # 2) Every single slave computes the time of the last interaction with # its master. This can be the last ping or command received (if the master # is still in the "connected" state), or the time that elapsed since the # disconnection with the master (if the replication link is currently down). # If the last interaction is too old, the slave will not try to failover # at all. # # The point "2" can be tuned by user. Specifically a slave will not perform # the failover if, since the last interaction with the master, the time # elapsed is greater than: # # (node-timeout * slave-validity-factor) + repl-ping-slave-period # # So for example if node-timeout is 30 seconds, and the slave-validity-factor # is 10, and assuming a default repl-ping-slave-period of 10 seconds, the # slave will not try to failover if it was not able to talk with the master # for longer than 310 seconds. # # A large slave-validity-factor may allow slaves with too old data to failover # a master, while a too small value may prevent the cluster from being able to # elect a slave at all. # # For maximum availability, it is possible to set the slave-validity-factor # to a value of 0, which means, that slaves will always try to failover the # master regardless of the last time they interacted with the master. # (However they'll always try to apply a delay proportional to their # offset rank). # # Zero is the only value able to guarantee that when all the partitions heal # the cluster will always be able to continue. /* 在進(jìn)行故障轉(zhuǎn)移的時(shí)候,全部slave都會(huì)請(qǐng)求申請(qǐng)為master,但是有些slave可能與master斷開連接一段時(shí)間了,導(dǎo)致數(shù)據(jù)過于陳舊,這樣的slave不應(yīng)該被提升為master。該參數(shù)就是用來判斷slave節(jié)點(diǎn)與master斷線的時(shí)間是否過長。判斷方法是: #比較slave斷開連接的時(shí)間和(node-timeout * slave-validity-factor) + repl-ping-slave-period #如果節(jié)點(diǎn)超時(shí)時(shí)間為三十秒, 并且slave-validity-factor為10,假設(shè)默認(rèn)的repl-ping-slave-period是10秒,即如果超過310秒slave將不會(huì)嘗試進(jìn)行故障轉(zhuǎn)移 */ # cluster-slave-validity-factor 10# Cluster slaves are able to migrate to orphaned masters, that are masters # that are left without working slaves. This improves the cluster ability # to resist to failures as otherwise an orphaned master can't be failed over # in case of failure if it has no working slaves. # # Slaves migrate to orphaned masters only if there are still at least a # given number of other working slaves for their old master. This number # is the "migration barrier". A migration barrier of 1 means that a slave # will migrate only if there is at least 1 other working slave for its master # and so forth. It usually reflects the number of slaves you want for every # master in your cluster. # # Default is 1 (slaves migrate only if their masters remain with at least # one slave). To disable migration just set it to a very large value. # A value of 0 can be set but is useful only for debugging and dangerous # in production. //master的slave數(shù)量大于該值,slave才能遷移到其他孤立master上,如這個(gè)參數(shù)若被設(shè)為2,那么只有當(dāng)一個(gè)主節(jié)點(diǎn)擁有2 個(gè)可工作的從節(jié)點(diǎn)時(shí),它的一個(gè)從節(jié)點(diǎn)會(huì)嘗試遷移。 # cluster-migration-barrier 1# 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. //默認(rèn)情況下,集群全部的slot有節(jié)點(diǎn)負(fù)責(zé),集群狀態(tài)才為ok,才能提供服務(wù)。設(shè)置為no,可以在slot沒有全部分配的時(shí)候提供服務(wù)。不建議打開該配置,這樣會(huì)造成分區(qū)的時(shí)候,小分區(qū)的master一直在接受寫請(qǐng)求,而造成很長時(shí)間數(shù)據(jù)不一致。 # cluster-require-full-coverage yes# In order to setup your cluster make sure to read the documentation # available at http://redis.io web site.################################## 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. //slog log是用來記錄redis運(yùn)行中執(zhí)行比較慢的命令耗時(shí)。當(dāng)命令的執(zhí)行超過了指定時(shí)間,就記錄在slow log中,slog log保存在內(nèi)存中,所以沒有IO操作。 //執(zhí)行時(shí)間比slowlog-log-slower-than大的請(qǐng)求記錄到slowlog里面,單位是微秒,所以1000000就是1秒。注意,負(fù)數(shù)時(shí)間會(huì)禁用慢查詢?nèi)罩?#xff0c;而0則會(huì)強(qiáng)制記錄所有命令。 slowlog-log-slower-than 10000# There is no limit to this length. Just be aware that it will consume memory. # You can reclaim memory used by the slow log with SLOWLOG RESET. //慢查詢?nèi)罩鹃L度。當(dāng)一個(gè)新的命令被寫進(jìn)日志的時(shí)候,最老的那個(gè)記錄會(huì)被刪掉。這個(gè)長度沒有限制。只要有足夠的內(nèi)存就行。你可以通過 SLOWLOG RESET 來釋放內(nèi)存。 slowlog-max-len 128################################ LATENCY MONITOR ############################### The Redis latency monitoring subsystem samples different operations # at runtime in order to collect data related to possible sources of # latency of a Redis instance. # # Via the LATENCY command this information is available to the user that can # print graphs and obtain reports. # # The system only logs operations that were performed in a time equal or # greater than the amount of milliseconds specified via the # latency-monitor-threshold configuration directive. When its value is set # to zero, the latency monitor is turned off. # # By default latency monitoring is disabled since it is mostly not needed # if you don't have latency issues, and collecting data has a performance # impact, that while very small, can be measured under big load. Latency # monitoring can easily be enabled at runtime using the command # "CONFIG SET latency-monitor-threshold <milliseconds>" if needed. //延遲監(jiān)控功能是用來監(jiān)控redis中執(zhí)行比較緩慢的一些操作,用LATENCY打印redis實(shí)例在跑命令時(shí)的耗時(shí)圖表。只記錄大于等于下邊設(shè)置的值的操作。0的話,就是關(guān)閉監(jiān)視。默認(rèn)延遲監(jiān)控功能是關(guān)閉的,如果你需要打開,也可以通過CONFIG SET命令動(dòng)態(tài)設(shè)置。 latency-monitor-threshold 0############################# EVENT NOTIFICATION 事件通知############################### Redis can notify Pub/Sub clients about events happening in the key space. # This feature is documented at http://redis.io/topics/notifications # # For instance if keyspace events notification is enabled, and a client # performs a DEL operation on key "foo" stored in the Database 0, two # messages will be published via Pub/Sub: # # PUBLISH __keyspace@0__:foo del # PUBLISH __keyevent@0__:del foo # # It is possible to select the events that Redis will notify among a set # of classes. Every class is identified by a single character: # # K Keyspace events, published with __keyspace@<db>__ prefix. # E Keyevent events, published with __keyevent@<db>__ prefix. # g Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ... # $ String commands # l List commands # s Set commands # h Hash commands # z Sorted set commands # x Expired events (events generated every time a key expires) # e Evicted events (events generated when a key is evicted for maxmemory) # A Alias for g$lshzxe, so that the "AKE" string means all the events. # # The "notify-keyspace-events" takes as argument a string that is composed # of zero or multiple characters. The empty string means that notifications # are disabled. # # Example: to enable list and generic events, from the point of view of the # event name, use: # # notify-keyspace-events Elg # # Example 2: to get the stream of the expired keys subscribing to channel # name __keyevent@0__:expired use: # # notify-keyspace-events Ex # # By default all notifications are disabled because most users don't need # this feature and the feature has some overhead. Note that if you don't # specify at least one of K or E, no events will be delivered. /* #鍵空間通知使得客戶端可以通過訂閱頻道或模式,來接收那些以某種方式改動(dòng)了 Redis 數(shù)據(jù)集的事件。因?yàn)殚_啟鍵空間通知功能需要消耗一些 CPU ,所以在默認(rèn)配置下,該功能處于關(guān)閉狀態(tài)。 #notify-keyspace-events 的參數(shù)可以是以下字符的任意組合,它指定了服務(wù)器該發(fā)送哪些類型的通知: ##K 鍵空間通知,所有通知以 __keyspace@__ 為前綴 ##E 鍵事件通知,所有通知以 __keyevent@__ 為前綴 ##g DEL 、 EXPIRE 、 RENAME 等類型無關(guān)的通用命令的通知 ##$ 字符串命令的通知 ##l 列表命令的通知 ##s 集合命令的通知 ##h 哈希命令的通知 ##z 有序集合命令的通知 ##x 過期事件:每當(dāng)有過期鍵被刪除時(shí)發(fā)送 ##e 驅(qū)逐(evict)事件:每當(dāng)有鍵因?yàn)?maxmemory 政策而被刪除時(shí)發(fā)送 ##A 參數(shù) g$lshzxe 的別名 #輸入的參數(shù)中至少要有一個(gè) K 或者 E,否則的話,不管其余的參數(shù)是什么,都不會(huì)有任何 通知被分發(fā)。詳細(xì)使用可以參考http://redis.io/topics/notifications */ notify-keyspace-events ""############################### ADVANCED CONFIG高級(jí)配置 ################################ Hashes are encoded using a memory efficient data structure when they have a # small number of entries, and the biggest entry does not exceed a given # threshold. These thresholds can be configured using the following directives. //數(shù)據(jù)量小于等于hash-max-ziplist-entries的用ziplist,大于hash-max-ziplist-entries用hash hash-max-ziplist-entries 512 //value大小小于等于hash-max-ziplist-value的用ziplist,大于hash-max-ziplist-value用hash。 hash-max-ziplist-value 64# Similarly to hashes, small lists are also encoded in a special way in order # to save a lot of space. The special representation is only used when # you are under the following limits: //數(shù)據(jù)量小于等于list-max-ziplist-entries用ziplist,大于list-max-ziplist-entries用list。 list-max-ziplist-entries 512 //value大小小于等于list-max-ziplist-value的用ziplist,大于list-max-ziplist-value用list。 list-max-ziplist-value 64# Sets have a special encoding in just one case: when a set is composed # of just strings that happen to be integers in radix 10 in the range # of 64 bit signed integers. # The following configuration setting sets the limit in the size of the # set in order to use this special memory saving encoding. //數(shù)據(jù)量小于等于set-max-intset-entries用iniset,大于set-max-intset-entries用set。 set-max-intset-entries 512# Similarly to hashes and lists, sorted sets are also specially encoded in # order to save a lot of space. This encoding is only used when the length and # elements of a sorted set are below the following limits: //數(shù)據(jù)量小于等于zset-max-ziplist-entries用ziplist,大于zset-max-ziplist-entries用zset。 zset-max-ziplist-entries 128 //value大小小于等于zset-max-ziplist-value用ziplist,大于zset-max-ziplist-value用zset。 zset-max-ziplist-value 64# HyperLogLog sparse representation bytes limit. The limit includes the # 16 bytes header. When an HyperLogLog using the sparse representation crosses # this limit, it is converted into the dense representation. # # A value greater than 16000 is totally useless, since at that point the # dense representation is more memory efficient. # # The suggested value is ~ 3000 in order to have the benefits of # the space efficient encoding without slowing down too much PFADD, # which is O(N) with the sparse encoding. The value can be raised to # ~ 10000 when CPU is not a concern, but space is, and the data set is # composed of many HyperLogLogs with cardinality in the 0 - 15000 range. //value大小小于等于hll-sparse-max-bytes使用稀疏數(shù)據(jù)結(jié)構(gòu)(sparse),大于hll-sparse-max-bytes使用稠密的數(shù)據(jù)結(jié)構(gòu)(dense)。一個(gè)比16000大的value是幾乎沒用的,建議的value大概為3000。如果對(duì)CPU要求不高,對(duì)空間要求較高的,建議設(shè)置到10000左右。 hll-sparse-max-bytes 3000# Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in # order to help rehashing the main Redis hash table (the one mapping top-level # keys to values). The hash table implementation Redis uses (see dict.c) # performs a lazy rehashing: the more operation you run into a hash table # that is rehashing, the more rehashing "steps" are performed, so if the # server is idle the rehashing is never complete and some more memory is used # by the hash table. # # The default is to use this millisecond 10 times every second in order to # actively rehash the main dictionaries, freeing memory when possible. # # If unsure: # use "activerehashing no" if you have hard latency requirements and it is # not a good thing in your environment that Redis can reply from time to time # to queries with 2 milliseconds delay. # # use "activerehashing yes" if you don't have such hard requirements but # want to free memory asap when possible. //Redis將在每100毫秒時(shí)使用1毫秒的CPU時(shí)間來對(duì)redis的hash表進(jìn)行重新hash,可以降低內(nèi)存的使用。當(dāng)你的使用場景中,有非常嚴(yán)格的實(shí)時(shí)性需要,不能夠接受Redis時(shí)不時(shí)的對(duì)請(qǐng)求有2毫秒的延遲的話,把這項(xiàng)配置為no。如果沒有這么嚴(yán)格的實(shí)時(shí)性要求,可以設(shè)置為yes,以便能夠盡可能快的釋放內(nèi)存。 activerehashing yes# The client output buffer limits can be used to force disconnection of clients # that are not reading data from the server fast enough for some reason (a # common reason is that a Pub/Sub client can't consume messages as fast as the # publisher can produce them). # # The limit can be set differently for the three different classes of clients: # # normal -> normal clients including MONITOR clients # slave -> slave clients # pubsub -> clients subscribed to at least one pubsub channel or pattern # # The syntax of every client-output-buffer-limit directive is the following: # # client-output-buffer-limit <class> <hard limit> <soft limit> <soft seconds> # # A client is immediately disconnected once the hard limit is reached, or if # the soft limit is reached and remains reached for the specified number of # seconds (continuously). # So for instance if the hard limit is 32 megabytes and the soft limit is # 16 megabytes / 10 seconds, the client will get disconnected immediately # if the size of the output buffers reach 32 megabytes, but will also get # disconnected if the client reaches 16 megabytes and continuously overcomes # the limit for 10 seconds. # # By default normal clients are not limited because they don't receive data # without asking (in a push way), but just after a request, so only # asynchronous clients may create a scenario where data is requested faster # than it can read. # # Instead there is a default limit for pubsub and slave clients, since # subscribers and slaves receive data in a push fashion. # # Both the hard or the soft limit can be disabled by setting them to zero. //對(duì)客戶端輸出緩沖進(jìn)行限制可以強(qiáng)迫那些不從服務(wù)器讀取數(shù)據(jù)的客戶端斷開連接,用來強(qiáng)制關(guān)閉傳輸緩慢的客戶端。 //對(duì)于normal client,第一個(gè)0表示取消hard limit,第二個(gè)0和第三個(gè)0表示取消soft limit,normal client默認(rèn)取消限制,因?yàn)槿绻麤]有尋問,他們是不會(huì)接收數(shù)據(jù)的。 client-output-buffer-limit normal 0 0 0 //對(duì)于slave client和MONITER client,如果client-output-buffer一旦超過256mb,又或者超過64mb持續(xù)60秒,那么服務(wù)器就會(huì)立即斷開客戶端連接。 client-output-buffer-limit slave 256mb 64mb 60 //對(duì)于pubsub client,如果client-output-buffer一旦超過32mb,又或者超過8mb持續(xù)60秒,那么服務(wù)器就會(huì)立即斷開客戶端連接。 client-output-buffer-limit pubsub 32mb 8mb 60# Redis calls an internal function to perform many background tasks, like # closing connections of clients in timeout, purging expired keys that are # never requested, and so forth. # # Not all tasks are performed with the same frequency, but Redis checks for # tasks to perform according to the specified "hz" value. # # By default "hz" is set to 10. Raising the value will use more CPU when # Redis is idle, but at the same time will make Redis more responsive when # there are many keys expiring at the same time, and timeouts may be # handled with more precision. # # The range is between 1 and 500, however a value over 100 is usually not # a good idea. Most users should use the default of 10 and raise this up to # 100 only in environments where very low latency is required. //redis執(zhí)行任務(wù)的頻率為1s除以hz。 hz 10# When a child rewrites the AOF file, if the following option is enabled # the file will be fsync-ed every 32 MB of data generated. This is useful # in order to commit the file to the disk more incrementally and avoid # big latency spikes. //在aof重寫的時(shí)候,如果打開了aof-rewrite-incremental-fsync開關(guān),系統(tǒng)會(huì)每32MB執(zhí)行一次fsync。這對(duì)于把文件寫入磁盤是有幫助的,可以避免過大的延遲峰值。 aof-rewrite-incremental-fsync yes

好吧,終于羅列完了,其實(shí)這個(gè)羅列大多方便自己復(fù)習(xí)的時(shí)候用而已。接下來,我們來看看我們需要重點(diǎn)關(guān)注的配置吧:


四、重點(diǎn)配置:(針對(duì)初學(xué)者,進(jìn)階的我們往后以方案形式來講)

(1).Redis默認(rèn)不是以守護(hù)進(jìn)程的方式運(yùn)行,可以通過該配置項(xiàng)修改,使用yes啟用守護(hù)進(jìn)程

daemonize no

(2)當(dāng)Redis以守護(hù)進(jìn)程方式運(yùn)行時(shí),Redis默認(rèn)會(huì)把pid寫入/var/run/redis.pid文件,可以通過pidfile指定

pidfile /var/run/redis.pid

(3).指定Redis監(jiān)聽端口,默認(rèn)端口為6379

port 6379

(4).綁定的主機(jī)地址

bind 127.0.0.1

(5).當(dāng) 客戶端閑置多長時(shí)間后關(guān)閉連接,如果指定為0,表示關(guān)閉該功能

timeout 300

(6)指定日志記錄級(jí)別,Redis總共支持四個(gè)級(jí)別:debug、verbose、notice、warning,默認(rèn)為verbose

loglevel debug

(7)設(shè)置數(shù)據(jù)庫的數(shù)量,默認(rèn)數(shù)據(jù)庫為0,可以使用SELECT 命令在連接上指定數(shù)據(jù)庫id

databases 16

(8) 指定在多長時(shí)間內(nèi),有多少次更新操作,就將數(shù)據(jù)同步到數(shù)據(jù)文件,可以多個(gè)條件配合

save 900 1
save 300 10
save 60 10000

(9)指定存儲(chǔ)至本地?cái)?shù)據(jù)庫時(shí)是否壓縮數(shù)據(jù),默認(rèn)為yes,Redis采用LZF壓縮,如果為了節(jié)省CPU時(shí)間,可以關(guān)閉該選項(xiàng),但會(huì)導(dǎo)致數(shù)據(jù)庫文件變的巨大

rdbcompression yes

(10)指定本地?cái)?shù)據(jù)庫文件名,默認(rèn)值為dump.rdb

dbfilename dump.rdb

(11)指定本地?cái)?shù)據(jù)庫存放目錄

dir ./

(12)設(shè)置當(dāng)本機(jī)為slav服務(wù)時(shí),設(shè)置master服務(wù)的IP地址及端口,在Redis啟動(dòng)時(shí),它會(huì)自動(dòng)從master進(jìn)行數(shù)據(jù)同步

slaveof

(13)當(dāng)master服務(wù)設(shè)置了密碼保護(hù)時(shí),slav服務(wù)連接master的密碼

masterauth

(14)設(shè)置Redis連接密碼,如果配置了連接密碼,客戶端在連接Redis時(shí)需要通過AUTH 命令提供密碼,默認(rèn)關(guān)閉

requirepass foobared

(15)設(shè)置同一時(shí)間最大客戶端連接數(shù)

默認(rèn)無限制,Redis可以同時(shí)打開的客戶端連接數(shù)為Redis進(jìn)程可以打開的最大文件描述符數(shù),如果設(shè)置 maxclients 0,表示不作限制。當(dāng)客戶端連接數(shù)到達(dá)限制時(shí),Redis會(huì)關(guān)閉新的連接并向客戶端返回max number of clients reached錯(cuò)誤信息

maxclients 128

(16)指定是否在每次更新操作后進(jìn)行日志記錄

Redis在默認(rèn)情況下是異步的把數(shù)據(jù)寫入磁盤,如果不開啟,可能會(huì)在斷電時(shí)導(dǎo)致一段時(shí)間內(nèi)的數(shù)據(jù)丟失。因?yàn)?redis本身同步數(shù)據(jù)文件是按上面save條件來同步的,所以有的數(shù)據(jù)會(huì)在一段時(shí)間內(nèi)只存在于內(nèi)存中。默認(rèn)為no

appendonly no

(17)指定更新日志文件名,默認(rèn)為appendonly.aof

appendfilename appendonly.aof

(18)指定更新日志條件,共有3個(gè)可選值:

no:表示等操作系統(tǒng)進(jìn)行數(shù)據(jù)緩存同步到磁盤(快)
always:表示每次更新操作后手動(dòng)調(diào)用fsync()將數(shù)據(jù)寫到磁盤(慢,安全)
everysec:表示每秒同步一次(折衷,默認(rèn)值)
appendfsync everysec


demo以及博客都在這里面啦!!!

J2EE項(xiàng)目系列(四)–SSM框架構(gòu)建積分系統(tǒng)和基本商品檢索系統(tǒng)(Spring+SpringMVC+MyBatis+Lucene+Redis+MAVEN)

好了,這是第一篇,并不是講方案的一篇,大概介紹下,并寫個(gè)helloworld而已。

往后我會(huì)針對(duì)一些方案來寫些redis的demo給大家。歡迎關(guān)注!!!歡迎在下面指出錯(cuò)誤,共同學(xué)習(xí)!!你的點(diǎn)贊是對(duì)我最好的支持!!

更多內(nèi)容,可以訪問JackFrost的博客

總結(jié)

以上是生活随笔為你收集整理的Redis系列(一)--安装、helloworld以及读懂配置文件的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。

国产一区二区在线看 | 日韩国产精品久久 | 天天干天天在线 | 国产成人精品av在线观 | 欧美性脚交 | 日韩欧美视频一区二区三区 | 亚洲 欧洲 国产 日本 综合 | 亚洲日本在线一区 | 国产精品久免费的黄网站 | 亚洲精品在线视频观看 | 午夜精品一区二区三区四区 | 欧美精品乱码99久久影院 | 国产不卡在线视频 | 免费黄色在线网站 | 成人午夜电影久久影院 | 午夜久久影视 | 亚洲国产999| 久久久九色精品国产一区二区三区 | 国产精品刺激对白麻豆99 | 亚洲欧洲精品视频 | 国产高清黄| 欧美成人免费在线 | 伊色综合久久之综合久久 | 黄色av电影网 | 激情五月婷婷综合 | 99久久精品国产一区二区三区 | 久久久久久久国产精品 | 成人在线视频论坛 | 西西4444www大胆艺术 | 免费一级特黄录像 | 亚洲精品一区二区三区四区高清 | 婷婷色网视频在线播放 | 日本精品一| 一级成人网 | 在线观看免费91 | 国产精品av一区二区 | 日本美女xx | av短片在线观看 | 黄色av电影免费观看 | 一区二区三区三区在线 | 日日操日日插 | 免费高清无人区完整版 | 日韩色视频在线观看 | 国产精品初高中精品久久 | 一区二区三区高清在线观看 | 天堂视频中文在线 | 久草在线看片 | 超碰在线97免费 | 亚洲免费色| 麻豆视频在线免费观看 | 日本中文字幕在线播放 | www.色五月.com | 免费久久网 | 亚洲精品国产精品乱码不99热 | 久久99免费视频 | 91大神dom调教在线观看 | 日日夜夜亚洲 | 中文字幕亚洲欧美日韩 | 亚洲影视九九影院在线观看 | 九九免费在线观看 | 4438全国亚洲精品观看视频 | 一区二区激情 | 人人干在线 | 婷婷色资源 | 99久热在线精品视频 | 天天操天天操天天 | 亚洲三级性片 | 五月天狠狠操 | 久久精品久久久久久久 | 欧美日韩精品在线一区二区 | 色偷偷av男人天堂 | 在线亚州 | 98精品国产自产在线观看 | 综合国产在线 | 日韩 精品 一区 国产 麻豆 | 国产男女免费完整视频 | 97精品超碰一区二区三区 | 久久成年人视频 | 国内精品久久久久国产 | 亚洲精品av在线 | 天天操天天干天天 | 国产乱码精品一区二区三区介绍 | 日本精品午夜 | 亚洲精品成人在线 | 99久久婷婷国产综合精品 | 日韩网站中文字幕 | 亚洲美女精品区人人人人 | 在线国产片 | 久久躁日日躁aaaaxxxx | 日本夜夜草视频网站 | 国产成人黄色在线 | 久久久久久久久影视 | 婷婷视频在线播放 | 久草视频免费在线观看 | 亚洲午夜精品久久久 | 五月综合激情 | 天天爽天天爽天天爽 | 日韩一区二区三区视频在线 | 国产成人三级一区二区在线观看一 | 精品国产一区二区三区av性色 | 91精品一区在线观看 | 天天射天天色天天干 | 日批视频在线播放 | 色综合中文字幕 | 久久蜜桃av | 色爱成人网 | 久久久久久毛片精品免费不卡 | 在线a视频 | 国内久久看 | 国产女人免费看a级丨片 | 精品国产一区二区三区在线观看 | 久久精品国产免费看久久精品 | 久久特级毛片 | 国产生活一级片 | 五月婷婷视频 | 在线视频18在线视频4k | 99re久久资源最新地址 | 欧美日韩国产一区二区三区在线观看 | 91精品国产自产91精品 | 久久国产免| 九九视频在线播放 | 黄色一级免费 | a级一a一级在线观看 | 中文字幕在线观看免费高清电影 | 国产一区二区精品91 | 九九免费在线看完整版 | 国产精品视频久久 | 中文在线字幕免 | 中文字幕一区二区三区在线播放 | 久草免费新视频 | 2019中文字幕第一页 | 亚洲精品网页 | 亚洲人xxx | 免费日韩 精品中文字幕视频在线 | 91av在线国产| 99欧美视频 | 国产精品久久久久久久久久直播 | 欧美成人91 | 国产黄色免费观看 | 精品国产一区二区三区久久久 | 中文字幕在线观看完整版电影 | 99精品久久99久久久久 | a亚洲视频| 国产黄色片一级 | 91九色在线播放 | 日韩在线观看视频一区二区三区 | 国产精品国产三级在线专区 | 免费观看高清 | 久久人人爽人人爽人人片av软件 | 国模视频一区二区三区 | 婷婷色中文网 | 久久99精品热在线观看 | 在线看免费 | 国产夫妻av在线 | 97视频久久久 | 麻豆传媒视频在线免费观看 | 免费观看国产视频 | 在线免费视频 你懂得 | 久久国产精品久久久久 | 免费看的黄色 | 亚洲成人资源在线观看 | 久草视频中文在线 | 日韩午夜精品 | 国产福利一区二区三区在线观看 | 欧美少妇xxxxxx| 91网免费看 | 国产伦理久久 | 国产在线视频不卡 | 国产亚洲精品久久久久久大师 | 亚洲成人免费在线观看 | 最近中文字幕大全 | jizz999| 日韩免费一区二区在线观看 | 亚洲精品美女免费 | 免费aa大片| 国产专区日韩专区 | 欧美精品久久久久久久久久丰满 | 蜜臀久久99精品久久久久久网站 | 欧美日韩亚洲第一 | 色九九视频 | 欧美激情综合五月色丁香 | 亚洲国产剧情av | 综合色天天 | 毛片www | 久久国产二区 | 日日干天天插 | 色综合中文综合网 | 国产一级性生活视频 | 人成午夜视频 | 日韩视频免费在线 | 在线观看色网 | 二区三区av| 婷婷色吧 | 国产一区在线观看免费 | 香蕉视频国产在线观看 | 亚洲免费av一区二区 | 精品国产色| 国产精品porn | 亚洲欧美综合 | 午夜久久成人 | 中文字幕在线观 | 91麻豆精品久久久久久 | 日韩电影一区二区在线观看 | 伊人色综合久久天天网 | 九九免费在线观看视频 | 色婷婷www | 欧美坐爱视频 | 青青河边草观看完整版高清 | 欧美一区三区四区 | 碰天天操天天 | 国产精品久久久久一区 | 免费三级骚 | 中文字幕网站 | 亚洲经典在线 | 波多野结衣动态图 | 国产日女人 | 国产麻豆视频免费观看 | 欧美成人精品三级在线观看播放 | 一区二区亚洲精品 | 97福利在线观看 | 在线观看电影av | 亚州性色| 玖玖色在线观看 | 天天操天天草 | 狠色狠色综合久久 | 天天操夜夜操 | 久久不卡日韩美女 | 免费视频一区二区 | 精品视频免费久久久看 | 欧美日韩视频 | 国产精品日韩精品 | 亚洲激情电影在线 | 91超国产| 久久99在线观看 | 久草视频99| 五月婷婷在线观看视频 | 亚洲在线视频免费 | 色综合久久综合网 | 日韩精品视频在线观看免费 | 91在线麻豆 | 成人91在线观看 | 999ZYZ玖玖资源站永久 | 天天看天天操 | 日韩一区二区三免费高清在线观看 | 国产精品一区二区在线免费观看 | 免费午夜视频在线观看 | 国产剧情一区二区 | 久久成人在线视频 | 免费av网站在线看 | 成人毛片在线视频 | 韩国av三级 | 成人国产精品入口 | 中文字幕av全部资源www中文字幕在线观看 | 色七七亚洲影院 | 久久爱综合 | 久草在在线视频 | 久久久免费精品国产一区二区 | 丁香在线视频 | 午夜在线观看影院 | 国内精品久久久久久久影视简单 | www.狠狠色| 国产免费三级在线观看 | 精品字幕| 99久久精品免费看 | 国产免费看 | 国产五码一区 | 在线观看亚洲精品视频 | 亚洲高清视频一区二区三区 | 日日日操| 免费亚洲精品 | 国产乱码精品一区二区蜜臀 | 日韩精品中文字幕一区二区 | 欧美午夜一区二区福利视频 | 成人在线视频免费观看 | 日韩视频欧美视频 | 999久久久久久久久 69av视频在线观看 | 国产精品99久久久久久大便 | 麻豆你懂的 | 伊色综合久久之综合久久 | 91网页版在线观看 | 99热这里精品| 在线精品观看 | 成人在线免费av | 性色av免费在线观看 | 久久成人国产精品一区二区 | 香蕉成人在线视频 | 天天干天天玩天天操 | 丁香在线观看完整电影视频 | 91av中文字幕 | 国产亚洲激情视频在线 | 伊人永久在线 | 欧美日韩高清在线一区 | 日韩a级黄色 | 欧美久久精品 | 丁香五香天综合情 | 国产在线欧美日韩 | 久久精品国产亚洲a | 91毛片在线 | 午夜精品福利一区二区 | 99视频99| 日韩中文在线电影 | 在线中文日韩 | 精品日韩在线一区 | 亚洲三级毛片 | av成人动漫在线观看 | 色资源二区在线视频 | 黄色软件在线观看 | 91久久精品一区二区二区 | 欧美人体xx | 国产精品网站一区二区三区 | 国产一区二区三精品久久久无广告 | 国产成人在线免费观看 | 久久香蕉国产精品麻豆粉嫩av | 日韩av中文在线 | 中文字幕av在线不卡 | 亚洲理论电影 | 伊人狠狠干| 亚洲国产美女久久久久 | 亚洲欧美日韩国产 | 在线色资源 | 久久免费视频5 | 久久一视频 | 很污的网站 | 五月婷婷黄色网 | 91视频网址入口 | 狠狠躁夜夜躁人人爽视频 | 日本在线视频一区二区三区 | 日韩精品一区二区三区三炮视频 | 2017狠狠干 | av在线不卡观看 | 日韩在线视频观看 | 国产91精品久久久久 | 日韩免费不卡视频 | 日韩在线观看av | 日韩欧美视频在线免费观看 | 成人黄色毛片 | 808电影免费观看三年 | 日韩高清免费无专码区 | 国产精品第二十页 | 97av色| 天天射天天干天天操 | 欧美一二三在线 | 国产日韩精品一区二区在线观看播放 | av免费在线看网站 | 久久黄色影院 | 黄色三级免费 | 久久久精品网 | 日韩不卡高清 | 一级一片免费观看 | 国产黄a三级三级三级三级三级 | 国产精品嫩草影院123 | 国产精品系列在线观看 | 国产手机在线播放 | 亚洲aaa级 | 91成人看片 | 亚洲国产美女精品久久久久∴ | 一级α片免费看 | 韩日视频在线 | 日韩中文幕 | 一区二区欧美日韩 | 人人躁 | 色www精品视频在线观看 | 久久久久久久久久久久久国产精品 | 精品成人网 | 国产一区欧美二区 | 免费看亚洲毛片 | 欧美在线视频二区 | 免费高清无人区完整版 | 91视频 - x99av | 午夜成人免费影院 | 精品国产乱码一区二 | 国产高清在线一区 | 99婷婷狠狠成为人免费视频 | 99精品视频在线观看 | 亚洲视频aaa| 在线观看日韩专区 | 亚洲激情av | 亚洲欧美国产精品 | 欧美乱码精品一区二区 | 国产精品国内免费一区二区三区 | 亚洲另类视频在线观看 | 欧美精品久久久久久 | 亚洲一区久久久 | 成人在线免费视频观看 | 亚洲精品成人av在线 | 激情丁香月 | 一二三区高清 | 狠狠躁夜夜躁人人爽超碰97香蕉 | 视频在线一区 | 国产一区二区三区免费视频 | 国产精品久久久免费 | 亚洲国产视频直播 | 成人av电影免费在线播放 | 婷婷精品国产欧美精品亚洲人人爽 | 国产无套精品久久久久久 | 综合激情婷婷 | 精品国产伦一区二区三区观看体验 | 我要看黄色一级片 | 欧美日韩国产精品一区二区亚洲 | 国产一区不卡在线 | 国产原厂视频在线观看 | 国际精品网 | 日韩欧美xxxx | 久久视了| 久久久精品久久日韩一区综合 | 国产精品女人网站 | 911在线| 九色精品免费永久在线 | 成人资源在线 | 少妇bbw搡bbbb搡bbb | 毛片视频网址 | 国产精品一区久久久久 | 中文字幕一区二区三区久久 | 玖玖视频| 国产精品久久久久久久久久久杏吧 | 干干日日 | 免费中文字幕 | 蜜臀精品久久久久久蜜臀 | 亚洲激情五月 | 欧美日韩高清在线 | 黄色av一级片| www视频在线播放 | 亚洲免费不卡 | 91在线你懂的 | 狠狠网亚洲精品 | 午夜免费视频网站 | 成人看片 | japanesefreesexvideo高潮 | 五月天丁香综合 | 久久久久欠精品国产毛片国产毛生 | 一区二区三区视频在线 | 五月婷婷丁香网 | 一区二区伦理 | 97超碰精品 | 亚洲国产精品va在线 | 91大神dom调教在线观看 | av免费线看| 亚洲欧美激情精品一区二区 | 在线免费观看黄色 | 一级黄色片毛片 | 国产在线观看网站 | 91精品一区二区三区蜜臀 | 99久久婷婷国产综合精品 | 特级西西444www大胆高清无视频 | 午夜精品久久久99热福利 | 久久99精品久久久久婷婷 | 欧美日韩中文视频 | 成人日韩av| 丁香av | 四虎精品成人免费网站 | 国产91在线看 | 中文字幕黄色网 | www.狠狠色| 国产福利一区二区三区在线观看 | 久草在线视频在线 | 九九热只有这里有精品 | 91久久国产自产拍夜夜嗨 | 成人久久精品 | 亚洲国产片 | 911久久| 在线观看黄网站 | 免费在线播放黄色 | 久久久亚洲电影 | 91传媒在线观看 | 2021av在线| 色资源二区在线视频 | 在线视频91 | 久久免费影院 | 波多野结衣在线中文字幕 | 特级毛片爽www免费版 | 亚洲精选视频在线 | 久久黄网站 | 日韩a级黄色 | 人人干免费 | 久草在线视频国产 | 中文av在线免费观看 | 成年人电影免费在线观看 | 中文字幕亚洲不卡 | 久久久久一区二区三区四区 | 国产呻吟在线 | 国产视频日韩视频欧美视频 | 91一区一区三区 | 日韩伦理一区二区三区av在线 | 中文免费在线观看 | 成人在线中文字幕 | 久热免费 | 麻豆94tv免费版 | 精品一区二区久久久久久久网站 | 天天碰天天操视频 | 午夜精品一区二区三区免费视频 | 97在线影视 | 久久免费看av | 天天干天天操天天拍 | 91精品国自产在线偷拍蜜桃 | av在线电影网站 | 国产精品毛片一区二区三区 | 91一区二区三区久久久久国产乱 | 国产成人一区二区在线观看 | 国产精品入口66mio女同 | av免费在线观看网站 | 久久精品视频免费观看 | www久久| 免费看黄视频 | 免费网站观看www在线观看 | 日韩精品免费 | 国产91大片| 亚洲国产欧洲综合997久久, | 亚洲成人免费 | 视频成人免费 | 日韩高清不卡在线 | 国产日韩欧美在线免费观看 | 精品一区二区三区久久久 | 六月婷婷网 | 久操中文字幕在线观看 | 韩国av一区二区 | 黄色网免费 | 国产在线观看免费观看 | 久久久久久国产精品免费 | 久草av在线播放 | 国产精品久久久久国产精品日日 | 尤物九九久久国产精品的分类 | 在线观看国产v片 | 在线观看亚洲视频 | 500部大龄熟乱视频使用方法 | 午夜精品剧场 | 91爱爱网址 | 国产精品 日韩精品 | 国产一级a毛片视频爆浆 | 色的网站在线观看 | 久久久久久久久毛片 | 91刺激视频 | www日韩在线观看 | 欧美日韩综合在线观看 | 中文字幕观看在线 | 久久精品亚洲综合专区 | 天天爽网站 | 亚洲四虎影院 | 免费视频久久久 | 日韩在线 一区二区 | 91在线视频观看 | 中文字幕在线播放第一页 | 国产视频资源 | 亚洲精品国产第一综合99久久 | 天天亚洲| 国产高清在线不卡 | 天天摸夜夜操 | 天天av在线播放 | 成人免费av电影 | 欧美一级乱黄 | 91精品少妇偷拍99 | 国产一区二区手机在线观看 | 久久福利小视频 | 国产精品美女毛片真酒店 | 99久久久成人国产精品 | 亚洲视频999 | 欧美视频日韩视频 | 99热99re6国产在线播放 | 国产午夜三级 | 欧美孕妇与黑人孕交 | 手机成人av在线 | 国产精品一区二区免费在线观看 | 久久无码精品一区二区三区 | 国产区精品视频 | 国产成人一区二区三区在线观看 | 免费在线观看黄色网 | 中文字幕乱码电影 | 亚洲一级免费观看 | 麻豆91精品视频 | 亚洲国产av精品毛片鲁大师 | 欧美日韩国产一区二区在线观看 | 丝袜美腿一区 | 久久免费看| 久久久精品国产免费观看同学 | 色a4yy| 久草在线精品观看 | 亚洲精品视频免费观看 | 日韩激情视频在线 | 最新av在线网站 | 久久天天躁夜夜躁狠狠85麻豆 | 黄色亚洲片 | 亚洲爱爱视频 | 国产又粗又长的视频 | 日韩午夜av | 国产小视频免费在线网址 | 成人免费一区二区三区在线观看 | 808电影免费观看三年 | 成人久久18免费网站麻豆 | 最新91在线视频 | www婷婷 | 中文电影网| 五月视频 | 九九久| 天天操天天拍 | 国产精品欧美久久久久无广告 | 综合伊人av | 亚洲涩涩色 | 国产福利久久 | 国内精品久久久久影院优 | 99av国产精品欲麻豆 | 日韩av在线影视 | 久久99国产精品二区护士 | 中文字幕欧美日韩va免费视频 | 亚洲午夜在线视频 | 天天干天天操天天做 | 精品久久久久亚洲 | 911久久香蕉国产线看观看 | 国产精华国产精品 | 午夜电影av| 成人精品久久久 | 国产中文欧美日韩在线 | 成人精品亚洲 | 国产精品黄色 | 美女网站视频色 | 国产精品国产毛片 | 精品久久电影 | 六月丁香婷婷久久 | 色综合久久久久综合体桃花网 | av电影一区二区三区 | 成人wwwxxx视频 | 色吊丝在线永久观看最新版本 | 久草久视频 | 一级电影免费在线观看 | 天天艹天天爽 | 久久综合九色99 | 国产成人一区二区啪在线观看 | 午夜久久成人 | 99电影456麻豆 | 久草视频免费看 | 国产91精品在线播放 | av噜噜噜在线播放 | 不卡日韩av | 亚洲 中文 欧美 日韩vr 在线 | 国产涩图| 激情片av | 日韩av播放在线 | 国内三级在线观看 | 国产免费av一区二区三区 | 国产中文在线观看 | 成人免费在线观看电影 | 中文字幕成人av | 狠狠躁日日躁狂躁夜夜躁av | 天天插狠狠插 | av高清不卡 | 久久久久欧美精品999 | 国产精品美女久久久免费 | 国产一级91 | 91精品国产乱码久久桃 | 黄色a级片在线观看 | 日本少妇久久久 | 久久久高清一区二区三区 | 一区二区三区在线免费播放 | www.色综合.com | 国产精品18久久久久vr手机版特色 | 月丁香婷婷 | 国产色a在线观看 | 国产成人精品午夜在线播放 | 日p在线观看 | 中文在线最新版天堂 | 一区二区三区视频 | 97超碰人人澡 | 精品毛片久久久久久 | 亚洲精品乱码久久久久久高潮 | 天天操天天摸天天爽 | 免费情趣视频 | 91伊人久久大香线蕉蜜芽人口 | 国产黄色理论片 | av中文字幕免费在线观看 | 国产一级黄 | www.久久婷婷 | 激情综合网在线观看 | 成片免费 | 亚州天堂 | 欧美精品v国产精品v日韩精品 | a视频免费看 | 欧美久久99 | 国产黄色免费看 | 欧美精品久久久久a | 国产亚洲欧美精品久久久久久 | 狠狠干综合网 | 国产高清福利在线 | 激情偷乱人伦小说视频在线观看 | 国产精品久久久久av福利动漫 | 国产高清视频免费最新在线 | 亚洲国产精品成人女人久久 | 99 视频 高清 | 中文字幕 国产专区 | 久久久久久中文字幕 | 成人免费视频播放 | 伊人五月天综合 | 六月激情网 | 999国产在线 | 久久国产精品99久久久久久进口 | av超碰免费在线 | 久久99久久99精品免费看小说 | 插久久| 国产视频在线观看一区 | 精品免费观看视频 | 日本资源中文字幕在线 | 一区二区视频电影在线观看 | 玖玖爱免费视频 | 欧美黄色软件 | 天堂视频一区 | 欧美日韩网站 | 久久乱码卡一卡2卡三卡四 五月婷婷久 | 午夜精品福利一区二区三区蜜桃 | 在线播放日韩av | 五月天免费网站 | 黄色一级免费 | 精品国偷自产国产一区 | 精品国产91亚洲一区二区三区www | 亚洲综合欧美精品电影 | 欧美日韩精品在线观看 | 特级黄录像视频 | 黄色av一区 | 免费看搞黄视频网站 | 91九色精品女同系列 | 久久综合九色综合欧美狠狠 | 成人在线免费小视频 | 亚洲理论在线 | 亚洲精品国偷自产在线99热 | www久| 一区二区三区动漫 | 亚洲欧美日韩一级 | 91专区在线观看 | 中文字幕日韩伦理 | 欧美日韩精品在线播放 | 江苏妇搡bbbb搡bbbb | 亚洲播放一区 | 91色偷偷| 2021国产精品视频 | 精品国产一区二区三区噜噜噜 | 免费看污在线观看 | 狠狠色婷婷丁香六月 | 国产视频一级 | 欧美天天综合网 | 国产亚州精品视频 | 国产精品18久久久久vr手机版特色 | 一区二区观看 | 国产成人精品一区一区一区 | 精品视频免费 | 日韩理论电影在线 | 国产精品免费小视频 | 97精品国产91久久久久久久 | 日本在线中文在线 | 欧美地下肉体性派对 | 久久久久久久久电影 | 黄污视频网站大全 | 高清色免费 | www.成人sex | 精品免费观看视频 | 丁香av| 中文一区二区三区在线观看 | 国产日韩欧美在线播放 | 在线免费观看国产 | 91看成人 | 午夜在线看 | 人人爱夜夜操 | 91精品免费在线视频 | 国产精品va最新国产精品视频 | 成人免费在线播放视频 | 五月天高清欧美mv | 91亚洲精品久久久蜜桃借种 | a级国产毛片 | 99色免费视频| 免费网站看v片在线a | 一级黄网 | 人人射人人射 | 色综合天天色 | 日韩久久精品一区二区三区下载 | 97碰在线视频 | 狠狠插天天干 | 中文字幕精品三级久久久 | 国产区高清在线 | 99久久精品国产免费看不卡 | 久久婷婷五月综合色丁香 | 久久国产手机看片 | 久久爱导航 | 天天操伊人 | 亚洲国产精品成人va在线观看 | 免费又黄又爽的视频 | 97在线观看免费高清 | 一级片色播影院 | 视频一区在线免费观看 | 日韩乱理 | www.神马久久| 日韩最新av | 日本在线观看中文字幕 | 国产小视频91 | 国产老太婆免费交性大片 | 国产资源网 | 色综合天天视频在线观看 | 一区二区三区高清 | 99精品视频在线播放观看 | 免费久久网 | 男女啪啪网站 | 久久激情视频 | 91在线资源| bbbbb女女女女女bbbbb国产 | 久久狠狠干 | 国产成人精品一二三区 | 99这里只有久久精品视频 | 免费观看久久久 | 久久国产精品久久精品 | 亚洲 综合 精品 | 亚洲欧美视频在线观看 | 精品视频免费播放 | 日韩久久一区二区 | 欧美一级片在线免费观看 | 成人蜜桃 | 91片在线观看 | www色,com| 国产盗摄精品一区二区 | 毛片99| 国产精品国产三级国产aⅴ入口 | 久久久久亚洲国产精品 | 精品在线视频播放 | 久久久久久美女 | 久草亚洲视频 | 在线免费av网| 五月婷婷,六月丁香 | 天天操夜操 | av免费看在线 | 国产黄色特级片 | 国产免费高清视频 | 天天五月天色 | 色99中文字幕 | 天天爽天天爽夜夜爽 | 日韩国产高清在线 | av久久在线| 在线欧美中文字幕 | 综合伊人av| 精品国内自产拍在线观看视频 | 五月天,com | 亚洲精品97 | 天天艹| 国产精彩视频一区 | 免费网站在线观看成人 | 一区二区三区韩国免费中文网站 | 不卡中文字幕av | 激情自拍av | 狠狠操狠狠 | 在线成人一区 | 国产精品美女久久久久久久久久久 | 成人久久亚洲 | 国产视频二区三区 | 在线看v片成人 | 中文字幕黄色 | 久久福利剧场 | 亚洲精品毛片一级91精品 | 亚洲在线视频免费观看 | 日韩视频免费观看高清 | 久久久高清一区二区三区 | 亚洲成成品网站 | 免费黄色特级片 | 美女网站黄免费 | 天天色成人 | 91人人插| 欧美日韩国产色综合一二三四 | 精品1区2区 | 国产激情免费 | 婷婷伊人综合 | 成人黄色影片在线 | 久草在线视频首页 | 亚洲黄色网络 | 亚洲国产偷 | 国产精品1024 | 美女天天操 | 中文字幕视频在线播放 | 久久激情五月婷婷 | 一区二区三区在线免费 | 亚洲精品女人 | 天堂在线一区 | 天天操婷婷 | 西西444www| 精品女同一区二区三区在线观看 | 久草精品在线观看 | 人人涩 | 99精品视频免费在线观看 | 91福利国产在线观看 | 亚洲综合在线一区二区三区 | 久久免费国产精品 | 亚洲人成网站精品片在线观看 | 一区 在线 影院 | 91在线免费视频 | 一级性视频 | 伊人中文字幕在线 | 国产亚洲精品久久久久久大师 | 欧洲亚洲国产视频 | 精久久久久 | 99婷婷狠狠成为人免费视频 | 97超碰福利久久精品 | 久久伊99综合婷婷久久伊 | 国产黄在线免费观看 | 婷婷国产v亚洲v欧美久久 | 黄色一级片视频 | av免费在线看网站 | 日韩在线观看网站 | 欧美成人日韩 | 国产精品久久久久久久久久久久午 | 中文不卡视频在线 | 久久伊人八月婷婷综合激情 | 成年人在线观看视频免费 | 天天射综合网视频 | 最新真实国产在线视频 | 在线播放第一页 | 91最新网址 | 久久久久久久免费观看 | 亚洲精品国产高清 | 欧美小视频在线观看 | 天天综合操 | 久久中文精品视频 | 91免费在线播放 | 日韩一区二区三区在线观看 | 精品国产一区二区三区蜜臀 | www免费看 | 在线小视频你懂的 | 91精品色| 欧美性生活一级片 | 色综合久久天天 | 亚洲综合激情 | 午夜精品一区二区三区视频免费看 | 日韩网站在线观看 | 成人av影视在线 | 网站在线观看你们懂的 | 成人性生爱a∨ | 97福利在线 | 免费成人在线观看视频 | 国产一区欧美一区 | 99在线免费视频 | 国产精品久久精品 | 伊人五月婷 | 韩国av免费在线观看 | 精品中文字幕在线 | 欧美另类老妇 | a天堂免费| 天天射天天操天天干 | 国产免费xvideos视频入口 | 免费av大片 | 中文字幕免费观看视频 | 五月激情电影 | 日韩在线观看影院 | 手机看片99 | 蜜臀一区二区三区精品免费视频 | 97超碰影视 | 国产日韩精品在线观看 | 色网站国产精品 | 草久在线 | 激情影院在线观看 | 色网站国产精品 | 色狠狠狠| 开心激情五月网 | www激情网 | 久久久久久久久福利 | 久久人人爽 | 色综合中文字幕 | 亚洲视频专区在线 | 国产视频在线观看一区 | 日本中文字幕电影在线免费观看 | 97精产国品一二三产区在线 | 狠狠躁日日躁狂躁夜夜躁 | 美女av电影 | 综合色综合 | 日韩av中文字幕在线免费观看 | 免费91麻豆精品国产自产在线观看 | 成人试看120秒 | 91麻豆国产 | 亚洲午夜久久久综合37日本 | 国产中文字幕在线观看 | 国产一级黄色av | 亚洲国内在线 | 色综合天天做天天爱 | 97超碰超碰久久福利超碰 | 99re6热在线精品视频 | 女女av在线 | 亚洲电影久久 | 免费在线激情电影 | 97品白浆高清久久久久久 | 麻豆影视在线免费观看 | va视频在线观看 | 亚洲va欧美va人人爽春色影视 | 亚洲日本在线一区 | 成人网在线免费视频 | 欧美日韩亚洲第一页 | 黄色影院在线观看 | 久久不卡国产精品一区二区 | 99热这里只有精品国产首页 | 一级黄色大片在线观看 | 欧美日韩高清免费 | www.狠狠插.com| 亚洲精品国产精品国 | 三三级黄色片之日韩 | 香蕉视频网址 | av一级片网站| 日韩久久一区二区 | 午夜视频在线观看一区二区 | 久久高清片| 欧美成人精品三级在线观看播放 | 国产精品热 |