返回

使用RedisInsight 1.x版,BULK ACTIONS功能,還原數據,從一個cluster遷移所有分片數據到另一個cluster,結果->有些數據Key Name被修改了,此方式不可行

使用RedisInsight 1.x版,BULK ACTIONS功能,還原數據,從一個cluster遷移所有分片數據到另一個cluster,結果->有些數據Key Name被修改了,此方式不可行

目錄

Redis Cluster主機IP表

主機名稱主機IP角色主機IP角色跟隨
redis91192.168.1.91:6379master192.168.1.91:6380slave192.168.1.92:6380
redis92192.168.1.92:6379master192.168.1.92:6380slave192.168.1.93:6380
redis93192.168.1.93:6379master192.168.1.93:6380slave192.168.1.91:6380
redis94192.168.1.94:6379master192.168.1.94:6380slave192.168.1.98:6380
redis98192.168.1.98:6379master192.168.1.98:6380slave192.168.1.94:6380

RedisInsight添加Redis主機

使用BULK ACTION Restore數據

我是用k8s佈屬RedisInsight,所以才看一下,佈屬到哪個節點,需要把要恢復數據的RBD檔案,傳至那台主機RedisInsight POD裡面

root@k8s-master71u:~# kubectl get pod -o wide
NAME                           READY   STATUS    RESTARTS      AGE   IP               NODE          NOMINATED NODE   READINESS GATES
redisinsight-cf7f6847b-s2zgg   1/1     Running   0             18h   10.201.255.218   k8s-node76u   <none>           <none>
test-nginx                     1/1     Running   2 (13d ago)   13d   10.201.14.154    k8s-node75u   <none>           <none>
web2-5d48fb75c5-dt5xd          1/1     Running   2 (13d ago)   13d   10.201.255.211   k8s-node76u   <none>           <none>
web2-5d48fb75c5-ggmrz          1/1     Running   2 (13d ago)   13d   10.201.14.148    k8s-node75u   <none>           <none>
web2-5d48fb75c5-jsvck          1/1     Running   2 (13d ago)   13d   10.201.255.215   k8s-node76u   <none>           <none>
root@k8s-node76u:~# docker ps | grep -i redis
5524bf7385e4   64a3d4d7e868                "bash ./docker-entry…"   18 hours ago   Up 18 hours             k8s_redisinsight_redisinsight-cf7f6847b-s2zgg_default_65440569-c6e2-4f40-b836-8bf2b0c9b511_0
efebd005bac3   registry.k8s.io/pause:3.9   "/pause"                 18 hours ago   Up 18 hours             k8s_POD_redisinsight-cf7f6847b-s2zgg_default_65440569-c6e2-4f40-b836-8bf2b0c9b511_0
root@k8s-node76u:~# docker exec -ti 5524bf7385e4 bash

redisinsight@redisinsight-cf7f6847b-s2zgg:/app$ ls -l
total 64
-rw-r--r--  1 root root  6015 May  2  2023 appicon.pyc
-rw-rw-r--  1 root root   841 May  2  2023 docker-entry.sh
-rw-r--r--  1 root root   377 May  2  2023 entry.pyc
-rw-r--r--  1 root root  2511 May  2  2023 manage.pyc
-rw-rw-r--  1 root root  6850 May  2  2023 pyinstaller.spec
drwxr-xr-x 24 root root  4096 May  2  2023 redisinsight
-rw-rw-r--  1 root root  1089 May  2  2023 requirements.txt
-rw-r--r--  1 root root 26991 May  2  2023 startup.pyc
redisinsight@redisinsight-cf7f6847b-s2zgg:/app$

將要恢復數據的RBD檔案,傳至RedisInsight POD裡面

root@k8s-node76u:~# chown -R root:root dump-master*.rdb
root@k8s-node76u:~# chmod o+rw dump-master*.rdb


