简体   繁体   English

关于kubernetes的Memcache

[英]Memcache on kubernetes

I have a spring boot api running on google cloud kubernetes cluster , I wanna have a caching server to use for my api so I thought to use memcache . 我有一个在google cloud kubernetes cluster上运行的spring boot api,我想有一个缓存服务器用于我的api所以我想使用memcache

I tried two ways of doing it: 我尝试了两种方法:

  1. I downloaded the memcache from the google launcher which is basically deploying an instance of memcache on a vm. 我从谷歌启动器下载了memcache ,它基本上是在memcache上部署了一个memcache实例。 And then I assigned an external IP to my vm, whitelisted my ip to try it locally and ofc opened the port 11211 (the default one). 然后我为我的虚拟机分配了一个外部IP将我的IP列入白名单以在本地尝试,并且打开端口11211 (默认端口)。 For the client side I used, this guy , specified the ip address but I still get connection cancelled : java.util.concurrent.CancellationException: Cancelled and the doc is bad so I could find anything that helps. 对于我使用的客户端, 这个人 ,指定了ip地址,但我仍然取消了连接: java.util.concurrent.CancellationException: Cancelled了,文档很糟糕所以我找到了任何有用的东西。
  2. I decided to try another way, which is following this tutorial and now I have the memcached cluster but I don't know how to consume these pods from my other cluster or should the pods be on the same cluster i have the api running on? 我决定尝试另一种方式,这是遵循本教程 ,现在我有memcached群集,但我不知道如何从我的其他群集中使用这些pod或者如果pod在同一群集上我运行了api?

I would appreciate any help, this is my first encounter with the global caching. 我很感激任何帮助,这是我第一次遇到全局缓存。

So I figured it out based on Jonah Benton's advice. 所以我根据Jonah Benton的建议弄明白了。

It was actually pretty simple, i used this tutorial to create a new pod running memcached in my cluster and then I used this client to connect on it and it worked like a charm! 它实际上非常简单,我使用本教程创建一个在我的集群中运行memcached的新pod,然后我使用这个客户端连接它,它就像一个魅力!

Hope it helps someone. 希望它可以帮助某人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM