1

How WSO2 CEP or BAM can be load balanced ? What configuration changes required to make it in clustered mode (active-active).

How publisher can send events over Thrift to this clustered server, please provide example.

Community
  • 1
  • 1
Madhup Srivastava
  • 446
  • 1
  • 6
  • 18

1 Answers1

0

BAM or CEP can be simply load balanced by changing the Connection URL string.

In single server mode (without load balancing) the Connection URL is as follows;

tcp://10.100.3.97:7611

When load balancing is required you need to connect to multiple BAM/CEP servers. Note that this load balancing is done at the client side of Data Agent, in Round Robin manner, as WSO2 Load Balancer is not supported with Thrift protocol.

If you need to connect to multiple BAM/CEP servers with load balancing as mentioned above, you can enter the comma separated connection URLs of each server as follows.

tcp://10.200.3.218:7611, tcp://10.100.3.97:7611, tcp://10.300.3.197:7611

Each message received from the Data Agent client will be directed to each URL in Round Robin manner which will cause the load balancing.

Now let's consider a case where you want to send the same message to both BAM and CEP servers simultaneously. URLs related to BAM and CEP servers (where there are 2 BAM servers and 3 CEP servers) can be given as follows to load balance messages.

{tcp://10.200.3.218:7611, tcp://10.100.3.97:7611, tcp://10.300.3.197:7611}, {tcp://10.400.3.297:7611, tcp://10.500.3.597:7611}

Note that three URLs in the first braces are related to 3 CEP servers and other 2 to the 2 BAM servers.

After you enter the corresponding Connection URLs to configure data agents as mentioned above, you can publish as usual. Messages will be switched to each server in Round Robin manner automatically.

Maninda
  • 2,086
  • 3
  • 15
  • 29
  • For CEP clustering scenario. Will the CEP query be able to aggregate results over the cluster ? E.G. If we have a CEP query looking at count of certain data field in past X mins. In case of cluster the incoming data will be distributed over the cluster, now will the CEP query agregate the count of data field over the entire cluster or report the count only for the instance its running on ? In case of later how can we arrive at aggregation of query results over the cluster. – Madhup Srivastava Jan 22 '13 at 05:46