root@k8s-node76u:~# docker cp dump-master1.rdb 5524bf7385e4:/app/dump-master1.rdb
root@k8s-node76u:~# docker cp dump-master2.rdb 5524bf7385e4:/app/dump-master2.rdb
root@k8s-node76u:~# docker cp dump-master3.rdb 5524bf7385e4:/app/dump-master3.rdb
root@k8s-node76u:~# docker cp dump-master4.rdb 5524bf7385e4:/app/dump-master4.rdb
root@k8s-node76u:~# docker cp dump-master5.rdb 5524bf7385e4:/app/dump-master5.rdb
redisinsight@redisinsight-cf7f6847b-s2zgg:/app$ ls -l
total 1758796
-rw-r--r--  1 root root      6015 May  2  2023 appicon.pyc
-rw-rw-r--  1 root root       841 May  2  2023 docker-entry.sh
-rw----rw-  1 root root 343630318 Dec  5 07:27 dump-master1.rdb
-rw----rw-  1 root root 348759548 Dec  5 07:32 dump-master2.rdb
-rw----rw-  1 root root 349938872 Dec  5 07:53 dump-master3.rdb
-rw----rw-  1 root root 402484559 Dec  5 07:56 dump-master4.rdb
-rw----rw-  1 root root 356118026 Dec  5 07:56 dump-master5.rdb
-rw-r--r--  1 root root       377 May  2  2023 entry.pyc
-rw-r--r--  1 root root      2511 May  2  2023 manage.pyc
-rw-rw-r--  1 root root      6850 May  2  2023 pyinstaller.spec
drwxr-xr-x 24 root root      4096 May  2  2023 redisinsight
-rw-rw-r--  1 root root      1089 May  2  2023 requirements.txt
-rw-r--r--  1 root root     26991 May  2  2023 startup.pyc

開始恢復數據

恢復數據完成

[root@redis91 redis]# redis-cli --user 帳號 --pass 密碼 --cluster check 192.168.1.91:6379
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
192.168.1.91:6379 (2c05c930...) -> 122790 keys | 3277 slots | 1 slaves.
192.168.1.98:6379 (c40f72b0...) -> 75980 keys | 3277 slots | 1 slaves.
192.168.1.92:6379 (71d88e30...) -> 91349 keys | 3277 slots | 1 slaves.
192.168.1.93:6379 (caa1fb6b...) -> 76507 keys | 3276 slots | 1 slaves.
192.168.1.94:6379 (eaeb50d0...) -> 76336 keys | 3277 slots | 1 slaves.
[OK] 442962 keys in 5 masters.
27.04 keys per slot on average.
>>> Performing Cluster Check (using node 192.168.1.91:6379)
M: 2c05c930c506e54ebea35f8f0b731754cd44082a 192.168.1.91:6379
   slots:[0-3276] (3277 slots) master
   1 additional replica(s)
S: 1709189e2036c2e0c4168189be9074d66bce2991 192.168.1.92:6380
   slots: (0 slots) slave
   replicates 2c05c930c506e54ebea35f8f0b731754cd44082a
M: c40f72b0ee3ac4be0b9ddaea4d16079f723e13bf 192.168.1.98:6379
   slots:[13107-16383] (3277 slots) master
   1 additional replica(s)
M: 71d88e302c0a7ec240cbbb6f8380786d01da984c 192.168.1.92:6379
   slots:[3277-6553] (3277 slots) master
   1 additional replica(s)
M: caa1fb6b5fbc4e133b5ef472e2def11e836481f7 192.168.1.93:6379
   slots:[6554-9829] (3276 slots) master
   1 additional replica(s)
S: 500ed38b799c6d5ad13483f8e0fee45fc9142d69 192.168.1.94:6380
   slots: (0 slots) slave
   replicates c40f72b0ee3ac4be0b9ddaea4d16079f723e13bf
S: 533669750790e904050e917657beae942185a407 192.168.1.91:6380
   slots: (0 slots) slave
   replicates caa1fb6b5fbc4e133b5ef472e2def11e836481f7
S: b0bff6695a1318da9a01af2550c85de1e8e81a83 192.168.1.93:6380
   slots: (0 slots) slave
   replicates 71d88e302c0a7ec240cbbb6f8380786d01da984c
M: eaeb50d0d31025f1589b7c8cdc12867f7a474c24 192.168.1.94:6379
   slots:[9830-13106] (3277 slots) master
   1 additional replica(s)
S: 2b487243e0c78adb93ac73017d04a6ad39b51c36 192.168.1.98:6380
   slots: (0 slots) slave
   replicates eaeb50d0d31025f1589b7c8cdc12867f7a474c24
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.

再選第二個rbd檔進行恢復

