首页 > 系统服务 > 详细

Memcached 数据导出与导入

时间:2019-03-02 12:17:14      阅读:223      评论:0      收藏:0      [点我收藏+]

我们使用 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

 

 

 

 

 

 

 

 

 

 

    

 

Memcached 数据导出与导入

原文:https://www.cnblogs.com/pzk7788/p/10460360.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!