美文网首页
springboot集成memcached

springboot集成memcached

作者: 奋斗_登 | 来源:发表于2021-05-16 10:34 被阅读0次
  1. memecached简介
            Memcached是LiveJournal旗下Danga Interactive公司的布拉德·菲茨帕特里克(Brad Fitzpatric)开发的一款软件,Memcached可以轻松应对大量同时出现的数据请求,而且它拥有独特的网络结构,在工作机制方面,它还可以在内存中单独开辟新的空间,建立HashTable,并对HashTable进行有效的管理。
            memecached特点:
    协议简单、基于libevent的事件处理、内置内存存储方式、不互相通信的分布式。

  2. memcached在linux下安装

#下载最新版本
wget https://memcached.org/files/memcached-1.6.9.tar.gz
tar -zxvf memcached-1.6.9.tar.gz 
cd  memcached-1.6.9
yum -y install libevent
yum install libevent-devel
./configure --prefix=/usr/local/memcached
 make && make install
#启动
/usr/local/memcached/bin/memcached -d -m 64M -u root -p 11211 -c 256 -P /tmp/memcached.pid
  1. memcached与springboot的集成
    参考地址:http://www.ityouknow.com/springboot/2018/09/01/spring-boot-memcached.html
    源代码参考:
    https://github.com/ityouknow/spring-boot-examples
    添加依赖:
<dependency>
    <groupId>net.spy</groupId>
    <artifactId>spymemcached</artifactId>
    <version>2.12.3</version>
</dependency>

相关文章

网友评论

      本文标题:springboot集成memcached

      本文链接:https://www.haomeiwen.com/subject/bqmljltx.html