[root@redis91 redis]# redis-cli --user 帳號 --pass 密碼 --cluster check 192.168.1.91:6379
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
192.168.1.91:6379 (2c05c930...) -> 198625 keys | 3277 slots | 1 slaves.
192.168.1.98:6379 (c40f72b0...) -> 152593 keys | 3277 slots | 1 slaves.
192.168.1.92:6379 (71d88e30...) -> 198771 keys | 3277 slots | 1 slaves.
192.168.1.93:6379 (caa1fb6b...) -> 184053 keys | 3276 slots | 1 slaves.
192.168.1.94:6379 (eaeb50d0...) -> 152590 keys | 3277 slots | 1 slaves.
[OK] 886632 keys in 5 masters.
54.12 keys per slot on average.
>>> Performing Cluster Check (using node 192.168.1.91:6379)
M: 2c05c930c506e54ebea35f8f0b731754cd44082a 192.168.1.91:6379
   slots:[0-3276] (3277 slots) master
   1 additional replica(s)
S: 1709189e2036c2e0c4168189be9074d66bce2991 192.168.1.92:6380
   slots: (0 slots) slave
   replicates 2c05c930c506e54ebea35f8f0b731754cd44082a
M: c40f72b0ee3ac4be0b9ddaea4d16079f723e13bf 192.168.1.98:6379
   slots:[13107-16383] (3277 slots) master
   1 additional replica(s)
M: 71d88e302c0a7ec240cbbb6f8380786d01da984c 192.168.1.92:6379
   slots:[3277-6553] (3277 slots) master
   1 additional replica(s)
M: caa1fb6b5fbc4e133b5ef472e2def11e836481f7 192.168.1.93:6379
   slots:[6554-9829] (3276 slots) master
   1 additional replica(s)
S: 500ed38b799c6d5ad13483f8e0fee45fc9142d69 192.168.1.94:6380
   slots: (0 slots) slave
   replicates c40f72b0ee3ac4be0b9ddaea4d16079f723e13bf
S: 533669750790e904050e917657beae942185a407 192.168.1.91:6380
   slots: (0 slots) slave
   replicates caa1fb6b5fbc4e133b5ef472e2def11e836481f7
S: b0bff6695a1318da9a01af2550c85de1e8e81a83 192.168.1.93:6380
   slots: (0 slots) slave
   replicates 71d88e302c0a7ec240cbbb6f8380786d01da984c
M: eaeb50d0d31025f1589b7c8cdc12867f7a474c24 192.168.1.94:6379
   slots:[9830-13106] (3277 slots) master
   1 additional replica(s)
S: 2b487243e0c78adb93ac73017d04a6ad39b51c36 192.168.1.98:6380
   slots: (0 slots) slave
   replicates eaeb50d0d31025f1589b7c8cdc12867f7a474c24
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.

再選第三個rbd檔進行恢復,陸續將5個都恢復完成

陸續完成五個dump.rdb的RESTORE

可以看到,key是平均寫入每個master,slot也不會有什麼改變

[root@redis91 redis]# redis-cli --user 帳號 --pass 密碼 --cluster check 192.168.1.91:6379
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
192.168.1.91:6379 (2c05c930...) -> 442550 keys | 3277 slots | 1 slaves.
192.168.1.98:6379 (c40f72b0...) -> 444646 keys | 3277 slots | 1 slaves.
192.168.1.92:6379 (71d88e30...) -> 443416 keys | 3277 slots | 1 slaves.
192.168.1.93:6379 (caa1fb6b...) -> 444081 keys | 3276 slots | 1 slaves.
192.168.1.94:6379 (eaeb50d0...) -> 443884 keys | 3277 slots | 1 slaves.
[OK] 2218577 keys in 5 masters.
135.41 keys per slot on average.
>>> Performing Cluster Check (using node 192.168.1.91:6379)
M: 2c05c930c506e54ebea35f8f0b731754cd44082a 192.168.1.91:6379
   slots:[0-3276] (3277 slots) master
   1 additional replica(s)
S: 1709189e2036c2e0c4168189be9074d66bce2991 192.168.1.92:6380
   slots: (0 slots) slave
   replicates 2c05c930c506e54ebea35f8f0b731754cd44082a
M: c40f72b0ee3ac4be0b9ddaea4d16079f723e13bf 192.168.1.98:6379
   slots:[13107-16383] (3277 slots) master
   1 additional replica(s)
M: 71d88e302c0a7ec240cbbb6f8380786d01da984c 192.168.1.92:6379
   slots:[3277-6553] (3277 slots) master
   1 additional replica(s)
