主頁 > 資料庫 > Redis基礎之組態檔

Redis基礎之組態檔

2021-01-17 07:05:50 資料庫

一般情況下,Redis組態檔中提供了很多默認的選項,可以不做任何修改而直接使用,本文主要簡述組態檔中常用的配置選項,僅供學習分享使用,如有不足之處,還請指正,

Redis啟動方式

Redis的啟動時,必須有一個組態檔與之相匹配(如:/root/myredis/redis.conf),如下所示:

1 [root@localhost bin]# ./redis-server /root/myredis/redis.conf 

 

Redis組態檔詳解

Redis組態檔項,主要分為以下幾個部分:

  1. INCLUDES:一個組態檔,可以匯入其他組態檔,
  2. MODULES:啟動時加載的模塊,
  3. NETWORK:網路相關配置,
  4. TLS/SSL:安全傳輸相關模塊,
  5. GENERAL:通用配置相關,
  6. SNAPSHOTTING:快照配置相關,
  7. REPLICATION:主從復制相關配置項,
  8. KEYS TRACKING:鍵的追蹤相關配置項,
  9. SECURITY:安全相關配置,
  10. CLIENTS:客戶端相關配置,
  11. MEMORY MANAGEMENT:記憶體管理相關配置項,
  12. LAZY FREEING:延遲釋放配置項,
  13. THREADED I/O:多執行緒I/O相關配置項,
  14. KERNEL OOM CONTROL:Linux內核防止記憶體占用過大配置選項,
  15. APPEND ONLY MODE:資料持久化追加模式,
  16. LUA SCRIPTING:Lua腳本相關配置項,
  17. REDIS CLUSTER:Redis集群相關配置項,
  18. CLUSTER DOCKER/NAT support:Docker/Nat集群支持配置項,
  19. SLOW LOG:耗時日志,
  20. LATENCY MONITOR:延遲監控配置相關選項,
  21. EVENT NOTIFICATION:事件通知相關配置項,
  22. GOPHER SERVER:Gopher服務器,
  23. ADVANCED CONFIG:高級配置,
  24. ACTIVE DEFRAGMENTATION:活動碎片整理相關配置,

說明:Redis組態檔,以# 開頭,表示注釋或者說明;如啟用,則將#去掉即可,

INCLUDES

如果redis啟動時有一個標準的配置模板,但是又需要自定義每一個實體的相關配置,則可以采用include 組態檔的方式匯入,默認不需要匯入檔案,則此處是注釋的,如下所示:

1 # include /path/to/local.conf
2 # include /path/to/other.conf

MODULES

啟動時加載需要啟動的模塊,默認不需要啟動,所以也是注釋的,如下所示:

1 # loadmodule /path/to/my_module.so
2 # loadmodule /path/to/other_module.so

NETWORK

NETWORK主要用于配置網路相關的項,具體如下所示:

bind配置可以訪問的ip地址,可以配置多個,一般建議局域網內部ip,如果是在internet下運行redis,并系結了所有的ip地址,則是非常危險的操作,

如果需要所有ip都可以訪問,則可以注釋掉下面的陳述句,如下所示:

1 # Examples:
2 #
3 # bind 192.168.1.100 10.0.0.1
4 # bind 127.0.0.1 ::1
5 
6 bind 127.0.0.1

port指定redis啟動時的埠號,默認6379,不建議使用1000以下的埠號,因為容易與作業系統埠號引起沖突,如下所示:

1 # Accept connections on the specified port, default is 6379 (IANA #815344).
2 # If port 0 is specified Redis will not listen on a TCP socket.
3 port 6379

tcp-backlog配置完整連接佇列的大小,默認511,但是此值一般不能大于/proc/sys/net/core/somaxconn 配置的值,如下所示:

1 # In high requests-per-second environments you need a high backlog in order
2 # to avoid slow clients connection issues. Note that the Linux kernel
3 # will silently truncate it to the value of /proc/sys/net/core/somaxconn so
4 # make sure to raise both the value of somaxconn and tcp_max_syn_backlog
5 # in order to get the desired effect.
6 tcp-backlog 511

關于/proc/sys/net/core/somaxconn的值,如下所示:

1 [root@localhost bin]# cat /proc/sys/net/core/somaxconn
2 128

timeout設定超時時間,用于設定客戶端多久沒連接則斷開連接人時間,0表示失效,如下所示:

