Skip to content

Instantly share code, notes, and snippets.

@mesmacosta
Created October 19, 2020 16:15
Show Gist options
  • Select an option

  • Save mesmacosta/28e1313f52a42d9d9ced6af4f60babbf to your computer and use it in GitHub Desktop.

Select an option

Save mesmacosta/28e1313f52a42d9d9ced6af4f60babbf to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
export ATLAS_SERVER_HEAP="-Xms15360m -Xmx15360m -XX:MaxNewSize=5120m -XX:MetaspaceSize=100M -XX:MaxMetaspaceSize=512m"
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-amazon-corretto
export MANAGE_LOCAL_HBASE=true
export MANAGE_LOCAL_SOLR=true
cd /opt/kafka/kafka_2.11-1.0.0/
# Get external IP
external_ip_address=$(curl -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip)
# We must update the external IP config for Kafka listeners
new_line="advertised.listeners=INTERNAL:\/\/localhost:9027,EXTERNAL:\/\/$external_ip_address:9037"
sed -i "33s/.*/$new_line/" config/server.properties
bin/zookeeper-server-start.sh config/zookeeper.properties &
bin/kafka-server-start.sh config/server.properties &
# Sleep 60 seconds to wait for zookeeper and kafka start
sleep 60
# Check memory, apache atlas may run out of memory, depending the config
free -h
cd /opt/apache-atlas
bin/atlas_start.py &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment