Redis 一主三從 哨兵

http://blog.51cto.com/mxlmgl/2065789

redis-server說明

服務(wù)器A:192.168.1.131:8000(主)

服務(wù)器B:192.168.1.135:8000

服務(wù)器C:192.168.1.231:8000

服務(wù)器D:192.168.1.241:8000

redis-sentinel說明

服務(wù)器A:192.168.1.131:6800

服務(wù)器B:192.168.1.135:6800

服務(wù)器C:192.168.1.231:6800

服務(wù)器D:192.168.1.241:6800

2.搭建redis系統(tǒng)

yum ?install ?-y ?gcc* ?tcl

首先下載安裝redis

cd /usr/local

wget?http://download.redis.io/releases/redis-3.2.11.tar.gz

tar zxvf redis-3.2.11.tar.gz

mv redis-3.2.11 ?redis

cd redis

make && make install

如果編譯安裝過程中,出現(xiàn)報錯:

zmalloc.h:51:31: error: jemalloc/jemalloc.h: No such file or directory

原因:一些編譯依賴或原來編譯遺留出現(xiàn)的問題

解決方案:make distclean?清理一下,然后再make

或者直接 ?make MALLOC=libc ?&& make install

[root@localhost redis]# cd src

[root@localhost src]#cp redis-server redis-cli redis-check-aof redis-check-rdb redis-sentinel redis-trib.rb /usr/local/bin/

[root@localhost src]#?mkdir /etc/redis

[root@localhost src]#?mkdir /var/redis

[root@localhost src]# mkdir ?/var/redis/{log,run,redis}

[root@localhost src]cd ..

[root@localhost redis]#cp redis.conf /etc/redis/redis.conf

[root@localhost redis]# ?vi/etc/redis/redis.conf

修改如下:

port ?8000?#修改端口是安全的第一步

daemonize ?yes? ?

bind?0.0.0.0

pidfile? ? /var/run/redis-8000.pid?

logfile??/var/redis/log/redis_8000.log

dir /var/redis/redis?//工作目錄,dump文件所在目錄

slaveof ?192.168.1.131 ?8000 ? ?#從redis比主redis多這一行

########################################################

redis默認(rèn)的持久化方式是RDB,數(shù)據(jù)寫入到dump文件中。如果要啟用AOF持久化,就在redis.conf文件中配置如下:

appendonly yes ? ? ? ? #啟用AOF持久化方式

appendfilename "appendonly.aof" ? ? ? #AOF文件的名稱,默認(rèn)為appendonly.aof

# appendfsync always ? ? ? ?#每次收到寫命令就立即強制寫入磁盤,是最有保證的完全的持久化,但速度也是最慢的,一般不推薦使用。

appendfsync everysec ? ? ? ?#每秒鐘強制寫入磁盤一次,在性能和持久化方面做了很好的折中,是受推薦的方式。

# appendfsync no ? ? ? ? #完全依賴OS的寫入,一般為30秒左右一次,性能最好但是持久化最沒有保證,不被推薦。

########################################################

[root@localhost redis]#redis-server /etc/redis/redis.conf?

設(shè)置開機啟動

[root@dev ~]# echo "/usr/local/bin/redis-server /etc/redis/redis.conf" >> /etc/rc.local

關(guān)閉redis服務(wù)

[root@dev ~]# redis-cli shutdown //默認(rèn)是6379端口

如果端口變化可以指定端口

[root@dev ~]# redis-cli -p 8000 shutdown

########################################################

還可以通過如下方法,設(shè)置redis服務(wù)啟動腳本及開機自啟動

將redis解壓包下utils下redis啟動腳本redis_init_script拷貝至/etc/init.d/,并修改腳本名稱(也可不修改)為redis

[root@dev ~]# cp /usr/local/src/redis-stable/utils/redis_init_script /etc/init.d/redis

[root@dev ~]# chmod +x /etc/init.d/redis

修改腳本pid及conf路徑為實際路徑

[root@dev ~]# vim /etc/init.d/redis

......

REDISPORT=6379

EXEC=/usr/local/bin/redis-server

CLIEXEC=/usr/local/bin/redis-cli

PIDFILE=/var/redis/run/redis_6379.pid

CONF="/etc/redis/redis.conf"

......

這樣,就可以直接用下面的命令關(guān)閉和啟動redis服務(wù)了

[root@dev ~]# /etc/init.d/redis stop

Stopping ...

Redis stopped

[root@dev ~]# lsof -i:6379

[root@dev ~]# /etc/init.d/redis start

Starting Redis server...

[root@dev ~]# lsof -i:6379

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME

redis-ser 9372 root 4u IPv4 58648940 0t0 TCP localhost:6379 (LISTEN)

設(shè)置自啟動

[root@dev ~]# chkconfig redis on

redis 服務(wù)不支持 chkconfig

這是因為沒有在啟動腳本/etc/init.d/redis里加入redis啟動優(yōu)先級信息,可添加如下紅色字體的兩行:

[root@dev ~]# vim /etc/init.d/redis?

#!/bin/sh

#

# chkconfig: 2345 90 10 ? ??? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??//注意:后面的英文空格

# description: Redis is a persistent key-value database?? ? ? ? ?//注意:后面的英文空格

# Simple Redis init.d script conceived to work on Linux systems

# as it does use of the /proc filesystem.

REDISPORT=6379

EXEC=/usr/local/bin/redis-server

CLIEXEC=/usr/local/bin/redis-cli

PIDFILE=/var/redis/run/redis_6379.pid

CONF="/etc/redis/redis.conf"

.......

[root@dev ~]# chkconfig redis on

[root@dev ~]# chkconfig --list|grep redis

redis 0:關(guān)閉 1:關(guān)閉 2:啟用 3:啟用 4:啟用 5:啟用 6:關(guān)閉

########################################################

驗證:

在A服務(wù)器(主)

[root@localhost ~]# ? redis-cli -h 192.168.1.131 -p 8000 info replication

[root@localhost ~]# ? ?redis-cli -h 192.168.1.131 -p 8000 info replication

# Replication

role:master

connected_slaves:3

slave0:ip=192.168.1.231,port=8000,state=online,offset=462,lag=0

slave1:ip=192.168.1.241,port=8000,state=online,offset=462,lag=1

slave2:ip=192.168.1.135,port=8000,state=online,offset=462,lag=1

master_repl_offset:462

repl_backlog_active:1

repl_backlog_size:1048576

repl_backlog_first_byte_offset:2

repl_backlog_histlen:461

#############################################################################

[root@localhost ~]# ? redis-cli -h 192.168.1.131 -p 8000

[root@localhost ~]# ? 192.168.1.131:8000> get name thb ? ? ?(主,1.131)

[root@localhost redis]# redis-cli -h 192.168.1.135 -p 8000 ? ? ?(從。1.135)

192.168.1.135:8000> get name

"thb"

192.168.1.135:8000>

############################################################################

配置哨兵sentinel

[root@localhost redis]# ?cd /usr/local/redis

[root@localhost redis]# ?mkdir /etc/sentinel

[root@localhost redis]# ?cp -a sentinel.conf /etc/sentinel

[root@localhost redis]# ? vi /etc/sentinel/sentinel.conf ? (之前的都刪掉,就保留下面的內(nèi)容)

bind ?0.0.0.0

daemonize yes

port ?6800

logfile ?/var/log/sentinel.log

pidfile ?/var/run/sentinel.pid

sentinel monitor master8000 192.168.1.131 8000 2

#5秒內(nèi)master6800沒有響應(yīng),就認(rèn)為SDOWN

sentinel down-after-milliseconds master8000 5000

sentinel failover-timeout ?master8000 15000

[root@localhost redis]# ?redis-sentinel ?/etc/sentinel/sentinel.conf

[root@localhost redis]#echo "/usr/local/bin/redis-sentinel?/etc/sentinel/sentinel.conf" >> /etc/rc.local

四個redis-sentinel服務(wù)啟動完畢后,連接任意sentinel服務(wù)可以獲知當(dāng)前主redis服務(wù)信息

[root@localhost ~]# redis-cli -h 192.168.1.131 -p 6800 info sentinel

# Sentinel

sentinel_masters:1

sentinel_tilt:0

sentinel_running_scripts:0

sentinel_scripts_queue_length:0

sentinel_simulate_failure_flags:0

master0:name=master8000,status=ok,address=192.168.1.131:8000,slaves=3,sentinels=3

測試

1.把主redis停掉

[root@localhost ~]# redis-cli -h 192.168.1.131 -p 8000 shutdown

[root@localhost ~]# netstat -ntpl

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address ? ? ? ? ? ? ? Foreign Address ? ? ? ? ? ? State ? ? ? PID/Program name

tcp ? ? ? ?0 ? ? ?0 0.0.0.0:58566 ? ? ? ? ? ? ? 0.0.0.0:* ? ? ? ? ? ? ? ? ? LISTEN ? ? ?1235/rpc.statd

tcp ? ? ? ?0 ? ? ?0 0.0.0.0:111 ? ? ? ? ? ? ? ? 0.0.0.0:* ? ? ? ? ? ? ? ? ? LISTEN ? ? ?1213/rpcbind