1 # Close the connection after a client is idle for N seconds (0 to disable)
2 timeout 0

tcp-keepalive設定保持連接時長,超過時間,則發送TCP ACK到客戶端,如下所示:

1 # A reasonable value for this option is 300 seconds, which is the new
2 # Redis default starting with Redis 3.2.1.
3 tcp-keepalive 300

GENERAL

daemonize用于配置redis是否以守護行程運行,默認為no,啟動時會單獨啟動一個視窗,當視窗關閉時,redis行程結束,所以為了讓redis在后臺運行,需要將此項改為yes,如下所示:

1 # By default Redis does not run as a daemon. Use 'yes' if you need it.
2 # Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
3 daemonize yes

pidfile配置行程檔案,當redis以守護進行啟動時,會在啟動時生成,關閉時洗掉啟動檔案,如下所示:

 1 # If a pid file is specified, Redis writes it where specified at startup
 2 # and removes it at exit.
 3 #
 4 # When the server runs non daemonized, no pid file is created if none is
 5 # specified in the configuration. When the server is daemonized, the pid file
 6 # is used even if not specified, defaulting to "/var/run/redis.pid".
 7 #
 8 # Creating a pid file is best effort: if Redis is not able to create it
 9 # nothing bad happens, the server will start and run normally.
10 pidfile /var/run/redis_6379.pid

loglevel日志等級,共四種等級:debug,verbose,notice,warning默認為notice,如下所示:

1 # Specify the server verbosity level.
2 # This can be one of:
3 # debug (a lot of information, useful for development/testing)
4 # verbose (many rarely useful info, but not a mess like the debug level)
5 # notice (moderately verbose, what you want in production probably)
6 # warning (only very important / critical messages are logged)
7 loglevel notice

logfile日志檔案配置,默認為空,則不記錄日志,如下所示:

1 # Specify the log file name. Also the empty string can be used to force
2 # Redis to log on the standard output. Note that if you use standard
3 # output for logging but daemonize, logs will be sent to /dev/null
4 logfile ""

syslog-enabled是否記錄系統日志,默認不記錄,如下所示:

1 # To enable logging to the system logger, just set 'syslog-enabled' to yes,
2 # and optionally update the other syslog parameters to suit your needs.
3 # syslog-enabled no
4 
5 # Specify the syslog identity.
6 # syslog-ident redis
7 
8 # Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7.
9 # syslog-facility local0

databases資料庫個數,redis默認共有16個資料庫,默認是0,如下所示:

1 # Set the number of databases. The default database is DB 0, you can select
2 # a different one on a per-connection basis using SELECT <dbid> where
3 # dbid is a number between 0 and 'databases'-1
4 databases 16

always-show-logo設定logo是否顯示,默認為yes,如下所示:

1 # By default Redis shows an ASCII art logo only when started to log to the
2 # standard output and if the standard output is a TTY. Basically this means
3 # that normally a logo is displayed only in interactive sessions.
4 #
5 # However it is possible to force the pre-4.0 behavior and always show a
6 # ASCII art logo in startup logs by setting the following option to yes.
7 always-show-logo yes

SNAPSHOTTING

快照主要用于將記憶體中的資料保存到硬碟上,

save命令,配置多久保存一次,可以設定多種模式,如下所示:

 1 # Save the DB on disk:
 2 #
 3 #   save <seconds> <changes>
 4 #
 5 #   Will save the DB if both the given number of seconds and the given
 6 #   number of write operations against the DB occurred.
 7 #
 8 #   In the example below the behavior will be to save:
 9 #   after 900 sec (15 min) if at least 1 key changed
10 #   after 300 sec (5 min) if at least 10 keys changed
11 #   after 60 sec if at least 10000 keys changed
12 
13 save 900 1
14 save 300 10
15 save 60 10000

stop-writes-on-bgsave-error 當正在保存或者錯誤時,是否停止寫入,默認為yes,如下所示:

1 # However if you have setup your proper monitoring of the Redis server
2 # and persistence, you may want to disable this feature so that Redis will
3 # continue to work as usual even if there are problems with disk,
4 # permissions, and so forth.
5 stop-writes-on-bgsave-error yes

rdbcompression 快照檔案是否壓縮,如果不壓縮,則資料庫檔案將會很大,如下所示:

1 # Compress string objects using LZF when dump .rdb databases?
2 # By default compression is enabled as it's almost always a win.
3 # If you want to save some CPU in the saving child set it to 'no' but
4 # the dataset will likely be bigger if you have compressible values or keys.
5 rdbcompression yes

dbfilename資料庫檔案名,默認為dump.rdb,如下所示:

1 # The filename where to dump the DB
2 dbfilename dump.rdb

dir資料庫檔案的保存目錄,如下所示:

1 # The working directory.
2 #
3 # The DB will be written inside this directory, with the filename specified
4 # above using the 'dbfilename' configuration directive.
5 #
6 # The Append Only File will also be created inside this directory.
7 #
8 # Note that you must specify a directory here, not a file name.
9 dir ./

SECURITY

requirepass設定默認用戶登錄的密碼,默認無密碼,如下所示:

1 # IMPORTANT NOTE: starting with Redis 6 "requirepass" is just a compatibility
2 # layer on top of the new ACL system. The option effect will be just setting
3 # the password for the default user. Clients will still authenticate using
4 # AUTH <password> as usually, or more explicitly with AUTH default <password>
5 # if they follow the new protocol: both will work.
6 #
7 # requirepass foobared

CLIENTS

maxclients同一時間允許連接的最大客戶端數,如下所示:

 1 # Set the max number of connected clients at the same time. By default
 2 # this limit is set to 10000 clients, however if the Redis server is not
 3 # able to configure the process file limit to allow for the specified limit
 4 # the max number of allowed clients is set to the current file limit
 5 # minus 32 (as Redis reserves a few file descriptors for internal uses).
 6 #
 7 # Once the limit is reached Redis will close all the new connections sending
 8 # an error 'max number of clients reached'.
 9 #
10 # maxclients 10000

當配置redis集群時,redis連接數和集群總線共享,

Redis命令模式配置

redis除了可以通過修改組態檔的方式變更配置項,也可以通過客戶端進行修改,示例如下:

config get * 用于獲取所有的配置項,如下所示:

  1 127.0.0.1:6379> config get *
  2   1) "rdbchecksum"
  3   2) "yes"
  4   3) "daemonize"
  5   4) "yes"
  6   5) "io-threads-do-reads"
  7   6) "no"
  8   7) "lua-replicate-commands"
  9   8) "yes"
 10   9) "always-show-logo"
 11  10) "yes"
 12  11) "protected-mode"
 13  12) "yes"
 14  13) "rdbcompression"
 15  14) "yes"
 16  15) "rdb-del-sync-files"
 17  16) "no"
 18  17) "activerehashing"
 19  18) "yes"
 20  19) "stop-writes-on-bgsave-error"
 21  20) "yes"
 22  21) "dynamic-hz"
 23  22) "yes"
 24  23) "lazyfree-lazy-eviction"
 25  24) "no"
 26  25) "lazyfree-lazy-expire"
 27  26) "no"
 28  27) "lazyfree-lazy-server-del"
 29  28) "no"
 30  29) "lazyfree-lazy-user-del"
 31  30) "no"
 32  31) "repl-disable-tcp-nodelay"
 33  32) "no"
 34  33) "repl-diskless-sync"
 35  34) "no"
 36  35) "gopher-enabled"
 37  36) "no"
 38  37) "aof-rewrite-incremental-fsync"
 39  38) "yes"
 40  39) "no-appendfsync-on-rewrite"
 41  40) "no"
 42  41) "cluster-require-full-coverage"
 43  42) "yes"
 44  43) "rdb-save-incremental-fsync"
 45  44) "yes"
 46  45) "aof-load-truncated"
 47  46) "yes"
 48  47) "aof-use-rdb-preamble"
 49  48) "yes"
 50  49) "cluster-replica-no-failover"
 51  50) "no"
 52  51) "cluster-slave-no-failover"
 53  52) "no"
 54  53) "replica-lazy-flush"
 55  54) "no"
 56  55) "slave-lazy-flush"
 57  56) "no"
 58  57) "replica-serve-stale-data"
 59  58) "yes"
 60  59) "slave-serve-stale-data"
 61  60) "yes"
 62  61) "replica-read-only"
 63  62) "yes"
 64  63) "slave-read-only"
 65  64) "yes"
 66  65) "replica-ignore-maxmemory"
 67  66) "yes"
 68  67) "slave-ignore-maxmemory"
 69  68) "yes"
 70  69) "jemalloc-bg-thread"
 71  70) "yes"
 72  71) "activedefrag"
 73  72) "no"
 74  73) "syslog-enabled"
 75  74) "no"
 76  75) "cluster-enabled"
 77  76) "no"
 78  77) "appendonly"
 79  78) "no"
 80  79) "cluster-allow-reads-when-down"
 81  80) "no"
 82  81) "oom-score-adj"
 83  82) "no"
 84  83) "aclfile"
 85  84) ""
 86  85) "unixsocket"
 87  86) ""
 88  87) "pidfile"
 89  88) "/var/run/redis_6379.pid"
 90  89) "replica-announce-ip"
 91  90) ""
 92  91) "slave-announce-ip"
 93  92) ""
 94  93) "masteruser"
 95  94) ""
 96  95) "masterauth"
 97  96) ""
 98  97) "cluster-announce-ip"
 99  98) ""
