Set Java options for outbound connectors
Overview
Java options are passed to the connectors by setting the JAVA_OPTS environment variable.
The JAVA_OPTS environment variable is set differently for connectors running as systemd services and
for connectors running as non-systemd Docker instances.
Set Java options for a connector running as a systemd service
-
Create a
systemdoverride file with the following command:Terminal window sudo systemctl edit CONNECTOR_NAMEReplace the
CONNECTOR_NAMEplaceholder with the name of the connector for which you want to create an override file. Possible values areaerospike-jms-inbound,aerospike-jms-outbound,aerospike-kafka-outbound,aerospike-pulsar-outbound,aerospike-pubsub-outbound,aerospike-xdr-proxy. -
Edit the override file to set the
JAVA_OPTSenvironment variable in theServicesection. This example sets a netty workdir and Java maximum heap size:Terminal window [Service]Environment=JAVA_OPTS="-Dio.netty.native.workdir=/connector/tmp -Xmx1024m" -
Run the
systemdcommand to reload the manager configuration:Terminal window sudo systemctl daemon-reload -
Restart the
systemdconnector service.Terminal window sudo systemctl restart <connector-name>
Set Java options for Docker (non systemd)
In a non-systemd environment, you must explicitly set the JAVA_OPTS environment variable.
For Docker, add -e "JAVA_OPTS=<list of java options>" to the exec.
All connectors use the same method. For example, in ESP, the Docker command might be:
docker run --name=example-connector -p 8080:8080 -e "JAVA_OPTS=-Dio.netty.native.workdir=/connector/tmp -Xmx8G" container.aerospike.com/aerospike/aerospike-esp-outbound:2.4.12Like the examples in the previous section, this sets a Netty workdir and Java maximum heap size, but it could be any Java option.
To verify that this was set correctly, run docker top example-connector. You should see the connector running with your Java options.