tcp ? ? ? ?0 ? ? ?0 0.0.0.0:6800 ? ? ? ? ? ? ? ?0.0.0.0:* ? ? ? ? ? ? ? ? ? LISTEN ? ? ?1685/redis-sentinel

tcp ? ? ? ?0 ? ? ?0 0.0.0.0:22 ? ? ? ? ? ? ? ? ?0.0.0.0:* ? ? ? ? ? ? ? ? ? LISTEN ? ? ?1447/sshd

tcp ? ? ? ?0 ? ? ?0 127.0.0.1:631 ? ? ? ? ? ? ? 0.0.0.0:* ? ? ? ? ? ? ? ? ? LISTEN ? ? ?1290/cupsd

tcp ? ? ? ?0 ? ? ?0 127.0.0.1:25 ? ? ? ? ? ? ? ?0.0.0.0:* ? ? ? ? ? ? ? ? ? LISTEN ? ? ?1526/master

tcp ? ? ? ?0 ? ? ?0 :::111 ? ? ? ? ? ? ? ? ? ? ?:::* ? ? ? ? ? ? ? ? ? ? ? ?LISTEN ? ? ?1213/rpcbind

tcp ? ? ? ?0 ? ? ?0 :::52913 ? ? ? ? ? ? ? ? ? ?:::* ? ? ? ? ? ? ? ? ? ? ? ?LISTEN ? ? ?1235/rpc.statd

tcp ? ? ? ?0 ? ? ?0 :::22 ? ? ? ? ? ? ? ? ? ? ? :::* ? ? ? ? ? ? ? ? ? ? ? ?LISTEN ? ? ?1447/sshd

tcp ? ? ? ?0 ? ? ?0 ::1:631 ? ? ? ? ? ? ? ? ? ? :::* ? ? ? ? ? ? ? ? ? ? ? ?LISTEN ? ? ?1290/cupsd

tcp ? ? ? ?0 ? ? ?0 ::1:25 ? ? ? ? ? ? ? ? ? ? ?:::* ? ? ? ? ? ? ? ? ? ? ? ?LISTEN ? ? ?1526/master

2.查看redis-sentinel的監(jiān)控狀態(tài)

[root@localhost ~]# redis-cli -h 192.168.1.131 -p 6800 info sentinel

# Sentinel

sentinel_masters:1

sentinel_tilt:0

sentinel_running_scripts:0

sentinel_scripts_queue_length:0

sentinel_simulate_failure_flags:0

master0:name=master8000,status=ok,address=192.168.1.231:8000,slaves=3,sentinels=6

發(fā)現(xiàn)231這臺redis-server提升為主庫。

在1.231 這臺上查看

[root@session1 ~]# redis-cli -h 192.168.1.231 -p 8000 info replication

# Replication

role:master

connected_slaves:2

slave0:ip=192.168.1.241,port=8000,state=online,offset=36416,lag=1

slave1:ip=192.168.1.135,port=8000,state=online,offset=36558,lag=0

master_repl_offset:36842

repl_backlog_active:1

repl_backlog_size:1048576

repl_backlog_first_byte_offset:2

repl_backlog_histlen:36841

發(fā)現(xiàn)role已經(jīng)是master了

至此,redis的高可用方案已經(jīng)搭建完成。

六、客戶端程序

客戶端程序(如PHP程序)連接redis時需要ip和port,但redis-server進行故障轉(zhuǎn)移時,主redis是變化的,所以ip地址也是變化的??蛻舳顺绦蛉绾胃兄?dāng)前主redis的ip地址和端口呢?redis-sentinel提供了接口,請求任何一個sentinel,發(fā)送SENTINEL get-master-addr-by-name 就能得到當(dāng)前主redis的ip和port。

[root@localhost ~]# redis-cli -h 192.168.1.131 -p 6800

192.168.1.131:6800> sentinel get-master-addr-by-name master8000

1) "192.168.1.231"

2) "8000"

192.168.1.131:6800>

獲取當(dāng)前主redis的ip和port

客戶端每次連接redis前,先向sentinel發(fā)送請求,獲得主redis的ip和port,然后用返回的ip和port連接redis。

這種方法的缺點是顯而易見的,每次操作redis至少需要發(fā)送兩次連接請求,第一次請求sentinel,第二次請求redis。

php請求sentinel程序代碼可參見:https://github.com/huyanping/redis-sentinel

更好的辦法是使用VIP,當(dāng)然這對配置的環(huán)境有一定的要求,比如redis搭建在阿里云服務(wù)器上,可能不支持VIP。