100  99) "syslog-ident"
101 100) "redis"
102 101) "dbfilename"
103 102) "dump.rdb"
104 103) "appendfilename"
105 104) "appendonly.aof"
106 105) "server_cpulist"
107 106) ""
108 107) "bio_cpulist"
109 108) ""
110 109) "aof_rewrite_cpulist"
111 110) ""
112 111) "bgsave_cpulist"
113 112) ""
114 113) "supervised"
115 114) "no"
116 115) "syslog-facility"
117 116) "local0"
118 117) "repl-diskless-load"
119 118) "disabled"
120 119) "loglevel"
121 120) "notice"
122 121) "maxmemory-policy"
123 122) "noeviction"
124 123) "appendfsync"
125 124) "everysec"
126 125) "databases"
127 126) "16"
128 127) "port"
129 128) "6379"
130 129) "io-threads"
131 130) "1"
132 131) "auto-aof-rewrite-percentage"
133 132) "100"
134 133) "cluster-replica-validity-factor"
135 134) "10"
136 135) "cluster-slave-validity-factor"
137 136) "10"
138 137) "list-max-ziplist-size"
139 138) "-2"
140 139) "tcp-keepalive"
141 140) "300"
142 141) "cluster-migration-barrier"
143 142) "1"
144 143) "active-defrag-cycle-min"
145 144) "1"
146 145) "active-defrag-cycle-max"
147 146) "25"
148 147) "active-defrag-threshold-lower"
149 148) "10"
150 149) "active-defrag-threshold-upper"
151 150) "100"
152 151) "lfu-log-factor"
153 152) "10"
154 153) "lfu-decay-time"
155 154) "1"
156 155) "replica-priority"
157 156) "100"
158 157) "slave-priority"
159 158) "100"
160 159) "repl-diskless-sync-delay"
161 160) "5"
162 161) "maxmemory-samples"
163 162) "5"
164 163) "timeout"
165 164) "0"
166 165) "replica-announce-port"
167 166) "0"
168 167) "slave-announce-port"
169 168) "0"
170 169) "tcp-backlog"
171 170) "511"
172 171) "cluster-announce-bus-port"
173 172) "0"
174 173) "cluster-announce-port"
175 174) "0"
176 175) "repl-timeout"
177 176) "60"
178 177) "repl-ping-replica-period"
179 178) "10"
180 179) "repl-ping-slave-period"
181 180) "10"
182 181) "list-compress-depth"
183 182) "0"
184 183) "rdb-key-save-delay"
185 184) "0"
186 185) "key-load-delay"
187 186) "0"
188 187) "active-expire-effort"
189 188) "1"
190 189) "hz"
191 190) "10"
192 191) "min-replicas-to-write"
193 192) "0"
194 193) "min-slaves-to-write"
195 194) "0"
196 195) "min-replicas-max-lag"
197 196) "10"
198 197) "min-slaves-max-lag"
199 198) "10"
200 199) "maxclients"
201 200) "10000"
202 201) "active-defrag-max-scan-fields"
203 202) "1000"
204 203) "slowlog-max-len"
205 204) "128"
206 205) "acllog-max-len"
207 206) "128"
208 207) "lua-time-limit"
209 208) "5000"
210 209) "cluster-node-timeout"
211 210) "15000"
212 211) "slowlog-log-slower-than"
213 212) "10000"
214 213) "latency-monitor-threshold"
215 214) "0"
216 215) "proto-max-bulk-len"
217 216) "536870912"
218 217) "stream-node-max-entries"
219 218) "100"
220 219) "repl-backlog-size"
221 220) "1048576"
222 221) "maxmemory"
223 222) "0"
224 223) "hash-max-ziplist-entries"
225 224) "512"
226 225) "set-max-intset-entries"
227 226) "512"
228 227) "zset-max-ziplist-entries"
229 228) "128"
230 229) "active-defrag-ignore-bytes"
231 230) "104857600"
232 231) "hash-max-ziplist-value"
233 232) "64"
234 233) "stream-node-max-bytes"
235 234) "4096"
236 235) "zset-max-ziplist-value"
237 236) "64"
238 237) "hll-sparse-max-bytes"
239 238) "3000"
240 239) "tracking-table-max-keys"
241 240) "1000000"
242 241) "repl-backlog-ttl"
243 242) "3600"
244 243) "auto-aof-rewrite-min-size"
245 244) "67108864"
246 245) "logfile"
247 246) ""
248 247) "client-query-buffer-limit"
249 248) "1073741824"
250 249) "watchdog-period"
251 250) "0"
252 251) "dir"
253 252) "/usr/local/redis/bin"
254 253) "save"
255 254) "900 1 300 10 60 10000"
256 255) "client-output-buffer-limit"
257 256) "normal 0 0 0 slave 268435456 67108864 60 pubsub 33554432 8388608 60"
258 257) "unixsocketperm"
259 258) "0"
260 259) "slaveof"
261 260) ""
262 261) "notify-keyspace-events"
263 262) ""
264 263) "bind"
265 264) "127.0.0.1"
266 265) "requirepass"
267 266) ""
268 267) "oom-score-adj-values"
269 268) "0 200 800"
View Code

