The Amazon Kinesis Agent is a stand-alone Java software application that offers an easier way to collect and ingest data into Amazon Kinesis services, including Amazon Kinesis Streams and Amazon Kinesis Firehose.
After you've downloaded the code from GitHub, you can install the Amazon Kinesis Agent with the following command:
# Optionally, you can set DEBUG=1 in your environment to enable massively
# verbose output of the script
sudo ./setup --install
This setup script downloads all the dependencies and bootstraps the environment for running the Java program.
After the agent is installed, the configuration file can be found in /etc/aws-kinesis/agent.json
. You need to modify this configuration file to set the data destinations and AWS credentials, and to point the agent to the files to push. After you complete the configuration, you can make the agent start automatically at system startup with the following command:
sudo chkconfig aws-kinesis-agent on
If you do not want the agent running at system startup, turn it off with the following command:
sudo chkconfig aws-kinesis-agent off
To start the agent manually, use the following command:
sudo service aws-kinesis-agent start
You can make sure the agent is running with the following command:
sudo service aws-kinesis-agent status
You may see messages such as aws-kinesis-agent (pid [PID]) is running...
To stop the agent, use the following command:
sudo service aws-kinesis-agent stop
The agent writes its logs to /var/log/aws-kinesis-agent/aws-kinesis-agent.log
To uninstall the agent, use the following command:
sudo ./setup --uninstall
The installation done by the setup script is only tested on the following OS Disributions:
For other distributions or platforms, you can build the Java project with the following command:
sudo ./setup --build
or by using Ant target as you would build any Java program:
ant [-Dbuild.dependencies=DEPENDENCY_DIR]
If you use Ant command, you need to download all the dependencies listed in pom.xml before building the Java program. DEPENDENCY_DIR is the directory where you download and store the dependencies. By default, the Amazon Kinesis Agent reads the configuration file from /etc/aws-kinesis/agent.json. You need to create such a file if it does not already exist. A sample configuration can be found at ./configuration/release/aws-kinesis-agent.json
To start the program, use the following command:
java -cp CLASSPATH "com.amazon.kinesis.streaming.agent.Agent"
CLASSPATH is the classpath to your dependencies and the target JAR file that you built from the step above.