Aerospike Client

The Aerospike Client destination writes data to Aerospike. For information about supported versions, see Supported Systems and Versions.

The Aerospike Client destination connects to an Aerospike node and then discovers other nodes in the same cluster. The destination writes records to a namespace and optionally in a set. The destination can write any record or only records that have a particular generation or revision value, such as new records or records that have been revised. The destination can require confirmation from all nodes in the cluster or only the master node. When the destination cannot write a record, the destination adds attributes to the record header and sends the record for error processing.

When you configure the Aerospike Client destination, you define connection information and select the authentication mode that the destination uses for server access. In addition, you can enable the destination to use TLS. You can also use a connection to configure the destination.

You configure the information used to write the data, such as the namespace and set to write to, and whether to merge or append data from map or list fields. You can also set advanced Aerospike configurations, such as the commit level requested from Aerospike, whether to prevent deleted records from reappearing after node failures, and the time to live for each record.

Enabling SSL/TLS

You can enable the Aerospike Client destination and the Aerospike connection to use SSL/TLS to connect to Aerospike.
Important: When using the external authentication mode, you must enable the destination to use SSL/TLS.
  1. On the Aerospike tab for the destination, select the Use TLS property.
  2. For each node defined, specify the certificate name in Cluster TLS Name.
  3. If the Aerospike certificate is signed by a private CA or not trusted by the default Java truststore, create a custom truststore file or modify a copy of the default Java truststore file to add the CA to the file. Then configure Data Collector to use the modified truststore file.
    1. Use the following command to set the JAVA_HOME environment variable:
      export JAVA_HOME=<Java home directory>
    2. Use the following command to set the SDC_CONF environment variable:
      export SDC_CONF=<Data Collector configuration directory>
      For example:
      export SDC_CONF=/streamsets-datacollector-5.6.0/etc
    3. Use the following command to copy the default Java truststore file to the Data Collector configuration directory:
      cp "${JAVA_HOME}/jre/lib/security/cacerts" "${SDC_CONF}/truststore.jks"
    4. Use the following keytool command to import the CA certificate into the truststore file:
      keytool -import -file <certificate> -trustcacerts -noprompt -alias <alias> -storepass <password> -keystore "${SDC_CONF}/truststore.jks"
    5. In Control Hub, edit the deployment. In the Configure Engine section, click Advanced Configuration. Then, click Java Configuration. Define the following options in the Java Options property:
      • javax.net.ssl.trustStore - Path to the truststore file on the Data Collector machine.
      • javax.net.ssl.trustStorePassword - Truststore password.
      For example, define the options as follows:
      -Djavax.net.ssl.trustStore=/streamsets-datacollector-5.6.0/etc/truststore.jks -Djavax.net.ssl.trustStorePassword=mypassword
    6. Save the changes to the deployment and restart all engine instances.

Aerospike Data Types

The Aerospike Client destination converts Data Collector data types into Aerospike data types before writing data to Aerospike.

The destination converts the following Data Collector data types into these Aerospike data types:
Data Collector Data Type Aerospike Data Type
Boolean Boolean
Byte Integer
Byte_Array Blob/Bytes
Char Integer - Aerospike stores the ASCII value of the character.
Date String
Datetime String
Decimal Double
Double Double
Float Double
Integer Integer
List List
List_Map Map
Long Integer
Short Integer
String String
Time String
Zoned_Datetime String

Error Record Header Attributes

The Aerospike Client destination sends records that cannot be written to the error stream. The destination adds the following record header attributes, which you can consult to determine the cause of the error:
Error Record Header Attribute Description
aerospike-error-result-code Code associated with the error. For a list of the codes, see the Aerospike documentation.
aerospike-error-detail Short description of the error.

Configuring an Aerospike Client Destination

