当前位置:   article > 正文

Redis数据windows版本迁移到Linux_redis数据导入导出 windows导入到linux

redis数据导入导出 windows导入到linux

实测成功

版本信息

源redis
windows版本: Windows Server 2008 R2 Enterprise
redis版本:Redis-x64-3.2.100
  • 1
  • 2
  • 3
目标redis
Linux版本:centos7
[root@VM-16-4-centos src]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
[root@VM-16-4-centos src]# cat /proc/version
Linux version 3.10.0-1160.31.1.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Thu Jun 10 13:32:12 UTC 2021
redis版本:redis-6.2.6.tar.gz
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

redis停止时直接把dump.rdb文件复制过去后再启动就可以
迁移后第一次启用: 有一句 Loading RDB produced by version 3.2.100

[root@VM-16-4-centos src]# ./redis-server /usr/local/redis/redis.conf &
[2] 15721
[root@VM-16-4-centos src]# 15721:C 09 Nov 2022 09:42:52.986 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
15721:C 09 Nov 2022 09:42:52.986 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=15721, just started
15721:C 09 Nov 2022 09:42:52.986 # Configuration loaded
15721:M 09 Nov 2022 09:42:52.986 * monotonic clock: POSIX clock_gettime
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 6.2.6 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                  
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 15721
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           https://redis.io       
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

15721:M 09 Nov 2022 09:42:52.987 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
15721:M 09 Nov 2022 09:42:52.987 # Server initialized
15721:M 09 Nov 2022 09:42:52.987 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
15721:M 09 Nov 2022 09:42:52.987 * Loading RDB produced by version 3.2.100
15721:M 09 Nov 2022 09:42:52.987 * RDB age 52745 seconds
15721:M 09 Nov 2022 09:42:52.987 * RDB memory usage when created 0.00 Mb
15721:M 09 Nov 2022 09:42:53.149 # Done loading RDB, keys loaded: 49113, keys expired: 21.
15721:M 09 Nov 2022 09:42:53.149 * DB loaded from disk: 0.161 seconds
15721:M 09 Nov 2022 09:42:53.149 * Ready to accept connections

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34

第二次启用后变为: Loading RDB produced by version 6.2.6

[root@VM-16-4-centos src]# ./redis-server /usr/local/redis/redis.conf &
[2] 7165
[root@VM-16-4-centos src]# 7165:C 09 Nov 2022 10:03:05.382 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
7165:C 09 Nov 2022 10:03:05.382 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=7165, just started
7165:C 09 Nov 2022 10:03:05.382 # Configuration loaded
7165:M 09 Nov 2022 10:03:05.383 * monotonic clock: POSIX clock_gettime
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 6.2.6 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                  
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 7165
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           https://redis.io       
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

7165:M 09 Nov 2022 10:03:05.383 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
7165:M 09 Nov 2022 10:03:05.383 # Server initialized
7165:M 09 Nov 2022 10:03:05.383 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
7165:M 09 Nov 2022 10:03:05.383 * Loading RDB produced by version 6.2.6
7165:M 09 Nov 2022 10:03:05.383 * RDB age 10 seconds
7165:M 09 Nov 2022 10:03:05.383 * RDB memory usage when created 65.52 Mb
7165:M 09 Nov 2022 10:03:05.544 # Done loading RDB, keys loaded: 49112, keys expired: 0.
7165:M 09 Nov 2022 10:03:05.544 * DB loaded from disk: 0.161 seconds
7165:M 09 Nov 2022 10:03:05.544 * Ready to accept connections

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34

注意:这个项目好像只用了最简单的String数据类型,其他的数据类型好像没有用到,有用到其他的数据类型的话,只能酌情尝试下了

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/752259
推荐阅读
相关标签
  

闽ICP备14008679号