config get setting-name,獲取單獨的配置項,如loglevel,如下所示:

1 127.0.0.1:6379> config get loglevel
2 1) "loglevel"
3 2) "notice"
4 127.0.0.1:6379> 

 config set setting-name setting-value的格式來設定項,如下所示:

1 127.0.0.1:6379> config set loglevel verbose
2 OK
3 127.0.0.1:6379> config get loglevel
4 1) "loglevel"
5 2) "verbose"
6 127.0.0.1:6379> 

本文主要簡述常見配置,更多配置,可參考菜鳥教程,

備注

洞仙歌·冰肌玉骨

朝代:宋朝|作者:蘇軾

仆七歲時,見眉州老尼,姓朱,忘其名,年九十歲,自言嘗隨其師入蜀主孟昶宮中,一日大熱,蜀主與花蕊夫人夜納涼摩訶池上,作一詞,朱具能記之, 今四十年,朱已死久矣,人無知此詞者,但記其首兩句,暇日尋味,豈《洞仙歌》令乎?乃為足之云,   冰肌玉骨,自清涼無汗, 水殿風來暗香滿, 繡簾開,一點明月窺人,人未寢,欹(qī)枕釵橫鬢亂,   起來攜素手,庭戶無聲,時見疏星渡河漢, 試問夜如何? 夜已三更,金波淡,玉繩低轉, 但屈指西風幾時來, 又不道流年暗中偷換,

轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/249776.html

標籤:其他

上一篇:SQL LEN()函式用法