Configure an Aerospike Client destination to write data to Aerospike.

  1. In the Properties panel, on the General tab, configure the following properties:
    General Property Description
    Name Stage name.
    Description Optional description.
    Connection Connection that defines the information required to connect to an external system.

    To connect to an external system, you can select a connection that contains the details, or you can directly enter the details in the pipeline. When you select a connection, Control Hub hides other properties so that you cannot directly enter connection details in the pipeline.

    To create a new connection, click the Add New Connection icon: . To view and edit the details of the selected connection, click the Edit Connection icon: .

    Required Fields Fields that must include data for the record to be passed into the stage.
    Tip: You might include fields that the stage uses.

    Records that do not include all required fields are processed based on the error handling configured for the pipeline.

    Preconditions Conditions that must evaluate to TRUE to allow a record to enter the stage for processing. Click Add to create additional preconditions.

    Records that do not meet all preconditions are processed based on the error handling configured for the stage.

    On Record Error
    Error record handling for the stage:
    • Discard - Discards the record.
    • Send to Error - Sends the record to the pipeline for error handling.
    • Stop Pipeline - Stops the pipeline.
  2. On the Aerospike tab, configure the following properties:
    Aerospike Property Description
    Nodes Aerospike node to connect to. You can specify multiple nodes. The stage iterates through the nodes until it successfully connects to one, and then discovers all the nodes in the same cluster.
    For each node specify the following:
    • Address - IP address or host name of the node.
    • Port - Communication port on the node.
    • Cluster TLS Name - Certificate name for TLS. Enter either the certificate common name or the certificate subject alternative name. Usually, this is the same value configured for tls-name on the Aerospike server. Only required if using TLS.
    Use Authentication Authenticates for access to Aerospike server.
    Authentication Mode Authentication mode used to gain access to the Aerospike server:
    • External - External authentication using an LDAP server. Requires that the destination be enabled to use TLS.
    • External Insecure - External authentication using an LDAP server, but without using TLS. Use for testing purposes only.
    • Internal - Password-based authentication for internal users defined in the Aerospike server.

    Available if Use Authentication is enabled.

    User Name of the user registered with the Aerospike database.

    Available if Use Authentication is enabled.

    Password Password of the specified user.

    Available if Use Authentication is enabled.

    Use TLS Uses TLS to secure communication with the Aerospike server. Each node in the Aerospike cluster is authenticated using the Aerospike standard authentication mode.

    If enabled, you must specify the Cluster TLS Name for each node.

    Required when using the external authentication mode.

    If the Aerospike certificate is signed by a private CA or not trusted by the default Java truststore, you must create or modify the truststore file and configure Data Collector to use the file. For more information, see Enabling SSL/TLS

    Commit Level Consistency guarantee requested from Aerospike:
    • Commit All - Server must successfully write to all nodes.
    • Commit Master - Server must successfully write only to the master node.
    Durable Delete Prevents deleted records from reappearing after node failures.
    Expiration Mode Method used to set the time-to-live (TTL) of each record:
    • Do Not Change - For existing records, keeps the same TTL as the existing record. For new records, sets the TTL to the default value configured on the Aerospike server.
    • Never Expires - Sets the TTL to never expire.
    • Server Default Value - Sets the TTL to the default value configured on the Aerospike server.
    • Specified Record TTL - Sets the TTL to the value in the Record TTL property.
    Record TTL Number of seconds before the Aerospike server removes the record.

    Available if Expiration Mode is set to Specified Record TTL.

    Generation Policy Method used to restrict writing a record based on its generation value, or revision number:
    • Generation Must Equal - Requires the record generation value to equal the value specified in the Generation property.
    • Generation Must Exceed - Requires the record generation value to be greater than the value specified in the Generation property.
    • None - Writes a record regardless of the record generation value.
    Generation Record generation value used to determine whether to write a record.

    0 is the record generation value for new records.

    Available if Generation Policy is set to Generation Must Equal or Generation Must Exceed.

    Existing Record Action Action to take on existing records:
    • Only Create Record - Creates records that do not exist. Generates an error for records that exist.
    • Create or Replace Record - Creates new records or replaces existing records entirely.
    • Only Replace Record - Replaces existing records entirely. Generates an error for records that do not exist.
    • Create or Update Record - Creates new records or updates existing records.
    • Only Update Record - Updates existing records. Generates an error for records that do not exist.

    Default is Create or Update Record.

  3. On the Data tab, configure the following properties:
    Data Property Description
    Namespace Aerospike namespace to write data to.
    Set Optional. Set in the namespace to write data to.
    Key Unique string or integer used to create a key for the record.

    Because a key uniquely identifies a record, you might use an expression to specify a field in the record. For example, you might use the following expression to use the value of the order_id field as the key: ${record:value('/order_id')}

    Merge Map Bins Merges a bin of type Map with a new Map bin.

    The resulting Map contains a union of the keys from both Maps. Existing keys in the existing Map are updated to use the new Map value.

    Append List Bins Appends a bin of type List with the elements in a new List bin.