M: caa1fb6b5fbc4e133b5ef472e2def11e836481f7 192.168.1.93:6379
   slots:[6554-9829] (3276 slots) master
   1 additional replica(s)
S: 500ed38b799c6d5ad13483f8e0fee45fc9142d69 192.168.1.94:6380
   slots: (0 slots) slave
   replicates c40f72b0ee3ac4be0b9ddaea4d16079f723e13bf
S: 533669750790e904050e917657beae942185a407 192.168.1.91:6380
   slots: (0 slots) slave
   replicates caa1fb6b5fbc4e133b5ef472e2def11e836481f7
S: b0bff6695a1318da9a01af2550c85de1e8e81a83 192.168.1.93:6380
   slots: (0 slots) slave
   replicates 71d88e302c0a7ec240cbbb6f8380786d01da984c
M: eaeb50d0d31025f1589b7c8cdc12867f7a474c24 192.168.1.94:6379
   slots:[9830-13106] (3277 slots) master
   1 additional replica(s)
S: 2b487243e0c78adb93ac73017d04a6ad39b51c36 192.168.1.98:6380
   slots: (0 slots) slave
   replicates eaeb50d0d31025f1589b7c8cdc12867f7a474c24
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.

分析數據

會讓REDIS執行一次bgsave,存下目前的所有key,並使用SYNC,將檔案複製到RedisInsight目錄/db/rsnaps裡面來進行分析

[root@redis91 redis]# ll
總計 595660
-rw-r--r-- 1 redis redis 609714517 12月 17 17:53 dump6379.rdb
-rw-r--r-- 1 redis redis       175 12月 17 17:16 dump6380.rdb
-rw-r--r-- 1 redis redis      1303 12月 16 22:17 nodes-6379.conf
-rw-r--r-- 1 redis redis      1303 12月 16 22:17 nodes-6380.conf
-rw-r--r-- 1 redis redis    109501 12月 16 22:01 redis6380.conf
-rw-r--r-- 1 redis redis    109501 12月 16 22:01 redis.conf
-rw-r--r-- 1 redis redis      1041 12月 16 22:01 users.acl
redisinsight@redisinsight-cf7f6847b-s2zgg:/db/rsnaps$ pwd
/db/rsnaps
redisinsight@redisinsight-cf7f6847b-s2zgg:/db/rsnaps$ ls -lh
total 5.0G
-rw-r--r-- 1 redisinsight redisinsight 975M Dec 17 09:56 2a974363-c6f6-4d86-9333-68a5d83f46a2.rsnap
-rw-r--r-- 1 redisinsight redisinsight 647M Dec 17 09:52 2a974363-c6f6-4d86-9333-68a5d83f46a21702806698_0.rdb
-rw-r--r-- 1 redisinsight redisinsight 568M Dec 17 09:52 2a974363-c6f6-4d86-9333-68a5d83f46a21702806733_1.rdb
-rw-r--r-- 1 redisinsight redisinsight 579M Dec 17 09:53 2a974363-c6f6-4d86-9333-68a5d83f46a21702806764_2.rdb
-rw-r--r-- 1 redisinsight redisinsight 582M Dec 17 09:53 2a974363-c6f6-4d86-9333-68a5d83f46a21702806794_3.rdb
-rw-r--r-- 1 redisinsight redisinsight 583M Dec 17 09:54 2a974363-c6f6-4d86-9333-68a5d83f46a21702806827_4.rdb
-rw-r--r-- 1 redisinsight redisinsight 819M Dec 16 15:10 f784974f-a2e9-4dec-a74c-2b309d733efe.rsnap

執行完畢後

redisinsight@redisinsight-cf7f6847b-s2zgg:/db/rsnaps$ ls -lh
total 1.8G
-rw-r--r-- 1 redisinsight redisinsight 975M Dec 17 09:56 2a974363-c6f6-4d86-9333-68a5d83f46a2.rsnap
-rw-r--r-- 1 redisinsight redisinsight 819M Dec 16 15:10 f784974f-a2e9-4dec-a74c-2b309d733efe.rsnap

用RedisInsight BULK ACTIONS復原數據的效果

以下是將RBD檔案複製到REDIS目錄,一台一台REDIS服務重啟,慢慢導入RBD數據的效果

看起來效果是一樣,但是使用RedisInsight BULK ACTIONS,有幾個好處:

  1. Redis服務不用重啟,線上恢復數據
  2. Redis slot不會有異常分配狀況,還要使用–cluster fix的狀況發生