下一篇:抖音資料采集教程,動靜態結合逆向WhatsApp

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • GPU虛擬機創建時間深度優化

    **?桔妹導讀:**GPU虛擬機實體創建速度慢是公有云面臨的普遍問題,由于通常情況下創建虛擬機屬于低頻操作而未引起業界的重視,實際生產中還是存在對GPU實體創建時間有苛刻要求的業務場景。本文將介紹滴滴云在解決該問題時的思路、方法、并展示最終的優化成果。 從公有云服務商那里購買過虛擬主機的資深用戶,一 ......

    uj5u.com 2020-09-10 06:09:13 more
  • 可編程網卡芯片在滴滴云網路的應用實踐

    **?桔妹導讀:**隨著云規模不斷擴大以及業務層面對延遲、帶寬的要求越來越高,采用DPDK 加速網路報文處理的方式在橫向縱向擴展都出現了局限性。可編程芯片成為業界熱點。本文主要講述了可編程網卡芯片在滴滴云網路中的應用實踐,遇到的問題、帶來的收益以及開源社區貢獻。 #1. 資料中心面臨的問題 隨著滴滴 ......

    uj5u.com 2020-09-10 06:10:21 more
  • 滴滴資料通道服務演進之路

    **?桔妹導讀:**滴滴資料通道引擎承載著全公司的資料同步,為下游實時和離線場景提供了必不可少的源資料。隨著任務量的不斷增加,資料通道的整體架構也隨之發生改變。本文介紹了滴滴資料通道的發展歷程,遇到的問題以及今后的規劃。 #1. 背景 資料,對于任何一家互聯網公司來說都是非常重要的資產,公司的大資料 ......

    uj5u.com 2020-09-10 06:11:05 more
  • 滴滴AI Labs斬獲國際機器翻譯大賽中譯英方向世界第三

    **桔妹導讀:**深耕人工智能領域,致力于探索AI讓出行更美好的滴滴AI Labs再次斬獲國際大獎,這次獲獎的專案是什么呢?一起來看看詳細報道吧! 近日,由國際計算語言學協會ACL(The Association for Computational Linguistics)舉辦的世界最具影響力的機器 ......

    uj5u.com 2020-09-10 06:11:29 more
  • MPP (Massively Parallel Processing)大規模并行處理

    1、什么是mpp? MPP (Massively Parallel Processing),即大規模并行處理,在資料庫非共享集群中,每個節點都有獨立的磁盤存盤系統和記憶體系統,業務資料根據資料庫模型和應用特點劃分到各個節點上,每臺資料節點通過專用網路或者商業通用網路互相連接,彼此協同計算,作為整體提供 ......

    uj5u.com 2020-09-10 06:11:41 more
  • 滴滴資料倉庫指標體系建設實踐

    **桔妹導讀:**指標體系是什么?如何使用OSM模型和AARRR模型搭建指標體系?如何統一流程、規范化、工具化管理指標體系?本文會對建設的方法論結合滴滴資料指標體系建設實踐進行解答分析。 #1. 什么是指標體系 ##1.1 指標體系定義 指標體系是將零散單點的具有相互聯系的指標,系統化的組織起來,通 ......

    uj5u.com 2020-09-10 06:12:52 more
  • 單表千萬行資料庫 LIKE 搜索優化手記

    我們經常在資料庫中使用 LIKE 運算子來完成對資料的模糊搜索,LIKE 運算子用于在 WHERE 子句中搜索列中的指定模式。 如果需要查找客戶表中所有姓氏是“張”的資料,可以使用下面的 SQL 陳述句: SELECT * FROM Customer WHERE Name LIKE '張%' 如果需要 ......

    uj5u.com 2020-09-10 06:13:25 more
  • 滴滴Ceph分布式存盤系統優化之鎖優化

    **桔妹導讀:**Ceph是國際知名的開源分布式存盤系統,在工業界和學術界都有著重要的影響。Ceph的架構和演算法設計發表在國際系統領域頂級會議OSDI、SOSP、SC等上。Ceph社區得到Red Hat、SUSE、Intel等大公司的大力支持。Ceph是國際云計算領域應用最廣泛的開源分布式存盤系統, ......

    uj5u.com 2020-09-10 06:14:51 more
  • es~通過ElasticsearchTemplate進行聚合~嵌套聚合

    之前寫過《es~通過ElasticsearchTemplate進行聚合操作》的文章,這一次主要寫一個嵌套的聚合,例如先對sex集合,再對desc聚合,最后再對age求和,共三層嵌套。 Aggregations的部分特性類似于SQL語言中的group by,avg,sum等函式,Aggregation ......

    uj5u.com 2020-09-10 06:14:59 more
  • 爬蟲日志監控 -- Elastc Stack(ELK)部署

    傻瓜式部署,只需替換IP與用戶 導讀: 現ELK四大組件分別為:Elasticsearch(核心)、logstash(處理)、filebeat(采集)、kibana(可視化) 下載均在https://www.elastic.co/cn/downloads/下tar包,各組件版本最好一致,配合fdm會 ......

    uj5u.com 2020-09-10 06:15:05 more
