This article provides a startup script for deploying Kafka to a Google Compute Engine instance. This isn’t meant to be a production-ready system - it uses the Zookeeper instance embedded with Kafka and keeps most of the default settings. Instead, treat this as a quick and easy way do Kafka development using a live server. This article uses Compute Engine startup scripts to install and run Kafka on instance startup. Startup scripts allow you to run arbitrary Bash commands whenever an instance is created or restarted. Since this script is run on every restart, we lead with a check that makes sure we have not already ran the startup script and, if we have, we simply exit. #!/usr/bin/env bash STARTUP_VERSION=1 STARTUP_MARK=/var/startup.script. $STARTUP_VERSION if [[ -f $STARTUP_MARK ]]; then exit 0 fi Then we configure our Kafka and Scala version numbers used in the rest of the script. SCALA_VERSION=2.10 KAFKA_VERSION=0.9.0.0-SNAPSHOT KAFKA_HOME=/opt/kafka_ "
..share knowledge, share to be shared.