{"id":6754,"date":"2021-01-02T15:06:35","date_gmt":"2021-01-02T14:06:35","guid":{"rendered":"https:\/\/myoceane.fr\/?p=6754"},"modified":"2021-01-04T03:04:53","modified_gmt":"2021-01-04T02:04:53","slug":"%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module","status":"publish","type":"post","link":"https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/","title":{"rendered":"\u4f7f\u7528 Nginx \u8207 Redis2-Nginx-Module \u4ee3\u7406 Redis API"},"content":{"rendered":"<div id=\"fb-root\"><\/div>\n<p style=\"text-align: justify;\">\u672c\u7bc7\u60f3\u8981\u7d00\u9304\u4e00\u4e9b\u5728\u7814\u7a76\u5b89\u88dd Redis Server \u6642\u5019\u7684\u4e00\u4e9b\u8003\u91cf\uff0c\u6709\u95dc Redis Server \u7684\u5b89\u88dd\u5176\u5be6\u4e26\u4e0d\u8907\u96dc\uff0c\u53ea\u662f\u4f5c\u8005\u6709\u4e00\u4e9b\u7279\u6b8a\u7684\u74b0\u5883\u9700\u6c42\uff0c\u6240\u4ee5\u624d\u9700\u8981\u6bd4\u8f03\u8907\u96dc\u7684\u7cfb\u7d71\u8a2d\u5b9a\uff0c\u95dc\u65bc\u5982\u4f55\u5728\u4e00\u53f0 VM \u4e0a\u9762\u5b89\u88dd Redis Server \u53ef\u4ee5\u53c3\u8003&nbsp;<a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-and-secure-redis-on-ubuntu-18-04\" data-rich-text-format-boundary=\"true\">How to Install and Secure Redis on Ubuntu 18.04<\/a> \uff0c\u672c\u7bc7\u7684\u524d\u534a\u90e8\u4e5f\u662f\u7a0d\u5fae\u7d00\u9304\u4e00\u4e9b\u5e38\u7528\u7684\u64cd\u4f5c\u6307\u4ee4\uff0c\u5f8c\u534a\u90e8\u5247\u662f\u7d00\u9304\u5982\u4f55\u900f\u904e nginx server \u53bb\u8ddf redis server \u505a\u4e92\u52d5\uff0c\u6700\u4e3b\u8981\u6709\u9019\u500b\u9700\u6c42\u662f\u56e0\u70ba\u7b46\u8005\u4f7f\u7528 Azure Webapp Container \u4f5c\u70ba\u90e8\u7f72 Redis \u7684\u6a19\u7684\uff0c\u4f46\u662f\u5728\u5be6\u4f5c\u5b89\u88dd\u8207\u555f\u52d5 redis \u7684\u6642\u5019\u51fa\u73fe\u932f\u8aa4\u8a0a\u606f\uff0c\u4f3c\u4e4e\u7121\u6cd5\u76f4\u63a5\u90e8\u7f72\u3002<\/p>\n<h5>Install and Start Redis Server<\/h5>\n<p>\u5728 Ubuntu \u4e0a\u9762\u5b89\u88dd Redis Server \u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u7684\u6307\u4ee4\uff1a<\/p>\n<pre class=\"lang:bash\">apt-get install -y redis-server<\/pre>\n<p>\u555f\u52d5\u95dc\u9589 Redis Server<\/p>\n<pre class=\"lang:bash\">systemctl start redis.service\nsystemctl status redis.service\nsystemctl restart redis.service<\/pre>\n<p>\u4e5f\u53ef\u4ee5\u4f7f\u7528 service&nbsp; cmd \u505a\u63a7\u5236<\/p>\n<pre class=\"lang:bash\">root@c6bc184cd0dc:\/home@ service --status-all\n [ + ]  apache-htcacheclean\n [ + ]  apache2\n [ - ]  redis-server\n [ + ]  ssh\n \nroot@c6bc184cd0dc:\/home@ service redis-server start<\/pre>\n<h5>\u90e8\u7f72\u65bc Azure Webapp \u4e4b\u5f8c\u9047\u5230\u7684\u554f\u984c\uff1a<\/h5>\n<p>\u7d93\u904e\u4ee5\u4e0a\u7684\u6307\u4ee4\u5b89\u88dd\u8207\u555f\u52d5\u4e4b\u5f8c\uff0c\u7b46\u8005\u5c07 redis server \u9810\u8a2d\u7aef\u53e3\u8a2d\u5728 80\uff0c\u6b64\u6642\u67e5\u770b linux \u7cfb\u7d71\u53ef\u4ee5\u767c\u73fe redis-server \u5df2\u7d93\u6210\u529f\u8dd1\u5728 127.0.0.1:80 \u7684\u4f4d\u7f6e\u4e0a\u9762\u3002<\/p>\n<pre class=\"lang:bash\">root@69ef6b1e44ba:\/usr\/bin@ ps -ef\nUID        PID  PPID  C STIME TTY          TIME CMD\nroot        30     1  0  2020 ?        00:00:00 \/usr\/sbin\/sshd\nrabbitmq   497     1  0  2020 ?        00:00:00 \/usr\/lib\/erlang\/erts-7.3\/bin\/epmd -daemon\nroot     13888    30  0 12:49 ?        00:00:00 sshd: root@pts\/1\nroot     13891 13888  0 12:49 pts\/1    00:00:00 \/bin\/bash -l\nroot     13998     1  0 12:52 ?        00:00:00 redis-server 127.0.0.1:80\nroot     14001     1  0 12:52 ?        00:00:00 sleep 10\nroot     14002 13891  0 12:52 pts\/1    00:00:00 ps -ef<\/pre>\n<p style=\"text-align: justify;\">\u4f46\u662f\u6b64\u6642\u5982\u679c\u5f9e\u53e6\u5916\u4e00\u53f0\u7d42\u7aef\u5c0d\u8dd1\u6709 redis-server \u7684 Azure Webapp \u505a redis-cli \u537b\u6703\u5f97\u5230\u4ee5\u4e0b\u7684\u932f\u8aa4\u8a0a\u606f\uff1a<strong>Error: Protocol error, got &#8220;H&#8221; as reply type byte <\/strong>\u76ee\u524d\u731c\u60f3\u662f\u56e0\u70ba Azure Webapp \u5728\u5c0d docker \u61c9\u8a72\u6709\u4e00\u4e9b\u5c01\u9396\u3002<\/p>\n<pre class=\"lang:bash\">usermbp:~ user$ redis-cli -h xxxxredis.azurewebsites.net -p 80 ping\nError: Protocol error, got \"H\" as reply type byte<\/pre>\n<p>\u5099\u8a3b\uff1a\u6b64\u6642\u5728 server \u7aef\u7684 \/var\/log\/redis\/redis-server.log \u4e26\u6c92\u6709\u51fa\u73fe\u932f\u8aa4\u8a0a\u606f\uff01<br>\u5099\u8a3b\uff1a\u95dc\u65bc <a href=\"https:\/\/redis.io\/topics\/rediscli\">redis-cli \u6307\u4ee4\u7684\u4ecb\u7d39<\/a><\/p>\n<h5>Configure \/etc\/redis\/redis.conf<\/h5>\n<p>\u95dc\u65bc\u8abf\u63a7 redis \u4f3a\u670d\u5668\u7684\u8a2d\u5b9a\u53ef\u4ee5\u53c3\u8003\u4ee5\u4e0b\u7684\u6a94\u6848\uff0c\u5176\u5be6\u6709\u975e\u5e38\u591a\u53c3\u6578\u53ef\u4ee5\u63a7\u5236\u3002<\/p>\n<pre class=\"lang:bash\">\/\/ Redis configuration file example.\n\/\/\n\/\/ Note that in order to read the configuration file, Redis must be\n\/\/ started with the file path as first argument:\n\/\/\n\/\/ .\/redis-server \/path\/to\/redis.conf\n\n\/\/ Note on units: when memory size is needed, it is possible to specify\n\/\/ it in the usual form of 1k 5GB 4M and so forth:\n\/\/\n\/\/ 1k =&gt; 1000 bytes\n\/\/ 1kb =&gt; 1024 bytes\n\/\/ 1m =&gt; 1000000 bytes\n\/\/ 1mb =&gt; 1024*1024 bytes\n\/\/ 1g =&gt; 1000000000 bytes\n\/\/ 1gb =&gt; 1024*1024*1024 bytes\n\/\/\n\/\/ units are case insensitive so 1GB 1Gb 1gB are all the same.\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ INCLUDES \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Include one or more other config files here.  This is useful if you\n\/\/ have a standard template that goes to all Redis servers but also need\n\/\/ to customize a few per-server settings.  Include files can include\n\/\/ other files, so use this wisely.\n\/\/\n\/\/ Notice option \"include\" won't be rewritten by command \"CONFIG REWRITE\"\n\/\/ from admin or Redis Sentinel. Since Redis always uses the last processed\n\/\/ line as value of a configuration directive, you'd better put includes\n\/\/ at the beginning of this file to avoid overwriting config change at runtime.\n\/\/\n\/\/ If instead you are interested in using includes to override configuration\n\/\/ options, it is better to use include as the last line.\n\/\/\n\/\/ include \/path\/to\/local.conf\n\/\/ include \/path\/to\/other.conf\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ GENERAL  \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ By default Redis does not run as a daemon. Use 'yes' if you need it.\n\/\/ Note that Redis will write a pid file in \/var\/run\/redis.pid when daemonized.\ndaemonize yes\n\n\/\/ When running daemonized, Redis writes a pid file in \/var\/run\/redis.pid by\n\/\/ default. You can specify a custom pid file location here.\npidfile \/var\/run\/redis\/redis-server.pid\n\n\/\/ Accept connections on the specified port, default is 6379.\n\/\/ If port 0 is specified Redis will not listen on a TCP socket.\nport 6379\n\n\/\/ TCP listen() backlog.\n\/\/\n\/\/ In high requests-per-second environments you need an high backlog in order\n\/\/ to avoid slow clients connections issues. Note that the Linux kernel\n\/\/ will silently truncate it to the value of \/proc\/sys\/net\/core\/somaxconn so\n\/\/ make sure to raise both the value of somaxconn and tcp_max_syn_backlog\n\/\/ in order to get the desired effect.\ntcp-backlog 511\n\n\/\/ By default Redis listens for connections from all the network interfaces\n\/\/ available on the server. It is possible to listen to just one or multiple\n\/\/ interfaces using the \"bind\" configuration directive, followed by one or\n\/\/ more IP addresses.\n\/\/\n\/\/ Examples:\n\/\/\n\/\/ bind 192.168.1.100 10.0.0.1\nbind 127.0.0.1\n\n\/\/ Specify the path for the Unix socket that will be used to listen for\n\/\/ incoming connections. There is no default, so Redis will not listen\n\/\/ on a unix socket when not specified.\n\/\/\n\/\/ unixsocket \/var\/run\/redis\/redis.sock\n\/\/ unixsocketperm 700\n\n\/\/ Close the connection after a client is idle for N seconds (0 to disable)\ntimeout 0\n\n\/\/ TCP keepalive.\n\/\/\n\/\/ If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence\n\/\/ of communication. This is useful for two reasons:\n\/\/\n\/\/ 1) Detect dead peers.\n\/\/ 2) Take the connection alive from the point of view of network\n\/\/    equipment in the middle.\n\/\/\n\/\/ On Linux, the specified value (in seconds) is the period used to send ACKs.\n\/\/ Note that to close the connection the double of the time is needed.\n\/\/ On other kernels the period depends on the kernel configuration.\n\/\/\n\/\/ A reasonable value for this option is 60 seconds.\ntcp-keepalive 0\n\n\/\/ Specify the server verbosity level.\n\/\/ This can be one of:\n\/\/ debug (a lot of information, useful for development\/testing)\n\/\/ verbose (many rarely useful info, but not a mess like the debug level)\n\/\/ notice (moderately verbose, what you want in production probably)\n\/\/ warning (only very important \/ critical messages are logged)\nloglevel notice\n\n\/\/ Specify the log file name. Also the empty string can be used to force\n\/\/ Redis to log on the standard output. Note that if you use standard\n\/\/ output for logging but daemonize, logs will be sent to \/dev\/null\nlogfile \/var\/log\/redis\/redis-server.log\n\n\/\/ To enable logging to the system logger, just set 'syslog-enabled' to yes,\n\/\/ and optionally update the other syslog parameters to suit your needs.\n\/\/ syslog-enabled no\n\n\/\/ Specify the syslog identity.\n\/\/ syslog-ident redis\n\n\/\/ Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7.\n\/\/ syslog-facility local0\n\n\/\/ Set the number of databases. The default database is DB 0, you can select\n\/\/ a different one on a per-connection basis using SELECT &lt;dbid&gt; where\n\/\/ dbid is a number between 0 and 'databases'-1\ndatabases 16\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ SNAPSHOTTING  \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\n\/\/ Save the DB on disk:\n\/\/\n\/\/   save &lt;seconds&gt; &lt;changes&gt;\n\/\/\n\/\/   Will save the DB if both the given number of seconds and the given\n\/\/   number of write operations against the DB occurred.\n\/\/\n\/\/   In the example below the behaviour will be to save:\n\/\/   after 900 sec (15 min) if at least 1 key changed\n\/\/   after 300 sec (5 min) if at least 10 keys changed\n\/\/   after 60 sec if at least 10000 keys changed\n\/\/\n\/\/   Note: you can disable saving completely by commenting out all \"save\" lines.\n\/\/\n\/\/   It is also possible to remove all the previously configured save\n\/\/   points by adding a save directive with a single empty string argument\n\/\/   like in the following example:\n\/\/\n\/\/   save \"\"\n\nsave 900 1\nsave 300 10\nsave 60 10000\n\n\/\/ By default Redis will stop accepting writes if RDB snapshots are enabled\n\/\/ (at least one save point) and the latest background save failed.\n\/\/ This will make the user aware (in a hard way) that data is not persisting\n\/\/ on disk properly, otherwise chances are that no one will notice and some\n\/\/ disaster will happen.\n\/\/\n\/\/ If the background saving process will start working again Redis will\n\/\/ automatically allow writes again.\n\/\/\n\/\/ However if you have setup your proper monitoring of the Redis server\n\/\/ and persistence, you may want to disable this feature so that Redis will\n\/\/ continue to work as usual even if there are problems with disk,\n\/\/ permissions, and so forth.\nstop-writes-on-bgsave-error yes\n\n\/\/ Compress string objects using LZF when dump .rdb databases?\n\/\/ For default that's set to 'yes' as it's almost always a win.\n\/\/ If you want to save some CPU in the saving child set it to 'no' but\n\/\/ the dataset will likely be bigger if you have compressible values or keys.\nrdbcompression yes\n\n\/\/ Since version 5 of RDB a CRC64 checksum is placed at the end of the file.\n\/\/ This makes the format more resistant to corruption but there is a performance\n\/\/ hit to pay (around 10%) when saving and loading RDB files, so you can disable it\n\/\/ for maximum performances.\n\/\/\n\/\/ RDB files created with checksum disabled have a checksum of zero that will\n\/\/ tell the loading code to skip the check.\nrdbchecksum yes\n\n\/\/ The filename where to dump the DB\ndbfilename dump.rdb\n\n\/\/ The working directory.\n\/\/\n\/\/ The DB will be written inside this directory, with the filename specified\n\/\/ above using the 'dbfilename' configuration directive.\n\/\/\n\/\/ The Append Only File will also be created inside this directory.\n\/\/\n\/\/ Note that you must specify a directory here, not a file name.\ndir \/var\/lib\/redis\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ REPLICATION \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Master-Slave replication. Use slaveof to make a Redis instance a copy of\n\/\/ another Redis server. A few things to understand ASAP about Redis replication.\n\/\/\n\/\/ 1) Redis replication is asynchronous, but you can configure a master to\n\/\/    stop accepting writes if it appears to be not connected with at least\n\/\/    a given number of slaves.\n\/\/ 2) Redis slaves are able to perform a partial resynchronization with the\n\/\/    master if the replication link is lost for a relatively small amount of\n\/\/    time. You may want to configure the replication backlog size (see the next\n\/\/    sections of this file) with a sensible value depending on your needs.\n\/\/ 3) Replication is automatic and does not need user intervention. After a\n\/\/    network partition slaves automatically try to reconnect to masters\n\/\/    and resynchronize with them.\n\/\/\n\/\/ slaveof &lt;masterip&gt; &lt;masterport&gt;\n\n\/\/ If the master is password protected (using the \"requirepass\" configuration\n\/\/ directive below) it is possible to tell the slave to authenticate before\n\/\/ starting the replication synchronization process, otherwise the master will\n\/\/ refuse the slave request.\n\/\/\n\/\/ masterauth &lt;master-password&gt;\n\n\/\/ When a slave loses its connection with the master, or when the replication\n\/\/ is still in progress, the slave can act in two different ways:\n\/\/\n\/\/ 1) if slave-serve-stale-data is set to 'yes' (the default) the slave will\n\/\/    still reply to client requests, possibly with out of date data, or the\n\/\/    data set may just be empty if this is the first synchronization.\n\/\/\n\/\/ 2) if slave-serve-stale-data is set to 'no' the slave will reply with\n\/\/    an error \"SYNC with master in progress\" to all the kind of commands\n\/\/    but to INFO and SLAVEOF.\n\/\/\nslave-serve-stale-data yes\n\n\/\/ You can configure a slave instance to accept writes or not. Writing against\n\/\/ a slave instance may be useful to store some ephemeral data (because data\n\/\/ written on a slave will be easily deleted after resync with the master) but\n\/\/ may also cause problems if clients are writing to it because of a\n\/\/ misconfiguration.\n\/\/\n\/\/ Since Redis 2.6 by default slaves are read-only.\n\/\/\n\/\/ Note: read only slaves are not designed to be exposed to untrusted clients\n\/\/ on the internet. It's just a protection layer against misuse of the instance.\n\/\/ Still a read only slave exports by default all the administrative commands\n\/\/ such as CONFIG, DEBUG, and so forth. To a limited extent you can improve\n\/\/ security of read only slaves using 'rename-command' to shadow all the\n\/\/ administrative \/ dangerous commands.\nslave-read-only yes\n\n\/\/ Replication SYNC strategy: disk or socket.\n\/\/\n\/\/ -------------------------------------------------------\n\/\/ WARNING: DISKLESS REPLICATION IS EXPERIMENTAL CURRENTLY\n\/\/ -------------------------------------------------------\n\/\/\n\/\/ New slaves and reconnecting slaves that are not able to continue the replication\n\/\/ process just receiving differences, need to do what is called a \"full\n\/\/ synchronization\". An RDB file is transmitted from the master to the slaves.\n\/\/ The transmission can happen in two different ways:\n\/\/\n\/\/ 1) Disk-backed: The Redis master creates a new process that writes the RDB\n\/\/                 file on disk. Later the file is transferred by the parent\n\/\/                 process to the slaves incrementally.\n\/\/ 2) Diskless: The Redis master creates a new process that directly writes the\n\/\/              RDB file to slave sockets, without touching the disk at all.\n\/\/\n\/\/ With disk-backed replication, while the RDB file is generated, more slaves\n\/\/ can be queued and served with the RDB file as soon as the current child producing\n\/\/ the RDB file finishes its work. With diskless replication instead once\n\/\/ the transfer starts, new slaves arriving will be queued and a new transfer\n\/\/ will start when the current one terminates.\n\/\/\n\/\/ When diskless replication is used, the master waits a configurable amount of\n\/\/ time (in seconds) before starting the transfer in the hope that multiple slaves\n\/\/ will arrive and the transfer can be parallelized.\n\/\/\n\/\/ With slow disks and fast (large bandwidth) networks, diskless replication\n\/\/ works better.\nrepl-diskless-sync no\n\n\/\/ When diskless replication is enabled, it is possible to configure the delay\n\/\/ the server waits in order to spawn the child that transfers the RDB via socket\n\/\/ to the slaves.\n\/\/\n\/\/ This is important since once the transfer starts, it is not possible to serve\n\/\/ new slaves arriving, that will be queued for the next RDB transfer, so the server\n\/\/ waits a delay in order to let more slaves arrive.\n\/\/\n\/\/ The delay is specified in seconds, and by default is 5 seconds. To disable\n\/\/ it entirely just set it to 0 seconds and the transfer will start ASAP.\nrepl-diskless-sync-delay 5\n\n\/\/ Slaves send PINGs to server in a predefined interval. It's possible to change\n\/\/ this interval with the repl_ping_slave_period option. The default value is 10\n\/\/ seconds.\n\/\/\n\/\/ repl-ping-slave-period 10\n\n\/\/ The following option sets the replication timeout for:\n\/\/\n\/\/ 1) Bulk transfer I\/O during SYNC, from the point of view of slave.\n\/\/ 2) Master timeout from the point of view of slaves (data, pings).\n\/\/ 3) Slave timeout from the point of view of masters (REPLCONF ACK pings).\n\/\/\n\/\/ It is important to make sure that this value is greater than the value\n\/\/ specified for repl-ping-slave-period otherwise a timeout will be detected\n\/\/ every time there is low traffic between the master and the slave.\n\/\/\n\/\/ repl-timeout 60\n\n\/\/ Disable TCP_NODELAY on the slave socket after SYNC?\n\/\/\n\/\/ If you select \"yes\" Redis will use a smaller number of TCP packets and\n\/\/ less bandwidth to send data to slaves. But this can add a delay for\n\/\/ the data to appear on the slave side, up to 40 milliseconds with\n\/\/ Linux kernels using a default configuration.\n\/\/\n\/\/ If you select \"no\" the delay for data to appear on the slave side will\n\/\/ be reduced but more bandwidth will be used for replication.\n\/\/\n\/\/ By default we optimize for low latency, but in very high traffic conditions\n\/\/ or when the master and slaves are many hops away, turning this to \"yes\" may\n\/\/ be a good idea.\nrepl-disable-tcp-nodelay no\n\n\/\/ Set the replication backlog size. The backlog is a buffer that accumulates\n\/\/ slave data when slaves are disconnected for some time, so that when a slave\n\/\/ wants to reconnect again, often a full resync is not needed, but a partial\n\/\/ resync is enough, just passing the portion of data the slave missed while\n\/\/ disconnected.\n\/\/\n\/\/ The bigger the replication backlog, the longer the time the slave can be\n\/\/ disconnected and later be able to perform a partial resynchronization.\n\/\/\n\/\/ The backlog is only allocated once there is at least a slave connected.\n\/\/\n\/\/ repl-backlog-size 1mb\n\n\/\/ After a master has no longer connected slaves for some time, the backlog\n\/\/ will be freed. The following option configures the amount of seconds that\n\/\/ need to elapse, starting from the time the last slave disconnected, for\n\/\/ the backlog buffer to be freed.\n\/\/\n\/\/ A value of 0 means to never release the backlog.\n\/\/\n\/\/ repl-backlog-ttl 3600\n\n\/\/ The slave priority is an integer number published by Redis in the INFO output.\n\/\/ It is used by Redis Sentinel in order to select a slave to promote into a\n\/\/ master if the master is no longer working correctly.\n\/\/\n\/\/ A slave with a low priority number is considered better for promotion, so\n\/\/ for instance if there are three slaves with priority 10, 100, 25 Sentinel will\n\/\/ pick the one with priority 10, that is the lowest.\n\/\/\n\/\/ However a special priority of 0 marks the slave as not able to perform the\n\/\/ role of master, so a slave with priority of 0 will never be selected by\n\/\/ Redis Sentinel for promotion.\n\/\/\n\/\/ By default the priority is 100.\nslave-priority 100\n\n\/\/ It is possible for a master to stop accepting writes if there are less than\n\/\/ N slaves connected, having a lag less or equal than M seconds.\n\/\/\n\/\/ The N slaves need to be in \"online\" state.\n\/\/\n\/\/ The lag in seconds, that must be &lt;= the specified value, is calculated from\n\/\/ the last ping received from the slave, that is usually sent every second.\n\/\/\n\/\/ This option does not GUARANTEE that N replicas will accept the write, but\n\/\/ will limit the window of exposure for lost writes in case not enough slaves\n\/\/ are available, to the specified number of seconds.\n\/\/\n\/\/ For example to require at least 3 slaves with a lag &lt;= 10 seconds use:\n\/\/\n\/\/ min-slaves-to-write 3\n\/\/ min-slaves-max-lag 10\n\/\/\n\/\/ Setting one or the other to 0 disables the feature.\n\/\/\n\/\/ By default min-slaves-to-write is set to 0 (feature disabled) and\n\/\/ min-slaves-max-lag is set to 10.\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ SECURITY \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Require clients to issue AUTH &lt;PASSWORD&gt; before processing any other\n\/\/ commands.  This might be useful in environments in which you do not trust\n\/\/ others with access to the host running redis-server.\n\/\/\n\/\/ This should stay commented out for backward compatibility and because most\n\/\/ people do not need auth (e.g. they run their own servers).\n\/\/\n\/\/ Warning: since Redis is pretty fast an outside user can try up to\n\/\/ 150k passwords per second against a good box. This means that you should\n\/\/ use a very strong password otherwise it will be very easy to break.\n\/\/\n\/\/ requirepass foobared\n\n\/\/ Command renaming.\n\/\/\n\/\/ It is possible to change the name of dangerous commands in a shared\n\/\/ environment. For instance the CONFIG command may be renamed into something\n\/\/ hard to guess so that it will still be available for internal-use tools\n\/\/ but not available for general clients.\n\/\/\n\/\/ Example:\n\/\/\n\/\/ rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52\n\/\/\n\/\/ It is also possible to completely kill a command by renaming it into\n\/\/ an empty string:\n\/\/\n\/\/ rename-command CONFIG \"\"\n\/\/\n\/\/ Please note that changing the name of commands that are logged into the\n\/\/ AOF file or transmitted to slaves may cause problems.\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ LIMITS \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Set the max number of connected clients at the same time. By default\n\/\/ this limit is set to 10000 clients, however if the Redis server is not\n\/\/ able to configure the process file limit to allow for the specified limit\n\/\/ the max number of allowed clients is set to the current file limit\n\/\/ minus 32 (as Redis reserves a few file descriptors for internal uses).\n\/\/\n\/\/ Once the limit is reached Redis will close all the new connections sending\n\/\/ an error 'max number of clients reached'.\n\/\/\n\/\/ maxclients 10000\n\n\/\/ Don't use more memory than the specified amount of bytes.\n\/\/ When the memory limit is reached Redis will try to remove keys\n\/\/ according to the eviction policy selected (see maxmemory-policy).\n\/\/\n\/\/ If Redis can't remove keys according to the policy, or if the policy is\n\/\/ set to 'noeviction', Redis will start to reply with errors to commands\n\/\/ that would use more memory, like SET, LPUSH, and so on, and will continue\n\/\/ to reply to read-only commands like GET.\n\/\/\n\/\/ This option is usually useful when using Redis as an LRU cache, or to set\n\/\/ a hard memory limit for an instance (using the 'noeviction' policy).\n\/\/\n\/\/ WARNING: If you have slaves attached to an instance with maxmemory on,\n\/\/ the size of the output buffers needed to feed the slaves are subtracted\n\/\/ from the used memory count, so that network problems \/ resyncs will\n\/\/ not trigger a loop where keys are evicted, and in turn the output\n\/\/ buffer of slaves is full with DELs of keys evicted triggering the deletion\n\/\/ of more keys, and so forth until the database is completely emptied.\n\/\/\n\/\/ In short... if you have slaves attached it is suggested that you set a lower\n\/\/ limit for maxmemory so that there is some free RAM on the system for slave\n\/\/ output buffers (but this is not needed if the policy is 'noeviction').\n\/\/\n\/\/ maxmemory &lt;bytes&gt;\n\n\/\/ MAXMEMORY POLICY: how Redis will select what to remove when maxmemory\n\/\/ is reached. You can select among five behaviors:\n\/\/\n\/\/ volatile-lru -&gt; remove the key with an expire set using an LRU algorithm\n\/\/ allkeys-lru -&gt; remove any key according to the LRU algorithm\n\/\/ volatile-random -&gt; remove a random key with an expire set\n\/\/ allkeys-random -&gt; remove a random key, any key\n\/\/ volatile-ttl -&gt; remove the key with the nearest expire time (minor TTL)\n\/\/ noeviction -&gt; don't expire at all, just return an error on write operations\n\/\/\n\/\/ Note: with any of the above policies, Redis will return an error on write\n\/\/       operations, when there are no suitable keys for eviction.\n\/\/\n\/\/       At the date of writing these commands are: set setnx setex append\n\/\/       incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd\n\/\/       sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby\n\/\/       zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby\n\/\/       getset mset msetnx exec sort\n\/\/\n\/\/ The default is:\n\/\/\n\/\/ maxmemory-policy noeviction\n\n\/\/ LRU and minimal TTL algorithms are not precise algorithms but approximated\n\/\/ algorithms (in order to save memory), so you can tune it for speed or\n\/\/ accuracy. For default Redis will check five keys and pick the one that was\n\/\/ used less recently, you can change the sample size using the following\n\/\/ configuration directive.\n\/\/\n\/\/ The default of 5 produces good enough results. 10 Approximates very closely\n\/\/ true LRU but costs a bit more CPU. 3 is very fast but not very accurate.\n\/\/\n\/\/ maxmemory-samples 5\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ APPEND ONLY MODE \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ By default Redis asynchronously dumps the dataset on disk. This mode is\n\/\/ good enough in many applications, but an issue with the Redis process or\n\/\/ a power outage may result into a few minutes of writes lost (depending on\n\/\/ the configured save points).\n\/\/\n\/\/ The Append Only File is an alternative persistence mode that provides\n\/\/ much better durability. For instance using the default data fsync policy\n\/\/ (see later in the config file) Redis can lose just one second of writes in a\n\/\/ dramatic event like a server power outage, or a single write if something\n\/\/ wrong with the Redis process itself happens, but the operating system is\n\/\/ still running correctly.\n\/\/\n\/\/ AOF and RDB persistence can be enabled at the same time without problems.\n\/\/ If the AOF is enabled on startup Redis will load the AOF, that is the file\n\/\/ with the better durability guarantees.\n\/\/\n\/\/ Please check http:\/\/redis.io\/topics\/persistence for more information.\n\nappendonly no\n\n\/\/ The name of the append only file (default: \"appendonly.aof\")\n\nappendfilename \"appendonly.aof\"\n\n\/\/ The fsync() call tells the Operating System to actually write data on disk\n\/\/ instead of waiting for more data in the output buffer. Some OS will really flush\n\/\/ data on disk, some other OS will just try to do it ASAP.\n\/\/\n\/\/ Redis supports three different modes:\n\/\/\n\/\/ no: don't fsync, just let the OS flush the data when it wants. Faster.\n\/\/ always: fsync after every write to the append only log. Slow, Safest.\n\/\/ everysec: fsync only one time every second. Compromise.\n\/\/\n\/\/ The default is \"everysec\", as that's usually the right compromise between\n\/\/ speed and data safety. It's up to you to understand if you can relax this to\n\/\/ \"no\" that will let the operating system flush the output buffer when\n\/\/ it wants, for better performances (but if you can live with the idea of\n\/\/ some data loss consider the default persistence mode that's snapshotting),\n\/\/ or on the contrary, use \"always\" that's very slow but a bit safer than\n\/\/ everysec.\n\/\/\n\/\/ More details please check the following article:\n\/\/ http:\/\/antirez.com\/post\/redis-persistence-demystified.html\n\/\/\n\/\/ If unsure, use \"everysec\".\n\n\/\/ appendfsync always\nappendfsync everysec\n\/\/ appendfsync no\n\n\/\/ When the AOF fsync policy is set to always or everysec, and a background\n\/\/ saving process (a background save or AOF log background rewriting) is\n\/\/ performing a lot of I\/O against the disk, in some Linux configurations\n\/\/ Redis may block too long on the fsync() call. Note that there is no fix for\n\/\/ this currently, as even performing fsync in a different thread will block\n\/\/ our synchronous write(2) call.\n\/\/\n\/\/ In order to mitigate this problem it's possible to use the following option\n\/\/ that will prevent fsync() from being called in the main process while a\n\/\/ BGSAVE or BGREWRITEAOF is in progress.\n\/\/\n\/\/ This means that while another child is saving, the durability of Redis is\n\/\/ the same as \"appendfsync none\". In practical terms, this means that it is\n\/\/ possible to lose up to 30 seconds of log in the worst scenario (with the\n\/\/ default Linux settings).\n\/\/\n\/\/ If you have latency problems turn this to \"yes\". Otherwise leave it as\n\/\/ \"no\" that is the safest pick from the point of view of durability.\n\nno-appendfsync-on-rewrite no\n\n\/\/ Automatic rewrite of the append only file.\n\/\/ Redis is able to automatically rewrite the log file implicitly calling\n\/\/ BGREWRITEAOF when the AOF log size grows by the specified percentage.\n\/\/\n\/\/ This is how it works: Redis remembers the size of the AOF file after the\n\/\/ latest rewrite (if no rewrite has happened since the restart, the size of\n\/\/ the AOF at startup is used).\n\/\/\n\/\/ This base size is compared to the current size. If the current size is\n\/\/ bigger than the specified percentage, the rewrite is triggered. Also\n\/\/ you need to specify a minimal size for the AOF file to be rewritten, this\n\/\/ is useful to avoid rewriting the AOF file even if the percentage increase\n\/\/ is reached but it is still pretty small.\n\/\/\n\/\/ Specify a percentage of zero in order to disable the automatic AOF\n\/\/ rewrite feature.\n\nauto-aof-rewrite-percentage 100\nauto-aof-rewrite-min-size 64mb\n\n\/\/ An AOF file may be found to be truncated at the end during the Redis\n\/\/ startup process, when the AOF data gets loaded back into memory.\n\/\/ This may happen when the system where Redis is running\n\/\/ crashes, especially when an ext4 filesystem is mounted without the\n\/\/ data=ordered option (however this can't happen when Redis itself\n\/\/ crashes or aborts but the operating system still works correctly).\n\/\/\n\/\/ Redis can either exit with an error when this happens, or load as much\n\/\/ data as possible (the default now) and start if the AOF file is found\n\/\/ to be truncated at the end. The following option controls this behavior.\n\/\/\n\/\/ If aof-load-truncated is set to yes, a truncated AOF file is loaded and\n\/\/ the Redis server starts emitting a log to inform the user of the event.\n\/\/ Otherwise if the option is set to no, the server aborts with an error\n\/\/ and refuses to start. When the option is set to no, the user requires\n\/\/ to fix the AOF file using the \"redis-check-aof\" utility before to restart\n\/\/ the server.\n\/\/\n\/\/ Note that if the AOF file will be found to be corrupted in the middle\n\/\/ the server will still exit with an error. This option only applies when\n\/\/ Redis will try to read more data from the AOF file but not enough bytes\n\/\/ will be found.\naof-load-truncated yes\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ LUA SCRIPTING  \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Max execution time of a Lua script in milliseconds.\n\/\/\n\/\/ If the maximum execution time is reached Redis will log that a script is\n\/\/ still in execution after the maximum allowed time and will start to\n\/\/ reply to queries with an error.\n\/\/\n\/\/ When a long running script exceeds the maximum execution time only the\n\/\/ SCRIPT KILL and SHUTDOWN NOSAVE commands are available. The first can be\n\/\/ used to stop a script that did not yet called write commands. The second\n\/\/ is the only way to shut down the server in the case a write command was\n\/\/ already issued by the script but the user doesn't want to wait for the natural\n\/\/ termination of the script.\n\/\/\n\/\/ Set it to 0 or a negative value for unlimited execution without warnings.\nlua-time-limit 5000\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ REDIS CLUSTER  \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\n\/\/ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\/\/ WARNING EXPERIMENTAL: Redis Cluster is considered to be stable code, however\n\/\/ in order to mark it as \"mature\" we need to wait for a non trivial percentage\n\/\/ of users to deploy it in production.\n\/\/ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\/\/\n\/\/ Normal Redis instances can't be part of a Redis Cluster; only nodes that are\n\/\/ started as cluster nodes can. In order to start a Redis instance as a\n\/\/ cluster node enable the cluster support uncommenting the following:\n\/\/\n\/\/ cluster-enabled yes\n\n\/\/ Every cluster node has a cluster configuration file. This file is not\n\/\/ intended to be edited by hand. It is created and updated by Redis nodes.\n\/\/ Every Redis Cluster node requires a different cluster configuration file.\n\/\/ Make sure that instances running in the same system do not have\n\/\/ overlapping cluster configuration file names.\n\/\/\n\/\/ cluster-config-file nodes-6379.conf\n\n\/\/ Cluster node timeout is the amount of milliseconds a node must be unreachable\n\/\/ for it to be considered in failure state.\n\/\/ Most other internal time limits are multiple of the node timeout.\n\/\/\n\/\/ cluster-node-timeout 15000\n\n\/\/ A slave of a failing master will avoid to start a failover if its data\n\/\/ looks too old.\n\/\/\n\/\/ There is no simple way for a slave to actually have a exact measure of\n\/\/ its \"data age\", so the following two checks are performed:\n\/\/\n\/\/ 1) If there are multiple slaves able to failover, they exchange messages\n\/\/    in order to try to give an advantage to the slave with the best\n\/\/    replication offset (more data from the master processed).\n\/\/    Slaves will try to get their rank by offset, and apply to the start\n\/\/    of the failover a delay proportional to their rank.\n\/\/\n\/\/ 2) Every single slave computes the time of the last interaction with\n\/\/    its master. This can be the last ping or command received (if the master\n\/\/    is still in the \"connected\" state), or the time that elapsed since the\n\/\/    disconnection with the master (if the replication link is currently down).\n\/\/    If the last interaction is too old, the slave will not try to failover\n\/\/    at all.\n\/\/\n\/\/ The point \"2\" can be tuned by user. Specifically a slave will not perform\n\/\/ the failover if, since the last interaction with the master, the time\n\/\/ elapsed is greater than:\n\/\/\n\/\/   (node-timeout * slave-validity-factor) + repl-ping-slave-period\n\/\/\n\/\/ So for example if node-timeout is 30 seconds, and the slave-validity-factor\n\/\/ is 10, and assuming a default repl-ping-slave-period of 10 seconds, the\n\/\/ slave will not try to failover if it was not able to talk with the master\n\/\/ for longer than 310 seconds.\n\/\/\n\/\/ A large slave-validity-factor may allow slaves with too old data to failover\n\/\/ a master, while a too small value may prevent the cluster from being able to\n\/\/ elect a slave at all.\n\/\/\n\/\/ For maximum availability, it is possible to set the slave-validity-factor\n\/\/ to a value of 0, which means, that slaves will always try to failover the\n\/\/ master regardless of the last time they interacted with the master.\n\/\/ (However they'll always try to apply a delay proportional to their\n\/\/ offset rank).\n\/\/\n\/\/ Zero is the only value able to guarantee that when all the partitions heal\n\/\/ the cluster will always be able to continue.\n\/\/\n\/\/ cluster-slave-validity-factor 10\n\n\/\/ Cluster slaves are able to migrate to orphaned masters, that are masters\n\/\/ that are left without working slaves. This improves the cluster ability\n\/\/ to resist to failures as otherwise an orphaned master can't be failed over\n\/\/ in case of failure if it has no working slaves.\n\/\/\n\/\/ Slaves migrate to orphaned masters only if there are still at least a\n\/\/ given number of other working slaves for their old master. This number\n\/\/ is the \"migration barrier\". A migration barrier of 1 means that a slave\n\/\/ will migrate only if there is at least 1 other working slave for its master\n\/\/ and so forth. It usually reflects the number of slaves you want for every\n\/\/ master in your cluster.\n\/\/\n\/\/ Default is 1 (slaves migrate only if their masters remain with at least\n\/\/ one slave). To disable migration just set it to a very large value.\n\/\/ A value of 0 can be set but is useful only for debugging and dangerous\n\/\/ in production.\n\/\/\n\/\/ cluster-migration-barrier 1\n\n\/\/ By default Redis Cluster nodes stop accepting queries if they detect there\n\/\/ is at least an hash slot uncovered (no available node is serving it).\n\/\/ This way if the cluster is partially down (for example a range of hash slots\n\/\/ are no longer covered) all the cluster becomes, eventually, unavailable.\n\/\/ It automatically returns available as soon as all the slots are covered again.\n\/\/\n\/\/ However sometimes you want the subset of the cluster which is working,\n\/\/ to continue to accept queries for the part of the key space that is still\n\/\/ covered. In order to do so, just set the cluster-require-full-coverage\n\/\/ option to no.\n\/\/\n\/\/ cluster-require-full-coverage yes\n\n\/\/ In order to setup your cluster make sure to read the documentation\n\/\/ available at http:\/\/redis.io web site.\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ SLOW LOG \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ The Redis Slow Log is a system to log queries that exceeded a specified\n\/\/ execution time. The execution time does not include the I\/O operations\n\/\/ like talking with the client, sending the reply and so forth,\n\/\/ but just the time needed to actually execute the command (this is the only\n\/\/ stage of command execution where the thread is blocked and can not serve\n\/\/ other requests in the meantime).\n\/\/\n\/\/ You can configure the slow log with two parameters: one tells Redis\n\/\/ what is the execution time, in microseconds, to exceed in order for the\n\/\/ command to get logged, and the other parameter is the length of the\n\/\/ slow log. When a new command is logged the oldest one is removed from the\n\/\/ queue of logged commands.\n\n\/\/ The following time is expressed in microseconds, so 1000000 is equivalent\n\/\/ to one second. Note that a negative number disables the slow log, while\n\/\/ a value of zero forces the logging of every command.\nslowlog-log-slower-than 10000\n\n\/\/ There is no limit to this length. Just be aware that it will consume memory.\n\/\/ You can reclaim memory used by the slow log with SLOWLOG RESET.\nslowlog-max-len 128\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ LATENCY MONITOR \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ The Redis latency monitoring subsystem samples different operations\n\/\/ at runtime in order to collect data related to possible sources of\n\/\/ latency of a Redis instance.\n\/\/\n\/\/ Via the LATENCY command this information is available to the user that can\n\/\/ print graphs and obtain reports.\n\/\/\n\/\/ The system only logs operations that were performed in a time equal or\n\/\/ greater than the amount of milliseconds specified via the\n\/\/ latency-monitor-threshold configuration directive. When its value is set\n\/\/ to zero, the latency monitor is turned off.\n\/\/\n\/\/ By default latency monitoring is disabled since it is mostly not needed\n\/\/ if you don't have latency issues, and collecting data has a performance\n\/\/ impact, that while very small, can be measured under big load. Latency\n\/\/ monitoring can easily be enabled at runtime using the command\n\/\/ \"CONFIG SET latency-monitor-threshold &lt;milliseconds&gt;\" if needed.\nlatency-monitor-threshold 0\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ EVENT NOTIFICATION \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Redis can notify Pub\/Sub clients about events happening in the key space.\n\/\/ This feature is documented at http:\/\/redis.io\/topics\/notifications\n\/\/\n\/\/ For instance if keyspace events notification is enabled, and a client\n\/\/ performs a DEL operation on key \"foo\" stored in the Database 0, two\n\/\/ messages will be published via Pub\/Sub:\n\/\/\n\/\/ PUBLISH __keyspace@0__:foo del\n\/\/ PUBLISH __keyevent@0__:del foo\n\/\/\n\/\/ It is possible to select the events that Redis will notify among a set\n\/\/ of classes. Every class is identified by a single character:\n\/\/\n\/\/  K     Keyspace events, published with __keyspace@&lt;db&gt;__ prefix.\n\/\/  E     Keyevent events, published with __keyevent@&lt;db&gt;__ prefix.\n\/\/  g     Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ...\n\/\/  $     String commands\n\/\/  l     List commands\n\/\/  s     Set commands\n\/\/  h     Hash commands\n\/\/  z     Sorted set commands\n\/\/  x     Expired events (events generated every time a key expires)\n\/\/  e     Evicted events (events generated when a key is evicted for maxmemory)\n\/\/  A     Alias for g$lshzxe, so that the \"AKE\" string means all the events.\n\/\/\n\/\/  The \"notify-keyspace-events\" takes as argument a string that is composed\n\/\/  of zero or multiple characters. The empty string means that notifications\n\/\/  are disabled.\n\/\/\n\/\/  Example: to enable list and generic events, from the point of view of the\n\/\/           event name, use:\n\/\/\n\/\/  notify-keyspace-events Elg\n\/\/\n\/\/  Example 2: to get the stream of the expired keys subscribing to channel\n\/\/             name __keyevent@0__:expired use:\n\/\/\n\/\/  notify-keyspace-events Ex\n\/\/\n\/\/  By default all notifications are disabled because most users don't need\n\/\/  this feature and the feature has some overhead. Note that if you don't\n\/\/  specify at least one of K or E, no events will be delivered.\nnotify-keyspace-events \"\"\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ ADVANCED CONFIG \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Hashes are encoded using a memory efficient data structure when they have a\n\/\/ small number of entries, and the biggest entry does not exceed a given\n\/\/ threshold. These thresholds can be configured using the following directives.\nhash-max-ziplist-entries 512\nhash-max-ziplist-value 64\n\n\/\/ Similarly to hashes, small lists are also encoded in a special way in order\n\/\/ to save a lot of space. The special representation is only used when\n\/\/ you are under the following limits:\nlist-max-ziplist-entries 512\nlist-max-ziplist-value 64\n\n\/\/ Sets have a special encoding in just one case: when a set is composed\n\/\/ of just strings that happen to be integers in radix 10 in the range\n\/\/ of 64 bit signed integers.\n\/\/ The following configuration setting sets the limit in the size of the\n\/\/ set in order to use this special memory saving encoding.\nset-max-intset-entries 512\n\n\/\/ Similarly to hashes and lists, sorted sets are also specially encoded in\n\/\/ order to save a lot of space. This encoding is only used when the length and\n\/\/ elements of a sorted set are below the following limits:\nzset-max-ziplist-entries 128\nzset-max-ziplist-value 64\n\n\/\/ HyperLogLog sparse representation bytes limit. The limit includes the\n\/\/ 16 bytes header. When an HyperLogLog using the sparse representation crosses\n\/\/ this limit, it is converted into the dense representation.\n\/\/\n\/\/ A value greater than 16000 is totally useless, since at that point the\n\/\/ dense representation is more memory efficient.\n\/\/\n\/\/ The suggested value is ~ 3000 in order to have the benefits of\n\/\/ the space efficient encoding without slowing down too much PFADD,\n\/\/ which is O(N) with the sparse encoding. The value can be raised to\n\/\/ ~ 10000 when CPU is not a concern, but space is, and the data set is\n\/\/ composed of many HyperLogLogs with cardinality in the 0 - 15000 range.\nhll-sparse-max-bytes 3000\n\n\/\/ Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in\n\/\/ order to help rehashing the main Redis hash table (the one mapping top-level\n\/\/ keys to values). The hash table implementation Redis uses (see dict.c)\n\/\/ performs a lazy rehashing: the more operation you run into a hash table\n\/\/ that is rehashing, the more rehashing \"steps\" are performed, so if the\n\/\/ server is idle the rehashing is never complete and some more memory is used\n\/\/ by the hash table.\n\/\/\n\/\/ The default is to use this millisecond 10 times every second in order to\n\/\/ actively rehash the main dictionaries, freeing memory when possible.\n\/\/\n\/\/ If unsure:\n\/\/ use \"activerehashing no\" if you have hard latency requirements and it is\n\/\/ not a good thing in your environment that Redis can reply from time to time\n\/\/ to queries with 2 milliseconds delay.\n\/\/\n\/\/ use \"activerehashing yes\" if you don't have such hard requirements but\n\/\/ want to free memory asap when possible.\nactiverehashing yes\n\n\/\/ The client output buffer limits can be used to force disconnection of clients\n\/\/ that are not reading data from the server fast enough for some reason (a\n\/\/ common reason is that a Pub\/Sub client can't consume messages as fast as the\n\/\/ publisher can produce them).\n\/\/\n\/\/ The limit can be set differently for the three different classes of clients:\n\/\/\n\/\/ normal -&gt; normal clients including MONITOR clients\n\/\/ slave  -&gt; slave clients\n\/\/ pubsub -&gt; clients subscribed to at least one pubsub channel or pattern\n\/\/\n\/\/ The syntax of every client-output-buffer-limit directive is the following:\n\/\/\n\/\/ client-output-buffer-limit &lt;class&gt; &lt;hard limit&gt; &lt;soft limit&gt; &lt;soft seconds&gt;\n\/\/\n\/\/ A client is immediately disconnected once the hard limit is reached, or if\n\/\/ the soft limit is reached and remains reached for the specified number of\n\/\/ seconds (continuously).\n\/\/ So for instance if the hard limit is 32 megabytes and the soft limit is\n\/\/ 16 megabytes \/ 10 seconds, the client will get disconnected immediately\n\/\/ if the size of the output buffers reach 32 megabytes, but will also get\n\/\/ disconnected if the client reaches 16 megabytes and continuously overcomes\n\/\/ the limit for 10 seconds.\n\/\/\n\/\/ By default normal clients are not limited because they don't receive data\n\/\/ without asking (in a push way), but just after a request, so only\n\/\/ asynchronous clients may create a scenario where data is requested faster\n\/\/ than it can read.\n\/\/\n\/\/ Instead there is a default limit for pubsub and slave clients, since\n\/\/ subscribers and slaves receive data in a push fashion.\n\/\/\n\/\/ Both the hard or the soft limit can be disabled by setting them to zero.\nclient-output-buffer-limit normal 0 0 0\nclient-output-buffer-limit slave 256mb 64mb 60\nclient-output-buffer-limit pubsub 32mb 8mb 60\n\n\/\/ Redis calls an internal function to perform many background tasks, like\n\/\/ closing connections of clients in timeout, purging expired keys that are\n\/\/ never requested, and so forth.\n\/\/\n\/\/ Not all tasks are performed with the same frequency, but Redis checks for\n\/\/ tasks to perform according to the specified \"hz\" value.\n\/\/\n\/\/ By default \"hz\" is set to 10. Raising the value will use more CPU when\n\/\/ Redis is idle, but at the same time will make Redis more responsive when\n\/\/ there are many keys expiring at the same time, and timeouts may be\n\/\/ handled with more precision.\n\/\/\n\/\/ The range is between 1 and 500, however a value over 100 is usually not\n\/\/ a good idea. Most users should use the default of 10 and raise this up to\n\/\/ 100 only in environments where very low latency is required.\nhz 10\n\n\/\/ When a child rewrites the AOF file, if the following option is enabled\n\/\/ the file will be fsync-ed every 32 MB of data generated. This is useful\n\/\/ in order to commit the file to the disk more incrementally and avoid\n\/\/ big latency spikes.\naof-rewrite-incremental-fsync yes<\/pre>\n<p><\/p>\n<h5>\u5229\u7528 Redis2-Nginx-Module \u8207 Nginx \u5c07 Redis Server \u8f49\u6210\u4e00\u500b Web Service<\/h5>\n<p>\u7b46\u8005\u66fe\u7d93\u4e00\u5ea6\u5229\u7528 Apache2 \u4f3a\u670d\u5668\u60f3\u8981\u5229\u7528 Rewrite \u7684\u529f\u80fd\u5c07 Redis Server \u5c0e\u5411 80 \u7aef\u53e3\uff0c\u4f46\u662f\u9084\u662f\u51fa\u73fe\u932f\u8aa4\u8a0a\u606f\u5982\u4e0b\uff1a<\/p>\n<pre class=\"lang:bash\">23260:M 01 Jan 14:33:51.518 @ Possible SECURITY ATTACK detected. It looks like somebody is sending POST or Host: commands to Redis. This is likely due to an attacker attempting to use Cross Protocol Scripting to compromise your Redis instance. Connection aborted.\n23260:M 01 Jan 14:38:51.685 @ Possible SECURITY ATTACK detected. It looks like somebody is sending POST or Host: commands to Redis. This is likely due to an attacker attempting to use Cross Protocol Scripting to compromise your Redis instance. Connection aborted.<\/pre>\n<p>\u6301\u7e8c\u5c0b\u627e\u4e4b\u5f8c\u4ee5\u4e0b\u7684 Nginx \u6a21\u7d44\u8207\u4e00\u4e9b\u6559\u5b78 <a href=\"https:\/\/learnku.com\/articles\/42115\">https:\/\/learnku.com\/articles\/42115<\/a> \uff0c\u5982\u679c\u60f3\u8981\u8d70 Apache \u7684\u8a71\u4e5f\u53ef\u4ee5\u53c3\u8003\u4e00\u500b Apache \u95dc\u65bc redis \u7684\u6a21\u7d44 <a href=\"https:\/\/httpd.apache.org\/docs\/trunk\/mod\/mod_socache_redis.html\">https:\/\/httpd.apache.org\/docs\/trunk\/mod\/mod_socache_redis.html<\/a><\/p>\n\n\n<div class=\"wp-block-buttons aligncenter is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link\">Redis2-Nginx-Module GitHub<\/a><\/div>\n<\/div>\n\n\n<p style=\"text-align: justify;\">\u4e3b\u8981\u7cbe\u795e\u8207\u7b46\u8005\u4e00\u958b\u59cb\u5be6\u9a57\u883b\u50cf\u7684\uff0c\u5c31\u662f\u900f\u904e Nginx \u6216\u662f Apache \u7576\u4f5c Redis Server \u7684\u4ee3\u7406\u4e3b\u6a5f\uff0c\u900f\u904e\u4e0a\u9762\u7684\u7db2\u9801\u5b89\u88dd\u7684\u6559\u5b78\uff0c\u53ef\u4ee5\u751f\u6210\u4e00\u500b\u5ba2\u88fd\u5316\u7684 nginx \u4f3a\u670d\u5668\uff0c\u6b64\u6642\u518d\u53bb\u4fee\u6539 nginx.conf \u7684\u8a2d\u5b9a\u6a94\u5c31\u53ef\u4ee5\u5be6\u73fe Redis \u4f3a\u670d\u5668\u7684\u529f\u80fd\uff0c\u4ee5\u4e0b\u6211\u5011\u5217\u51fa\u5e7e\u500b\uff1a<\/p>\n<pre class=\"lang:markup\"> location = \/foo {\n     set $value 'first';\n     redis2_query set one $value;\n     redis2_pass 127.0.0.1:6379;\n }\n\n # GET \/get?key=some_key\n location = \/get {\n     set_unescape_uri $key $arg_key;  \/\/ this requires ngx_set_misc\n     redis2_query get $key;\n     redis2_pass 127.0.0.1:6379;\n }\n\n # GET \/set?key=one&amp;val=first%20value\n location = \/set {\n     set_unescape_uri $key $arg_key;  \/\/ this requires ngx_set_misc\n     set_unescape_uri $val $arg_val;  \/\/ this requires ngx_set_misc\n     redis2_query set $key $val;\n     redis2_pass 127.0.0.1:6379;\n }<\/pre>\n<h5>\u00a0<\/h5>\n\n<h5>\u5982\u679c Redis Server \u6709 password \u4fdd\u8b77\u6642\u61c9\u8a72\u600e\u9ebc\u8fa6\uff1f<\/h5>\n<p style=\"text-align: justify;\">\u57fa\u672c\u4e0a\u5728\u90e8\u7f72 Redis Server \u4e4b\u5f8c\uff0c\u5982\u679c\u6c92\u6709\u5bc6\u78bc\u4fdd\u8b77\u7684\u8a71\uff0c\u5c31\u662f\u4efb\u4f55\u4eba\u90fd\u53ef\u4ee5\u5c0d Redis Server \u9032\u884c\u5b58\u53d6\uff0c\u95dc\u65bc Redis Server \u7684\u5bc6\u78bc\u8a2d\u5b9a\u53ef\u4ee5<a href=\"https:\/\/stackink.com\/how-to-set-password-for-redis-server\/\">\u53c3\u8003<\/a>\uff0c\u4e3b\u8981\u662f\u5728 \/etc\/redis\/redis.conf \u88e1\u9762\u52a0\u5165\u4ee5\u4e0b\u7684\u6b04\u4f4d\uff1a<\/p>\n<pre class=\"lang:bash\">\/\/ Require clients to issue AUTH &lt;PASSWORD&gt; before processing any other\n\/\/ commands.  This might be useful in environments in which you do not trust\n\/\/ others with access to the host running redis-server.\n\/\/\n\/\/ This should stay commented out for backward compatibility and because most\n\/\/ people do not need auth (e.g. they run their own servers).\n\/\/\n\/\/ Warning: since Redis is pretty fast an outside user can try up to\n\/\/ 150k passwords per second against a good box. This means that you should\n\/\/ use a very strong password otherwise it will be very easy to break.\n\/\/\nrequirepass yourpassword<\/pre>\n<p>\u9019\u6a23\u5982\u679c\u4f60\u5728 access \u7684\u6642\u5019\u6c92\u6709\u5bc6\u78bc\u7684\u8a71\u5c31\u6703\u5f97\u5230\u4ee5\u4e0b\u7684\u932f\u8aa4\u8a0a\u606f\uff1a<\/p>\n<pre class=\"lang:bash\">-NOAUTH Authentication required.<\/pre>\n<p>\u4e4b\u5f8c\u7684 nginx \u8a18\u5f97\u8981\u9644\u4e0a\u5bc6\u78bc\u624d\u80fd\u5920\u901a\u884c\uff1a<\/p>\n<pre class=\"lang:markup\"># GET \/get?pwd=pwd_eg&amp;key=key_eg\n location = \/get {\n     set_unescape_uri $pwd $arg_pwd;\n     set_unescape_uri $key $arg_key; \n     redis2_query auth $pwd\n     redis2_query get $key;\n     redis2_pass 127.0.0.1:6379;\n }\n\n # GET \/set?pwd=pwd_eg&amp;key=key_eg&amp;val=val_eg\n location = \/set {\n     set_unescape_uri $pwd $arg_pwd;\n     set_unescape_uri $key $arg_key;\n     set_unescape_uri $val $arg_val;\n     redis2_query auth $pwd\n     redis2_query set $key $val;\n     redis2_pass 127.0.0.1:6379;\n }<\/pre>\n<p>\u00a0<\/p>\n\n<h5>\u6700\u5f8c\u4e00\u500b\u8b70\u984c\u95dc\u65bc (Redis Data Persistence) <a href=\"https:\/\/redis.io\/topics\/persistence\">\u53c3\u8003<\/a><\/h5>\n<p style=\"text-align: justify;\">\u9019\u4e5f\u662f\u70ba\u4ec0\u9ebc\u6211\u5011\u8981\u81ea\u5df1\u4f48\u5efa Redis Server \u800c\u4e0d\u662f\u76f4\u63a5\u4f7f\u7528 <a href=\"https:\/\/azure.microsoft.com\/en-us\/pricing\/details\/cache\/\">Microsoft \u63d0\u4f9b\u7684 Redis \u670d\u52d9<\/a>\u7684\u539f\u56e0\uff0c\u5f9e\u4ee5\u4e0a\u7684\u9023\u7d50\u6211\u5011\u53ef\u4ee5\u5f97\u77e5\u5728 Microsoft \u88e1\u9762\u8981\u6709 Data Persistance \u7684 Azure Redis \u670d\u52d9\u57fa\u672c\u4e0a\u8981\u5230 Premium \u7b49\u7d1a\uff0c\u4ee5\u4e0b\u6211\u5011\u5217\u51fa Azure Premium \u7b49\u7d1a\u7684\u50f9\u76ee\u8868\uff0c\u53ef\u4ee5\u770b\u5230\u50f9\u9322\u90fd\u5728\u4e00\u500b\u5c0f\u6642 0.554 \u7f8e\u91d1\u4ee5\u4e0a (Pay As You Go) \uff0c\u50f9\u9322\u4e0d\u662f\u5f88\u5e73\u50f9\u3002<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"480\" src=\"https:\/\/myoceane.fr\/wp-content\/uploads\/2021\/01\/\u622a\u5716-2021-01-04-\u4e0a\u53489.55.48-1024x480.png\" alt=\"\" class=\"wp-image-6939\" srcset=\"https:\/\/myoceane.fr\/wp-content\/uploads\/2021\/01\/\u622a\u5716-2021-01-04-\u4e0a\u53489.55.48-1024x480.png 1024w, https:\/\/myoceane.fr\/wp-content\/uploads\/2021\/01\/\u622a\u5716-2021-01-04-\u4e0a\u53489.55.48-300x141.png 300w, https:\/\/myoceane.fr\/wp-content\/uploads\/2021\/01\/\u622a\u5716-2021-01-04-\u4e0a\u53489.55.48-768x360.png 768w, https:\/\/myoceane.fr\/wp-content\/uploads\/2021\/01\/\u622a\u5716-2021-01-04-\u4e0a\u53489.55.48-1536x720.png 1536w, https:\/\/myoceane.fr\/wp-content\/uploads\/2021\/01\/\u622a\u5716-2021-01-04-\u4e0a\u53489.55.48-2048x959.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u7bc7\u60f3\u8981\u7d00\u9304\u4e00\u4e9b\u5728\u7814\u7a76\u5b89\u88dd Redis Server \u6642\u5019\u7684\u4e00\u4e9b\u8003\u91cf\uff0c\u6709\u95dc Redis Server \u7684\u5b89\u88dd\u5176\u5be6\u4e26\u4e0d\u8907\u96dc\uff0c\u53ea\u662f\u4f5c\u8005\u6709\u4e00\u4e9b\u7279\u6b8a\u7684\u74b0\u5883\u9700\u6c42\uff0c\u6240\u4ee5\u624d\u9700\u8981\u6bd4\u8f03\u8907\u96dc\u7684\u7cfb\u7d71\u8a2d\u5b9a\uff0c\u95dc\u65bc\u5982\u4f55\u5728\u4e00\u53f0 VM \u4e0a\u9762\u5b89\u88dd Redis Server \u53ef\u4ee5\u53c3\u8003 How to Install and Secure Redis on Ubuntu 18.04 \uff0c\u672c\u7bc7\u7684\u524d\u534a\u90e8\u4e5f\u662f\u7a0d\u5fae\u7d00\u9304\u4e00\u4e9b\u5e38\u7528\u7684\u64cd\u4f5c\u6307\u4ee4\uff0c\u5f8c\u534a\u90e8\u5247\u662f\u7d00\u9304\u5982\u4f55\u900f\u904e nginx server \u53bb\u8ddf redis \u505a\u4e92\u52d5\uff0c\u6700\u4e3b\u8981\u6709\u9019\u500b\u9700\u6c42\u662f\u56e0\u70ba\u7b46\u8005\u4f7f\u7528 Azure Webapp Container \u4f5c\u70ba\u90e8\u7f72 Redis \u7684\u6a19\u7684\uff0c\u4f46\u662f\u5728\u5be6\u4f5c\u5b89\u88dd\u8207\u555f\u52d5 redis \u7684\u6642\u5019\u51fa\u73fe\u932f\u8aa4\u8a0a\u606f\uff0c\u4f3c\u4e4e\u7121\u6cd5\u76f4\u63a5\u90e8\u7f72\u3002<\/p>\n","protected":false},"author":1,"featured_media":6894,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,8],"tags":[1082,685,1070,1071,1081],"class_list":["post-6754","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-it-technology","category-website","tag-data-persistence","tag-nginx","tag-redis","tag-redis2-nginx-module","tag--nginx"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4f7f\u7528 Nginx \u8207 Redis2-Nginx-Module \u4ee3\u7406 Redis API - \u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/myoceane.fr\/index.php\/\u5b89\u88dd-redis-server-\u8207-redis2-nginx-module\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4f7f\u7528 Nginx \u8207 Redis2-Nginx-Module \u4ee3\u7406 Redis API - \u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane\" \/>\n<meta property=\"og:description\" content=\"\u672c\u7bc7\u60f3\u8981\u7d00\u9304\u4e00\u4e9b\u5728\u7814\u7a76\u5b89\u88dd Redis Server \u6642\u5019\u7684\u4e00\u4e9b\u8003\u91cf\uff0c\u6709\u95dc Redis Server \u7684\u5b89\u88dd\u5176\u5be6\u4e26\u4e0d\u8907\u96dc\uff0c\u53ea\u662f\u4f5c\u8005\u6709\u4e00\u4e9b\u7279\u6b8a\u7684\u74b0\u5883\u9700\u6c42\uff0c\u6240\u4ee5\u624d\u9700\u8981\u6bd4\u8f03\u8907\u96dc\u7684\u7cfb\u7d71\u8a2d\u5b9a\uff0c\u95dc\u65bc\u5982\u4f55\u5728\u4e00\u53f0 VM \u4e0a\u9762\u5b89\u88dd Redis Server \u53ef\u4ee5\u53c3\u8003 How to Install and Secure Redis on Ubuntu 18.04 \uff0c\u672c\u7bc7\u7684\u524d\u534a\u90e8\u4e5f\u662f\u7a0d\u5fae\u7d00\u9304\u4e00\u4e9b\u5e38\u7528\u7684\u64cd\u4f5c\u6307\u4ee4\uff0c\u5f8c\u534a\u90e8\u5247\u662f\u7d00\u9304\u5982\u4f55\u900f\u904e nginx server \u53bb\u8ddf redis \u505a\u4e92\u52d5\uff0c\u6700\u4e3b\u8981\u6709\u9019\u500b\u9700\u6c42\u662f\u56e0\u70ba\u7b46\u8005\u4f7f\u7528 Azure Webapp Container \u4f5c\u70ba\u90e8\u7f72 Redis \u7684\u6a19\u7684\uff0c\u4f46\u662f\u5728\u5be6\u4f5c\u5b89\u88dd\u8207\u555f\u52d5 redis \u7684\u6642\u5019\u51fa\u73fe\u932f\u8aa4\u8a0a\u606f\uff0c\u4f3c\u4e4e\u7121\u6cd5\u76f4\u63a5\u90e8\u7f72\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/myoceane.fr\/index.php\/\u5b89\u88dd-redis-server-\u8207-redis2-nginx-module\/\" \/>\n<meta property=\"og:site_name\" content=\"\u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane\" \/>\n<meta property=\"article:published_time\" content=\"2021-01-02T14:06:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-01-04T02:04:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/myoceane.fr\/wp-content\/uploads\/2021\/01\/redis.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"401\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"\u6ab8\u6aac\u7238\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u6ab8\u6aac\u7238\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"35 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/\"},\"author\":{\"name\":\"\u6ab8\u6aac\u7238\",\"@id\":\"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b\"},\"headline\":\"\u4f7f\u7528 Nginx \u8207 Redis2-Nginx-Module \u4ee3\u7406 Redis API\",\"datePublished\":\"2021-01-02T14:06:35+00:00\",\"dateModified\":\"2021-01-04T02:04:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/\"},\"wordCount\":153,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b\"},\"image\":{\"@id\":\"https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/myoceane.fr\/wp-content\/uploads\/2021\/01\/redis.png\",\"keywords\":[\"Data Persistence\",\"Nginx\",\"Redis\",\"Redis2-Nginx-Module\",\"\u81ea\u5df1\u7de8\u8b6f Nginx\"],\"articleSection\":[\"IT Technology\",\"Website\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/\",\"url\":\"https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/\",\"name\":\"\u4f7f\u7528 Nginx \u8207 Redis2-Nginx-Module \u4ee3\u7406 Redis API - \u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane\",\"isPartOf\":{\"@id\":\"https:\/\/myoceane.fr\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/myoceane.fr\/wp-content\/uploads\/2021\/01\/redis.png\",\"datePublished\":\"2021-01-02T14:06:35+00:00\",\"dateModified\":\"2021-01-04T02:04:53+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/#primaryimage\",\"url\":\"https:\/\/myoceane.fr\/wp-content\/uploads\/2021\/01\/redis.png\",\"contentUrl\":\"https:\/\/myoceane.fr\/wp-content\/uploads\/2021\/01\/redis.png\",\"width\":1200,\"height\":401},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/myoceane.fr\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4f7f\u7528 Nginx \u8207 Redis2-Nginx-Module \u4ee3\u7406 Redis API\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/myoceane.fr\/#website\",\"url\":\"https:\/\/myoceane.fr\/\",\"name\":\"M-Y-Oceane \u60f3\u65b9\u6d89\u6cd5\u3002\u91cf\u74f6\u5916\u7684\u5929\u7a7a\",\"description\":\"\u60f3\u65b9\u6d89\u6cd5, France, Taiwan, Health, Information Technology\",\"publisher\":{\"@id\":\"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/myoceane.fr\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b\",\"name\":\"\u6ab8\u6aac\u7238\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/myoceane.fr\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6cc678684664f8ad45a8d56a6630b183?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6cc678684664f8ad45a8d56a6630b183?s=96&d=mm&r=g\",\"caption\":\"\u6ab8\u6aac\u7238\"},\"logo\":{\"@id\":\"https:\/\/myoceane.fr\/#\/schema\/person\/image\/\"},\"url\":\"https:\/\/myoceane.fr\/index.php\/author\/johnny5584767gmail-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u4f7f\u7528 Nginx \u8207 Redis2-Nginx-Module \u4ee3\u7406 Redis API - \u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/myoceane.fr\/index.php\/\u5b89\u88dd-redis-server-\u8207-redis2-nginx-module\/","og_locale":"en_US","og_type":"article","og_title":"\u4f7f\u7528 Nginx \u8207 Redis2-Nginx-Module \u4ee3\u7406 Redis API - \u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane","og_description":"\u672c\u7bc7\u60f3\u8981\u7d00\u9304\u4e00\u4e9b\u5728\u7814\u7a76\u5b89\u88dd Redis Server \u6642\u5019\u7684\u4e00\u4e9b\u8003\u91cf\uff0c\u6709\u95dc Redis Server \u7684\u5b89\u88dd\u5176\u5be6\u4e26\u4e0d\u8907\u96dc\uff0c\u53ea\u662f\u4f5c\u8005\u6709\u4e00\u4e9b\u7279\u6b8a\u7684\u74b0\u5883\u9700\u6c42\uff0c\u6240\u4ee5\u624d\u9700\u8981\u6bd4\u8f03\u8907\u96dc\u7684\u7cfb\u7d71\u8a2d\u5b9a\uff0c\u95dc\u65bc\u5982\u4f55\u5728\u4e00\u53f0 VM \u4e0a\u9762\u5b89\u88dd Redis Server \u53ef\u4ee5\u53c3\u8003 How to Install and Secure Redis on Ubuntu 18.04 \uff0c\u672c\u7bc7\u7684\u524d\u534a\u90e8\u4e5f\u662f\u7a0d\u5fae\u7d00\u9304\u4e00\u4e9b\u5e38\u7528\u7684\u64cd\u4f5c\u6307\u4ee4\uff0c\u5f8c\u534a\u90e8\u5247\u662f\u7d00\u9304\u5982\u4f55\u900f\u904e nginx server \u53bb\u8ddf redis \u505a\u4e92\u52d5\uff0c\u6700\u4e3b\u8981\u6709\u9019\u500b\u9700\u6c42\u662f\u56e0\u70ba\u7b46\u8005\u4f7f\u7528 Azure Webapp Container \u4f5c\u70ba\u90e8\u7f72 Redis \u7684\u6a19\u7684\uff0c\u4f46\u662f\u5728\u5be6\u4f5c\u5b89\u88dd\u8207\u555f\u52d5 redis \u7684\u6642\u5019\u51fa\u73fe\u932f\u8aa4\u8a0a\u606f\uff0c\u4f3c\u4e4e\u7121\u6cd5\u76f4\u63a5\u90e8\u7f72\u3002","og_url":"https:\/\/myoceane.fr\/index.php\/\u5b89\u88dd-redis-server-\u8207-redis2-nginx-module\/","og_site_name":"\u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane","article_published_time":"2021-01-02T14:06:35+00:00","article_modified_time":"2021-01-04T02:04:53+00:00","og_image":[{"width":1200,"height":401,"url":"https:\/\/myoceane.fr\/wp-content\/uploads\/2021\/01\/redis.png","type":"image\/png"}],"author":"\u6ab8\u6aac\u7238","twitter_card":"summary_large_image","twitter_misc":{"Written by":"\u6ab8\u6aac\u7238","Est. reading time":"35 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/#article","isPartOf":{"@id":"https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/"},"author":{"name":"\u6ab8\u6aac\u7238","@id":"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b"},"headline":"\u4f7f\u7528 Nginx \u8207 Redis2-Nginx-Module \u4ee3\u7406 Redis API","datePublished":"2021-01-02T14:06:35+00:00","dateModified":"2021-01-04T02:04:53+00:00","mainEntityOfPage":{"@id":"https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/"},"wordCount":153,"commentCount":0,"publisher":{"@id":"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b"},"image":{"@id":"https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/#primaryimage"},"thumbnailUrl":"https:\/\/myoceane.fr\/wp-content\/uploads\/2021\/01\/redis.png","keywords":["Data Persistence","Nginx","Redis","Redis2-Nginx-Module","\u81ea\u5df1\u7de8\u8b6f Nginx"],"articleSection":["IT Technology","Website"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/","url":"https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/","name":"\u4f7f\u7528 Nginx \u8207 Redis2-Nginx-Module \u4ee3\u7406 Redis API - \u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane","isPartOf":{"@id":"https:\/\/myoceane.fr\/#website"},"primaryImageOfPage":{"@id":"https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/#primaryimage"},"image":{"@id":"https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/#primaryimage"},"thumbnailUrl":"https:\/\/myoceane.fr\/wp-content\/uploads\/2021\/01\/redis.png","datePublished":"2021-01-02T14:06:35+00:00","dateModified":"2021-01-04T02:04:53+00:00","breadcrumb":{"@id":"https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/#primaryimage","url":"https:\/\/myoceane.fr\/wp-content\/uploads\/2021\/01\/redis.png","contentUrl":"https:\/\/myoceane.fr\/wp-content\/uploads\/2021\/01\/redis.png","width":1200,"height":401},{"@type":"BreadcrumbList","@id":"https:\/\/myoceane.fr\/index.php\/%e5%ae%89%e8%a3%9d-redis-server-%e8%88%87-redis2-nginx-module\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/myoceane.fr\/"},{"@type":"ListItem","position":2,"name":"\u4f7f\u7528 Nginx \u8207 Redis2-Nginx-Module \u4ee3\u7406 Redis API"}]},{"@type":"WebSite","@id":"https:\/\/myoceane.fr\/#website","url":"https:\/\/myoceane.fr\/","name":"M-Y-Oceane \u60f3\u65b9\u6d89\u6cd5\u3002\u91cf\u74f6\u5916\u7684\u5929\u7a7a","description":"\u60f3\u65b9\u6d89\u6cd5, France, Taiwan, Health, Information Technology","publisher":{"@id":"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/myoceane.fr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b","name":"\u6ab8\u6aac\u7238","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/myoceane.fr\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6cc678684664f8ad45a8d56a6630b183?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6cc678684664f8ad45a8d56a6630b183?s=96&d=mm&r=g","caption":"\u6ab8\u6aac\u7238"},"logo":{"@id":"https:\/\/myoceane.fr\/#\/schema\/person\/image\/"},"url":"https:\/\/myoceane.fr\/index.php\/author\/johnny5584767gmail-com\/"}]}},"amp_enabled":false,"_links":{"self":[{"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/posts\/6754","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/comments?post=6754"}],"version-history":[{"count":84,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/posts\/6754\/revisions"}],"predecessor-version":[{"id":6954,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/posts\/6754\/revisions\/6954"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/media\/6894"}],"wp:attachment":[{"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/media?parent=6754"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/categories?post=6754"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/tags?post=6754"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}