最新发布
  • day02-2-商鋪查詢快取

    功能02-商鋪查詢快取 3.商鋪詳情快取查詢 3.1什么是快取? 快取就是資料交換的緩沖區(稱作Cache),是存盤資料的臨時地方,一般讀寫性能較高。 快取的作用: 降低后端負載 提高讀寫效率,降低回應時間 快取的成本: 資料一致性成本 代碼維護成本 運維成本 3.2需求說明 如下,當我們點擊商店詳 ......

    uj5u.com 2023-04-20 08:33:24 more
  • MySQL中binlog備份腳本分享

    關于MySQL的二進制日志(binlog),我們都知道二進制日志(binlog)非常重要,尤其當你需要point to point災難恢復的時侯,所以我們要對其進行備份。關于二進制日志(binlog)的備份,可以基于flush logs方式先切換binlog,然后拷貝&壓縮到到遠程服務器或本地服務器 ......

    uj5u.com 2023-04-20 08:28:06 more
  • day02-短信登錄

    功能實作02 2.功能01-短信登錄 2.1基于Session實作登錄 2.1.1思路分析 2.1.2代碼實作 2.1.2.1發送短信驗證碼 發送短信驗證碼: 發送驗證碼的介面為:http://127.0.0.1:8080/api/user/code?phone=xxxxx<手機號> 請求方式:PO ......

    uj5u.com 2023-04-20 08:27:27 more
  • 快取與資料庫雙寫一致性幾種策略分析

    本文將對幾種快取與資料庫保證資料一致性的使用方式進行分析。為保證高并發性能,以下分析場景不考慮執行的原子性及加鎖等強一致性要求的場景,僅追求最終一致性。 ......

    uj5u.com 2023-04-20 08:26:48 more
  • sql陳述句優化

    問題查找及措施 問題查找 需要找到具體的代碼,對其進行一對一優化,而非一直把關注點放在服務器和sql平臺 降低簡化每個事務中處理的問題,盡量不要讓一個事務拖太長的時間 例如檔案上傳時,應將檔案上傳這一步放在事務外面 微軟建議 4.啟動sql定時執行計劃 怎么啟動sqlserver代理服務-百度經驗 ......

    uj5u.com 2023-04-20 08:26:35 more
  • 云時代,MySQL到ClickHouse資料同步產品對比推薦

    ClickHouse 在執行分析查詢時的速度優勢很好的彌補了MySQL的不足,但是對于很多開發者和DBA來說,如何將MySQL穩定、高效、簡單的同步到 ClickHouse 卻很困難。本文對比了 NineData、MaterializeMySQL(ClickHouse自帶)、Bifrost 三款產品... ......

    uj5u.com 2023-04-20 08:26:29 more
  • sql陳述句優化

    問題查找及措施 問題查找 需要找到具體的代碼,對其進行一對一優化,而非一直把關注點放在服務器和sql平臺 降低簡化每個事務中處理的問題,盡量不要讓一個事務拖太長的時間 例如檔案上傳時,應將檔案上傳這一步放在事務外面 微軟建議 4.啟動sql定時執行計劃 怎么啟動sqlserver代理服務-百度經驗 ......

    uj5u.com 2023-04-20 08:25:13 more
  • Redis 報”OutOfDirectMemoryError“(堆外記憶體溢位)

    Redis 報錯“OutOfDirectMemoryError(堆外記憶體溢位) ”問題如下: 一、報錯資訊: 使用 Redis 的業務介面 ,產生 OutOfDirectMemoryError(堆外記憶體溢位),如圖: 格式化后的報錯資訊: { "timestamp": "2023-04-17 22: ......

    uj5u.com 2023-04-20 08:24:54 more
  • day02-2-商鋪查詢快取

    功能02-商鋪查詢快取 3.商鋪詳情快取查詢 3.1什么是快取? 快取就是資料交換的緩沖區(稱作Cache),是存盤資料的臨時地方,一般讀寫性能較高。 快取的作用: 降低后端負載 提高讀寫效率,降低回應時間 快取的成本: 資料一致性成本 代碼維護成本 運維成本 3.2需求說明 如下,當我們點擊商店詳 ......

    uj5u.com 2023-04-20 08:24:03 more
  • day02-短信登錄

    功能實作02 2.功能01-短信登錄 2.1基于Session實作登錄 2.1.1思路分析 2.1.2代碼實作 2.1.2.1發送短信驗證碼 發送短信驗證碼: 發送驗證碼的介面為:http://127.0.0.1:8080/api/user/code?phone=xxxxx<手機號> 請求方式:PO ......

    uj5u.com 2023-04-20 08:23:11 more