如何使用Apache负载平衡Marklogic Cluster [英] How Can I use Apache to load balance Marklogic Cluster

查看:85
本文介绍了如何使用Apache负载平衡Marklogic Cluster的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Marklogic和Apache的新手.已为我提供了将apache用作我们的3台机器的Marklogic集群的负载平衡器的任务. Marklogic集群当前正在Linux服务器上运行.

Hi I am new to Marklogic and Apache. I have been provided task to use apache as loadbalancer for our Marklogic cluster of 3 machines. Marklogic cluster is currently running on Linux servers.

我们如何实现这一目标?有关此的任何信息都将有所帮助.

How can we achieve this? Any information regarding this would be helpful.

推荐答案

您可以使用 mod_proxy_balancer .如何配置它取决于您要使用哪种MarkLogic客户端.如果您想使用 Java客户端API ,请按照第二个示例"SessionID" cookie .

You could use mod_proxy_balancer. How you configure it depends what MarkLogic client you would like to use. If you would like to use the Java Client API, please follow the second example here to allow apache to generate stickiness cookies. If you would like to use XCC, please configure it to use the ML-Server-generated or backend-generated "SessionID" cookie.

这里的区别是XCC使用会话,而Java Client API建立在无状态的REST API上,因此没有会​​话.但是,即使在使用多请求事务的Java Client API中,这也会在该事务的持续时间内强加状态,因此负载均衡器需要一种在事务期间将请求路由到MarkLogic集群中正确节点的方法. Java客户端API将对使用事务的每个请求重新发送粘性cookie,以便负载均衡器可以保持与该事务相关的请求的粘性.

The difference here is that XCC uses sessions whereas the Java Client API builds on the REST API which is stateless, so there are no sessions. However, even in the Java Client API when you use multi-request transactions, that imposes state for the duration of that transaction so the load balancer needs a way to route requests during that transaction to the correct node in the MarkLogic cluster. The stickiness cookie will be resent by the Java Client API with every request that uses a Transaction so the load balancer can maintain that stickiness for requests related to that transaction.

与往常一样,对您的配置进行一些测试以确保您设置正确.正确配置apache插件是一项高级技能.由于您是新手,因此确保使用正确的最大希望是使用WireShark这样的HTTP监视工具进行检查,以查看从应用程序到MarkLogic Server的HTTP流量,以确保一切顺利到达集群中的正确节点.如预期的那样.

As always, do some testing of your configuration to make sure you got it right. Properly configuring apache plugins is an advanced skill. Since you are new to apache, your best hope of ensuring you got it right is checking with an HTTP monitoring tool like WireShark to look at the HTTP traffic from your application to MarkLogic Server to make sure things are going to the correct node in the cluster as expected.

这篇关于如何使用Apache负载平衡Marklogic Cluster的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