VIP方案是,redis系統(tǒng)對外始終是同一ip地址,當(dāng)redis進行故障轉(zhuǎn)移時,需要做的是將VIP從之前的redis服務(wù)器漂移到現(xiàn)在新的主redis服務(wù)器上。

比如:當(dāng)前redis系統(tǒng)中主redis的ip地址是192.168.56.101,那么VIP(192.168.56.250)指向192.168.56.101,客戶端程序用VIP(192.168.56.250)地址連接redis,實際上連接的就是當(dāng)前主redis,這樣就避免了向sentinel發(fā)送請求。

當(dāng)主redis宕機,進行故障轉(zhuǎn)移時,192.168.56.102這臺服務(wù)器上的redis提升為主,這時VIP(192.168.56.250)指向192.168.56.102,這樣客戶端程序不需要修改任何代碼,連接的是192.168.56.102這臺主redis。

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?VIP指向192.168.1.131

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 故障轉(zhuǎn)移后,VIP漂移指向192.168.1.231

七、漂移VIP

那么現(xiàn)在的問題是,如何在進行redis故障轉(zhuǎn)移時,將VIP漂移到新的主redis服務(wù)器上。

這里可以使用redis sentinel的一個參數(shù)client-reconfig-script,這個參數(shù)配置執(zhí)行腳本,sentinel在做failover的時候會執(zhí)行這個腳本,并且傳遞6個參數(shù)、 、 、 、 、 、,其中是新主redis的IP地址,可以在這個腳本里做VIP漂移操作。

sentinel client-reconfig-script master8000 ? /opt/notify_master6800.sh

修改三個服務(wù)器的redis-sentinel配置文件/etc/sentinel.conf,增加上面一行。然后在/opt/目錄下創(chuàng)建notify_master6800.sh腳本文件,這個腳本做VIP漂移操作,內(nèi)容如下:

#notify_master6800.sh腳本內(nèi)容?

#!/bin/bash

MASTER_IP=$6? #第六個參數(shù)是新主redis的ip地址

LOCAL_IP='192.168.1.231'? #其他三個服務(wù)器上為192.168.1.131,192.168.56.135,192.168.1.241

VIP='192.168.1.251'

NETMASK='24'

INTERFACE='eth0'

if [ ${MASTER_IP} = ${LOCAL_IP} ];then

? ? /sbin/ip? addr? add ${VIP}/${NETMASK}? dev ${INTERFACE}? #將VIP綁定到該服務(wù)器上

? ? /sbin/arping -q -c 3 -A ${VIP} -I ${INTERFACE}

? ? exit 0

else

? ?/sbin/ip? addr del? ${VIP}/${NETMASK}? dev ${INTERFACE}? ?#將VIP從該服務(wù)器上刪除

? ?exit 0

fi

exit 1? #如果返回1,sentinel會一直執(zhí)行這個腳本

現(xiàn)在當(dāng)前主redis是192.168.1.231,需要手動綁定VIP到該服務(wù)器上。

/sbin/ip ?addr add 192.168.1.251/24 dev eth0?

/sbin/arping -q ? -c 3 -A 192.168.1.251 -I eth0

然后,去另一個服務(wù)器上通過VIP地址連接redis-server和redis-sentinel。

[root@localhost opt]# ifconfig

eth0 ? ? ?Link encap:Ethernet ?HWaddr 00:0C:29:34:43:27

inet addr:192.168.1.131?Bcast:192.168.1.255 ?Mask:255.255.255.0

inet6 addr: fe80::20c:29ff:fe34:4327/64 Scope:Link

UP BROADCAST RUNNING MULTICAST ?MTU:1500 ?Metric:1

RX packets:3830849 errors:0 dropped:0 overruns:0 frame:0

TX packets:3406249 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:444297730 (423.7 MiB) ?TX bytes:416136987 (396.8 MiB)

[root@localhost opt]#?redis-cli -h 192.168.1.251 -p 8000 info replication

# Replication

role:master

connected_slaves:3

slave0:ip=192.168.1.241,port=8000,state=online,offset=18468111,lag=1

slave1:ip=192.168.1.135,port=8000,state=online,offset=18468111,lag=0

slave2:ip=192.168.1.131,port=8000,state=online,offset=18468111,lag=0

master_repl_offset:18468111

repl_backlog_active:1

repl_backlog_size:1048576

repl_backlog_first_byte_offset:17419536

[root@localhost opt]#?redis-cli -h 192.168.1.251 -p 6800 info sentinel

# Sentinel

sentinel_masters:1

sentinel_tilt:0

sentinel_running_scripts:0

sentinel_scripts_queue_length:0

