Environment Setup - Eventador.io

Environment Setup

This guide will show you how to create a script to export all environment variables used for the remainder of our tutorials. Once created, this script can be used as a starting point for your production deployment process.

Background

Environment variables are inherited from any process started by that environment. It is a good idea to create a script to set environment variables as part of a programs initiation. In this case, environment variables are a good place to store configuration values required to connect to an Eventador deployment. Each language has its own syntax for accessing environment variables. We will cover this in our language specific tutorials.

Environment Variables

You can set an environment variable in bash using command export VARNAME="SOME VALUE". To check current value of an environment variable use echo $VARNAME

Basic setup

Below is the minimum setup required to connect to your Eventador deployment.

Environment Variable Description
EVENTADOR_PLAINTEXT_ENDPOINT Single (or list) of plain text endpoints from your deployment’s connections tab
EVENTADOR_KAFKA_TOPIC Kafka topic


First, you will need your plain text endpoint from the UI. To get your endpoint, navigate to the console tab and click your Apache Kafka deployment.

deployments

Now switch to the connection tab to find your deployments endpoints.

connections

#!/bin/bash
## Setup environment variables used by Eventador examples
#
# Load via: . ./bootstrap_tutorial_environment.sh

### Required

# Pull the list of brokers from your deployment's connections tab
export EVENTADOR_PLAINTEXT_ENDPOINT=<value_copied_from_UI>

# Topic you wish you use.
export EVENTADOR_KAFKA_TOPIC="demo"

Advanced setup

Additional setup required for more advanced features such as encrypted connections and easier monitoring/debugging.

Environment Variable Description
EVENTADOR_KAFKA_CA_CERT Generate & copy from your deployment’s security tab
EVENTADOR_KAFKA_CLIENT_CERT Generate & copy from your deployment’s security tab
EVENTADOR_KAFKA_CLIENT_KEY Generate & copy from your deployment’s security tab
EVENTADOR_SSL_ENDPOINT Single (or list) of SSL endpoints from your deployment’s connections tab
EVENTADOR_KAFKA_USE_SSL Boolean to toggle use of SSL
EVENTADOR_KAFKA_CONSUMER_GROUP Identify a consumer group for splitting messages between multiple consumers
EVENTADOR_KAFKA_CLIENT_ID Identify a client with user generated unique ID, helpful for debugging clients
EVENTADOR_ZOOKEEPER_ENSEMBLE Pull the list of zookeepers from your deployment’s connections tab


SSL Configuration

Required if you plan to send / receive encrypted messages.

On the right side of the deployments deployments page click the security button.

deployments

Enter a common name and click generate to create a pair of key/certificates.

deployments

Do not leave this screen until you copy your keys as shown below below.

deployments

Additional Configuration

Finally, the last few are optional but can be helpful as you move past basic examples.

Using the setup

By now, you should have a bootstrap_tutorial_environment.sh script populated with your desired setup.

Navigate to the directory with your script and run . ./bootstrap_tutorial_environment.sh. You can check values were properly from command line with env | grep EVENTADOR

env | grep EVENTADOR

EVENTADOR_PLAINTEXT_ENDPOINT=secret
EVENTADOR_KAFKA_CLIENT_ID=demo_id
EVENTADOR_KAFKA_CA_CERT=-----BEGIN CERTIFICATE-----
EVENTADOR_KAFKA_CLIENT_CERT=-----BEGIN CERTIFICATE-----
EVENTADOR_KAFKA_TOPIC=demo
EVENTADOR_KAFKA_CLIENT_KEY=-----BEGIN PRIVATE KEY-----
EVENTADOR_SSL_ENDPOINT=secret
EVENTADOR_KAFKA_CONSUMER_GROUP=myconsumer
EVENTADOR_ZOOKEEPER_ENSEMBLE=secret

Next step

Congratulations! You now have a script which will set the environment variables used throughout our tutorials.

Questions, feedback or find any of these steps unclear? Please contact us. We love helping people get started.