Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The above diagram represents a deployment where you are not limited to two nodes. You can scale the event processing horizontally by adding more  Stream Processor Worker nodes to the deployment. In this deployment, it is recommended to configure the client appl application to publish events to multiple SP worker nodes in a Round Robin manner to ensure better fault tolerance. The publishing of events can be carried out by one or more clients.

...

  1. For each node, enter a unique ID for the id property under the wso2.carbon section. This is used to identify each node within a cluster. For example, you can add IDs as shown below.
    • For node 1:

      Code Block
      languagexml
      wso2.carbon:
        id: wso2-sp-1
    • For node 2:

      Code Block
      languagexml
      wso2.carbon:
        id: wso2-sp-2
  2. Enable partitioning aggregations for each node, and assign a unique shard ID for each node. To do this, set the partitionById and shardId parameters as Siddhi properties as shown below. 

    Info

    Assigning shard IDs to nodes allows the system to identify each unique node when assigning parts of the aggregation. If the shard IDs are not assigned, system uses the unique node IDs (defined in step 1) for this purpose.

    • For node 1:

      Code Block
      languagexml
      siddhi:
        properties:
          partitionById: true
          shardId: wso2-sp-1
    • For node 2:

      Code Block
      languagexml
      siddhi:
        properties:
          partitionById: true
          shardId: wso2-sp-2
      Tip
      • To maintain data consistency, do not change the shard IDs after the first configuration
      • When you enable the aggregation partitioning feature, a new column ID named SHARD_ID is introduced to the aggregation tables. Therefore, you need to do one of the following options after enabling this feature to avoid errors occuring due to the differences in the table schema.
        • Delete all the aggregation tables for SECONDSMINUTESHOURSDAYSMONTHSYEARS
        • Edit the aggregation tables by adding a new column named SHARD_ID, and specify it as a add that to the existing primary key list of the table.
  3. Configure a database, and then update the default configuration for the TEST_DB data source with parameter values suitable for your requirements

...