Configure Aerospike and the Elasticsearch connector
For the complete documentation index see: llms.txt
All documentation pages available in markdown.
In the payment service, your authorization service writes dispute records to Aerospike in the test namespace.
The configuration in this section connects that write path to the support search path so that every change in Aerospike is published to the Elasticsearch connector.
Create both aerospike.conf and aerospike-elasticsearch-outbound.yml in your project directory.
Neither file does anything on its own.
When you compose the stack, Docker Compose mounts each file into its container as a read-only volume, so Aerospike Database and the Elasticsearch connector load your local configuration at startup.
-
Create
aerospike.confto run an in-memorytestnamespace and send its changes through XDR connector mode to a destination namedesDC. This is a local single-machine walkthrough with no remote datacenter connections. For production, adapt the configuration to your cluster topology, durability, and security requirements.aerospike.conf service {cluster-name elasticsearch-demofeature-key-file /etc/aerospike/features.conf}logging {console {context any info}}network {service {address anyport 3000}heartbeat {mode meshport 3002address anyinterval 150timeout 10}fabric {port 3001address any}info {port 3003address any}}namespace test {replication-factor 1storage-engine memory {data-size 1G}nsup-period 10}xdr {dc esDC {connector truenode-address-port aerospike-elasticsearch-outbound 8080namespace test {}}}The
xdrconfiguration is the change-notification subscription:connector truemarks theesDCdestination as an Aerospike connector that receives change-notification messages. With the defaultconnector false, the nodes innode-address-portdefine a remote Aerospike cluster instead.node-address-port aerospike-elasticsearch-outbound 8080sets the connector hostname and port where change notifications are delivered. Docker Compose resolves the service nameaerospike-elasticsearch-outboundto the container’s internal IP.namespace test { }enables shipping for thetestnamespace. Only records in listed namespaces are shipped.
See Configure change notification for the complete XDR requirements.
-
Create
aerospike-elasticsearch-outbound.ymlto receive XDR messages and write them to an Elasticsearch index namedaerospike. This file defines the mapping between a dispute record and a searchable document: which index it lands in, how its document ID is derived, and how Aerospike bins relate to Elasticsearch fields.aerospike-elasticsearch-outbound.yml service:address: 0.0.0.0port: 8080manage:address: 0.0.0.0port: 8902logging:enable-console-logging: truerouting:mode: staticdestination: aerospikedoc-id:source: digestformat:mode: custombatch-formatter-class: com.aerospike.connect.elasticsearch.outbound.formatter.ElasticsearchDefaultBatchFormatterpayload-format:mode: flat-jsonmetadata-key: metadataes-client:cluster-config:type: on-premnodes:- host:hostname: elasticsearchport: 9200scheme: httpauth-config:type: noneThe configuration uses these choices:
service.manage.port: 8902exposes the management and metrics endpoints over an unencrypted HTTP connection. Restrict or enable TLS on this port in production. See Connector settings for details.- Static routing sends every record to the
aerospikeindex.doc-id.source: digestgives each document a stable ID derived from the Aerospike record digest, so changes to the same primary key replace the existing Elasticsearch document. See Doc ID for other ID sources. batch-formatter-classselects the default Elasticsearch batch formatter built into the connector image. Theflat-jsonpayload puts Aerospike bins such asmerchant,status, andmemoat the top level so support agents can search them directly, with record metadata undermetadata.es-clientconnects to the self-managed Elasticsearch container over HTTP.