我们使用 memcached-tool 命令来导出数据:

[root@localhost ~]# memcached-tool 127.0.0.1:11211 dump > /tmp/1.txt
Dumping memcache contents
  Number of buckets: 1
  Number of items  : 2
Dumping bucket 1 - 2 total items
[root@localhost ~]# cat /tmp/1.txt   //导出的数据是带有时间戳的,这个时间戳就是该条数据的过期时间
add name 0 1551489491 3              //如果当前系统时间超过了时间戳,那么是导入不进去的
Tom
add age 0 1551489491 2
18

使用 nc 命令来导入数据:

[root@localhost ~]# yum install -y nc
[root@localhost ~]# nc 127.0.0.1 11211 < /tmp/1.txt    //如果要导入的机器中有了这些数据,则返回NOT_STORED
STORED
STORED

 

 

 

 

 

 

 

 

 

 

    

 

相关文章:

  • 2021-09-14
  • 2021-12-30
  • 2022-01-18
  • 2021-10-22
  • 2021-07-31
  • 2022-12-23
  • 2021-07-13
猜你喜欢
  • 2022-12-23
  • 2021-11-20
  • 2021-12-13
  • 2021-11-11
  • 2021-09-02
  • 2021-10-12
相关资源
相似解决方案