測試數據,是否正確,結果->有些數據Key Name被修改了

來查查看數據,是不是跟之前使用重啟Redis服務恢復數據時,得到的一樣

以下是使用重啟Redis服務恢復數據時,查到的key和value

[root@redis01 redis]# redis-cli --user 帳號 --pass 密碼 -c

# 查看key type,此key剛好就在redis01主機上,所以執行直接顯示type
127.0.0.1:6379> type spring:session:index:org.springframework.session.FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME:362C74F290B63E5F751DCF1E49EC34BEAF6822F0
set


# 查看key type,此key在redis02主機上,會Redirected到此key所在slot主機上,再顯示type
127.0.0.1:6379> type DRM01001000347201
-> Redirected to slot [5914] located at 192.168.1.12:6379
hash


# 查看key type,此key在redis03主機上,會Redirected到此key所在slot主機上,再顯示type
192.168.1.12:6379> type spring:session:index:org.springframework.session.FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME:EBB87CF1F764E6BACCC709323FE1457065B0CC8E
-> Redirected to slot [10759] located at 192.168.1.13:6379
set
192.168.1.13:6379> SMEMBERS spring:session:index:org.springframework.session.FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME:EBB87CF1F764E6BACCC709323FE1457065B0CC8E

1) "\xac\xed\x00\x05t\x00$aef3b17d-ed6f-4c4e-9cc3-ef69eda6f33c"


# 查看key type,此key在redis04主機上,會Redirected到此key所在slot主機上,再顯示type
192.168.1.13:6379> type TON01001010231201
-> Redirected to slot [12921] located at 192.168.1.14:6379
hash
192.168.1.14:6379> hgetall TON01001010231201
1) "path"
2) "/reader/book_content_unpack/teb/2022/10/17/TON01001010231201/TON01001010231201"
3) "iv"
4) "06ac4696c8a4bb94ecb7e82b38a1dc3f"
5) "key"
6) "36971e857d647324cb59e1cdf58d7071"


# 查看key type,此key在redis05主機上,會Redirected到此key所在slot主機上,再顯示type
192.168.1.14:6379> type spring:session:index:org.springframework.session.FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME:25E30A2AB63FE661B9AE7803EAD9A9AC234097FC
-> Redirected to slot [16326] located at 192.168.1.18:6379
set
192.168.1.18:6379> SMEMBERS spring:session:index:org.springframework.session.FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME:25E30A2AB63FE661B9AE7803EAD9A9AC234097FC

1) "\xac\xed\x00\x05t\x00$f0d82ce3-28e3-493c-b992-439565cf987e"


# 查看key type,此key在redis02主機上,會Redirected到此key所在slot主機上,再顯示type
192.168.1.18:6379> type BOOK_CASE_LIST_U_39048951
-> Redirected to slot [5895] located at 192.168.1.12:6379
hash
192.168.1.12:6379> hgetall BOOK_CASE_LIST_U_39048951
1) "0_5"
2) "{\"result\":\"00\",\"syncTime\":\"20231202164546\",\"ebooks\":[{\"deliverId\":\"SON03001000560201\",\"contentId\":\"SON03001000560\",\"title\":\"\xe6\x8a\x95\xe8\xb3\x875\xe5\xb9\xb4\xef\xbc\x8c\xe6\x9c\xac\xe9\x87\x91\xe5\xbe\x9e4\xe8\x90\xac\xe5\x88\xb01\xe5\x84\x84\xe7\x9a\x84\xe5\xa5\xb3\xe4\xba\xba\xef\xbc\x9a\xe5\xbe\x9e\xe7\x9c\x81\xe9\x8c\xa2\xe3\x80\x81\xe5\xae\x9a\xe5\xad\x98\xe5\x88\xb0\xe8\x82\xa1\xe7\xa5\xa8\xef\xbc\x8c\xe5\xb0\x88\xe5\xb1\xac\xe5\xb0\x8f\xe8\xb3\x87\xe5\xa5\xb3\xe7\x9a\x84\xe8\xb3\xaa\xe6\x84\x9f\xe7\x90\x86\xe8\xb2\xa1\xe6\x8f\x90\xe6\xa1\x88\",\"publisher\":\"\xe5\xb4\xa7\xe7\x87\x81\xe6\x96\x87\xe5\x8c\x96\",\"author\":\"\xe6\xb7\x98\xe6\xb7\x98\",\"bodyTypeCode\":\"201\",\"ebookType\":\"\xe6\x9b\xb8\xe7\xb1\x8d\",\"categories\":[\"\xe9\x87\x91\xe8\x9e\x8d\xe7\x90\x86\xe8\xb2\xa1\"],

