[英]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: 我尝试了两种方法:
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. java.util.concurrent.CancellationException: Cancelled
了,文档很糟糕所以我找到了任何有用的东西。 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.