英文:
Communication between groupcache's peers
问题
这些groupcache的对等节点是如何相互通信的?通过HTTP吗?
我在互联网上看到的示例使用HTTPPool来创建一组对等节点。因此,如果我想运行多个服务器来提供缓存服务,我必须使用HTTPPool吗?
是否有其他方法来创建一组对等节点,并使它们相互通信?
我可以正确设置单个groupcache,但是我对如何通过对等节点实现可扩展性感到困惑。
我不确定我对HTTPPool和对等节点的理解是否正确:
> 创建一个新的HTTPPool并将对等节点添加到其中。
> 然后groupcache将决定向哪个对等节点请求数据?
谢谢!
英文:
How do those groupcache's peers communicate with each others? Through http?
I saw the example on the internets use HTTPPool to create a group of peers. Therefore, if I want to run up multiple server to serve the cache, must I use HTTPPool?
Is there any other way to create a group of peers, and enable them to communicate with each other?
I can correctly setup a single groupcache, but I'm confused about how to make it scalable through peers.
I'm not sure whether my understanding about HTTPPool and peers is right or not:
> Create a new HTTPPool and add peers into it.
> Then groupcache will decide which peer should it ask for data?
Thanks!
答案1
得分: 3
请看这个源文件。
> groupcache的对等体是如何相互通信的?通过HTTP吗?
是的。
> 我必须使用HTTPPool吗?
是的。
> 是否有其他方法可以创建一组对等体,并使它们相互通信?
在你引用的实现中没有其他方法。不过,你可以fork它,并改变传输机制。
> 我不确定我对HTTPPool和对等体的理解是否正确
使用…
pool := groupcache.NewHTTPPool("http://localhost:8080") // 本地地址
…创建一个新的池。然后通过…
pool.Set("http://example.net:8000", "http://another.net:8000") // 远程对等体地址
英文:
See this source file.
> How do those groupcache's peers communicate with each others? Through http?
Yes.
> must I use HTTPPool?
Yes.
> Is there any other way to create a group of peers, and enable them to communicate with each other?
Not with the implementation you referenced. You could fork it, though, and change the transport mechanism.
> I'm not sure whether my understanding about HTTPPool and peers is right or not
Use…
pool := groupcache.NewHTTPPool("http://localhost:8080") // Local address
…to create a new pool. Then add peers to it through…
pool.Set("http://example.net:8000", "http://another.net:8000") // Remote peer addresses
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论