Project Deployment Options

Project deployment options determine how your project is deployed in a cluster and how it functions at runtime. These parameters, including project options, active-active instances, failover intervals, and project deployment type options, are set in the CCR file manually or within Studio.

Project Options

Project options are available on the Advanced tab of the Project Configuration editor. Project options are used as runtime parameters for the project, and include a predefined list of available option names that reflect most command line entries. Each project option also has a value field that can be filled by the user. You can implement an option only once, after which it is no longer available in the drop-down list.

This table outlines all available project options that can be set using the Project Configuration view in ESP Studio:
Project Option Description
on-error-discard-record If set to true, the record being computed is discarded when a computation failure occurs. If set to false, any uncomputed columns are null-padded and record processing continues. The default value is true.
Note: If the computation of a key column fails, the record will be discarded regardless of this option.
on-error-log If set to true, any computation errors that occur will be logged in the error message. The default value is true.
java-classpath Set the java classpath. Value is a filepath to the classpath file.
java-max-heap Set the max java heap for the project. Default value is 256 megabytes.
utf8 Enable UTF-8 functionality on the server. Default value is false, set to true to enable.
precision Set decimal display characteristics for number characters in the project. Default value is 6.
command-port Set the command port number. This advanced option should not generally be set. If the port is 0, or out of range 1-65535, the program selects an arbitrary port. To define a specific port, set a value between 1 and 65535.
sql-port Set the SQL port number. This advanced option should not generally be set. If the port is 0, or out of range 1-65535, the program selects an arbitrary port. To define a specific port, set a value between 1 and 65535.
gateway-port Set the gateway port number. This advanced option should not generally be set. If the port is 0, or out of range 1-65535, the program selects an arbitrary port. To define a specific port, set a value between 1 and 65535.
time-granularity Define time granularity within the project. This option specifies, in seconds, how often the set of performance records—one per stream and one per gateway connection—is obtained from the running Event Stream Processor. By default, time granularity is set to 5. Set this option to 0 to disable monitoring; this also optimizes performance.
debug-level Set a logging level for debugging the project, ranging from 0-7. Where each number represents the following:
  • 0: LOG_EMERG - system is unusable
  • 1: LOG_ALERT - action must be taken immediately
  • 2: LOG_CRIT - critical conditions
  • 3: LOG_ERR - error conditions
  • 4: LOG_WARNING - warning conditions
  • 5: LOG_NORMAL - normal but significant conditions
  • 6: LOG_INFO - informational
  • 7: LOG_DEBUG - debug level messages
Note: When changing settings, stop and remove the project from the Server, then redeploy the project.
bad-record-file To save bad records to a file, select the bad-record-file option for Project Type, and indicate the file name of an ESP project for Value Field. If a file name is not specified, bad records are discarded.
memory Set memory usage limits for the project. Default is 0, meaning unlimited.
optimize Suppresses redundant store updates. Default value is false, set to true to enable.
ignore-config-topology Enable this to ignore topology between projects. Default is false, set to true to enable.
time-interval Set the constant interval expression that specifies the maximum age of rows in a window. By default, in seconds, set to 0, meaning no timer.

Active-Active Deployments

Active-active deployments are available only when you define the project as an ha-project in the CCR file. An active-active deployment means that two instances of a project run simultaneously in a cluster. The two instances of the project are started by the cluster manager on two different hosts.

One instance of the project is elected as the primary instance. If one of the instances is already active, it is the primary instance. If the failed instance restarts, it assumes the secondary position and maintains this position unless the current instance fails or is stopped.

When the secondary project server starts and does not find the primary project server, it reattempts a connection to the primary server for 30 seconds. If it fails to successfully connect to the existing primary server, it takes the responsibility of primary server.

Users add active-active configurations by defining a high-availability type and adding an additional affinity parameter. Users can define an active-active configuration through the CCR Project Deployment editor.

This is an example of a CCR file configured for active-active deployment.
<Deployment>
  <Project ha="true">
   <Options>  
    <Option name="debug-level">1</Option>
   </Options>
   <Instances>
    <Instance name="primary">
     <Affinities>
      <!-- By default no need to put affinity.  -->
      <Affinity type="controller" charge="positive" strength="strong" value="node1"/> 
      <Affinity type="instance" charge="negative" strength="strong" value="secondary"/>
     </Affinities>
    </Instance>
    <Instance name="secondary">
     <Affinities>
      <!-- By default no need to put affinity.  -->
      <Affinity type="controller" charge="positive" strength="weak" value="node2"/> 
      <Affinity type="instance" charge="negative" strength="strong" value="primary"/>
     </Affinities>
     <Failover enable="true">
      <FailureInterval>120<FailureInterval> // numbers in sec
      <FailuresPerInterval>4<FailuresPerInterval> // counter
     </Failover>
    </Instance>
   </Instances>
  </Project> 
 </Deployment>

Instances

The number of instances available depends on the deployment type chosen by the user, either high availability (HA) or Non-HA. When a project is configured in HA (active-active) mode, two instances are created: primary and secondary. You can set affinity and cold failover options for each instance, including failover intervals and failure per interval options.

Affinities

Affinities limit where a project runs or does not run in a cluster. There are two types of affinities:
  • Controller – Used for Active-Active and non Active-Active configurations. You can have more than one affinity for each controller, but there can only be one strong positive controller affinity.
  • Instance – Used only for Active-Active configuration, an instance creates two affinities that can apply to each separate project server.
These parameters must be defined for each affinity:
Field Description
Name Enter the name of the object of the affinity, that is, the controller name or instance name that the affinity is set for. For instance affinities, the affinity for one instance should refer to the second instance.
Strength Specify Strong or weak. Strong requires the project to run on a specific controller, and no others. If weak, the project preferentially starts on the defined controller, but if that controller is unavailable, it may start on another available controller.
Charge Specify Positive or negative. If positive, the project runs on the controller. If negative, the project does not run on the controller.

Failover

A project fails when it does not run properly or stops running properly. A failover occurs when a failed project or server switches to another server to continue processing. Failovers may result in a project restart, if defined. Restarts can be limited based on definition of failure intervals and restarts per interval. Failover options, accessed using an instance configuration, include:

Field Description
Failover Either enabled or disabled. When disabled, project failover restarts are not permitted. When enabled, failure interval and failures per interval fields can be accessed and restarts are permitted.
Failures per interval Specifies the number of restarts the project can attempt within a given interval. This count can be reset to zero by a manual start of the project or if failures are dropped from the list because they are older than the size of the interval.
Failure interval (Optional) This specifies the time, in seconds, that make up an interval. If left blank, the interval time is infinite.
Related concepts
High Availability