注意:可以看到,有些數據找不到了

[root@redis91 redis]# redis-cli --user 帳號 --pass 密碼 -c
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.

# 此數據找不到了
127.0.0.1:6379> type spring:session:index:org.springframework.session.FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME:362C74F290B63E5F751DCF1E49EC34BEAF6822F0
none


127.0.0.1:6379> type DRM01001000347201
-> Redirected to slot [5914] located at 192.168.1.92:6379
hash


# 此數據找不到了
192.168.1.92:6379> type spring:session:index:org.springframework.session.FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME:EBB87CF1F764E6BACCC709323FE1457065B0CC8E
-> Redirected to slot [10759] located at 192.168.1.94:6379
none


192.168.1.94:6379> type TON01001010231201
hash
192.168.1.94:6379> hgetall TON01001010231201
1) "path"
2) "/reader/book_content_unpack/teb/2022/10/17/TON01001010231201/TON01001010231201"
3) "key"
4) "36971e857d647324cb59e1cdf58d7071"
5) "iv"
6) "06ac4696c8a4bb94ecb7e82b38a1dc3f"


# 此數據找不到了
192.168.1.94:6379> type spring:session:index:org.springframework.session.FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME:25E30A2AB63FE661B9AE7803EAD9A9AC234097FC
-> Redirected to slot [16326] located at 192.168.1.98:6379
none


192.168.1.98:6379> type BOOK_CASE_LIST_U_39048951
-> Redirected to slot [5895] located at 192.168.1.92:6379
hash
192.168.1.92:6379> hgetall BOOK_CASE_LIST_U_39048951
1) "0_5"
2) "{\"result\":\"00\",\"syncTime\":\"20231202164546\",\"ebooks\":[{\"deliverId\":\"SON03001000560201\",\"contentId\":\"SON03001000560\",\"title\":\"\xe6\x8a\x95\xe8\xb3\x875\xe5\xb9\xb4\xef\xbc\x8c\xe6\x9c\xac\xe9\x87\x91\xe5\xbe\x9e4\xe8\x90\xac\xe5\x88\xb01\xe5\x84\x84\xe7\x9a\x84\xe5\xa5\xb3\xe4\xba\xba\xef\xbc\x9a\xe5\xbe\x9e\xe7\x9c\x81\xe9\x8c\xa2\xe3\x80\x81\xe5\xae\x9a\xe5\xad\x98\xe5\x88\xb0\xe8\x82\xa1\xe7\xa5\xa8\xef\xbc\x8c\xe5\xb0\x88\xe5\xb1\xac\xe5\xb0\x8f\xe8\xb3\x87\xe5\xa5\xb3\xe7\x9a\x84\xe8\xb3\xaa\xe6\x84\x9f\xe7\x90\x86\xe8\xb2\xa1\xe6\x8f\x90\xe6\xa1\x88\",\"publisher\":\"\xe5\xb4\xa7\xe7\x87\x81\xe6\x96\x87\xe5\x8c\x96\",\"author\":\"\xe6\xb7\x98\xe6\xb7\x98\",\"bodyTypeCode\":\"201\",\"ebookType\":\"\xe6\x9b\xb8\xe7\xb1\x8d\",\"categories\":[\"\xe9

可以看到,數據樣式變了,此恢復數據方式會有問題,不可用

# 原數據
spring:session:index:org.springframework.session.FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME:362C74F290B63E5F751DCF1E49EC34BEAF6822F0

# 用RedisInsight BULK ACTIONS恢復後的數據樣式變這樣
\x19spring:session:index:org.s`\x18\tframework.\xa0!\x01.F \"\x02ByI@'\x00N \x1b\x00S\x808\x1eRepository.PRINCIPAL_NAME_INDEX`\n\x1f:8E09B7E74AAA48FF8481847092A40E8\bA0FBB829A
comments powered by Disqus
使用 Hugo 建立
主題 StackJimmy 設計
發表了128篇文章 · 總計63.96k字
本站已運行
·