sentinel_simulate_failure_flags:0

master0:name=master8000,status=ok,address=192.168.1.231:8000,slaves=3,sentinels=4

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??通過VIP連接redis

從上面也可以看出當(dāng)前主redis是192.168.1.231。

下面關(guān)閉這臺redis服務(wù),看看VIP是否漂移到另一臺服務(wù)器上。

[root@session1 opt]#?redis-cli -h 192.168.1.231 -p 8000 shutdown

[root@session1 opt]#?redis-cli -h 192.168.1.231 -p 6800 info sentinel

# Sentinel

sentinel_masters:1

sentinel_tilt:0

sentinel_running_scripts:0

sentinel_scripts_queue_length:0

sentinel_simulate_failure_flags:0

master0:name=master8000,status=ok,address=192.168.1.135:8000,slaves=3,sentinels=4

[root@localhost opt]#?redis-cli -h 192.168.1.251 -p 6800 info sentinel

# Sentinel

sentinel_masters:1

sentinel_tilt:0

sentinel_running_scripts:0

sentinel_scripts_queue_length:0

sentinel_simulate_failure_flags:0

master0:name=master8000,status=ok,address=192.168.1.135:8000,slaves=3,sentinels=4

通過訪問VIP連接redis,發(fā)現(xiàn)VIP確實指向了192.168.1.135。

這里要注意腳本里的ip和網(wǎng)卡名稱(eth)不能錯,要不飄移不成功。

八、總結(jié)

通過上面的操作,使用redis主從 + 哨兵(sentinel)+ 漂移VIP的方案搭建了一個redis高可用系統(tǒng),但這個系統(tǒng)保證的是單個redis實例的高可用,所以適合業(yè)務(wù)比較小的應(yīng)用。如果業(yè)務(wù)比較大,并發(fā)量比較高,建議搭建redis集群,比如官方redis cluster,還有開源的codings集群。

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌,老刑警劉巖,帶你破解...
    沈念sama閱讀 228,156評論 6 531
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異,居然都是意外死亡,警方通過查閱死者的電腦和手機,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 98,401評論 3 415
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人,你說我怎么就攤上這事?!?“怎么了?”我有些...
    開封第一講書人閱讀 176,069評論 0 373
  • 文/不壞的土叔 我叫張陵,是天一觀的道長。 經(jīng)常有香客問我,道長,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 62,873評論 1 309
  • 正文 為了忘掉前任,我火速辦了婚禮,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘。我一直安慰自己,他們只是感情好,可當(dāng)我...
    茶點故事閱讀 71,635評論 6 408
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著,像睡著了一般。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 55,128評論 1 323
  • 那天,我揣著相機與錄音,去河邊找鬼。 笑死,一個胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播,決...
    沈念sama閱讀 43,203評論 3 441
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 42,365評論 0 288
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 48,881評論 1 334
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 40,733評論 3 354
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 42,935評論 1 369
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情,我是刑警寧澤,帶...
    沈念sama閱讀 38,475評論 5 358
  • 正文 年R本政府宣布,位于F島的核電站,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 44,172評論 3 347
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧,春花似錦、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 34,582評論 0 26
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 35,821評論 1 282
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人。 一個月前我還...
    沈念sama閱讀 51,595評論 3 390
  • 正文 我出身青樓,卻偏偏與公主長得像,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 47,908評論 2 372

推薦閱讀更多精彩內(nèi)容

  • 前言 Redis是一個高性能的key-value數(shù)據(jù)庫,現(xiàn)時越來越多企業(yè)與應(yīng)用使用Redis作為緩存服務(wù)器。樓主是...
    liangzzz閱讀 4,279評論 9 152
  • NOSQL類型簡介鍵值對:會使用到一個哈希表,表中有一個特定的鍵和一個指針指向特定的數(shù)據(jù),如redis,volde...
    MicoCube閱讀 4,032評論 2 27
  • 1 Redis介紹1.1 什么是NoSql為了解決高并發(fā)、高可擴展、高可用、大數(shù)據(jù)存儲問題而產(chǎn)生的數(shù)據(jù)庫解決方...
    克魯?shù)吕?/span>閱讀 5,330評論 0 36
  • 在cross validated上發(fā)現(xiàn)了類似的問題,boostrap的bias多是拿來估計variance,并且有...
    張10_閱讀 382評論 0 1
  • 娃奶奶是地地道道的農(nóng)村人,勤勞能干的農(nóng)村婦女。 她帶我家娃有半年多了。白天我上班,中午回來一次看看寶寶,喂個奶就直...
    郭小果子閱讀 1,158評論 1 1