This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# | |
# $ echo 'source path_to_env.sh' >> ~/.bashrc | |
# $ yg_install | |
KAFKA_HOST=bj2-storm03:9092 | |
ES_HOST=bj2-storm03:9200 | |
ZK_HOST=bj2-storm03:2181,bj2-storm04:2181,bj2-storm05:2181 | |
STORM_LOG_HOME='/usr/local/storm-default/logs/' | |
TODAY=$(date '+%Y-%m-%d') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# herein we backup our indexes! this script should run at like 6pm or something, after logstash | |
# rotates to a new ES index and theres no new data coming in to the old one. we grab metadatas, | |
# compress the data files, create a restore script, and push it all up to S3. | |
TODAY=`date +"%Y.%m.%d"` | |
INDEXNAME="logstash-$TODAY" # this had better match the index name in ES | |
INDEXDIR="/usr/local/elasticsearch/data/logstash/nodes/0/indices/" | |
BACKUPCMD="/usr/local/backupTools/s3cmd --config=/usr/local/backupTools/s3cfg put" | |
BACKUPDIR="/mnt/es-backups/" | |
YEARMONTH=`date +"%Y-%m"` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# This file contains environment variables required to run Spark. Copy it as | |
# spark-env.sh and edit that to configure Spark for your site. | |
# | |
# The following variables can be set in this file: | |
# - SPARK_LOCAL_IP, to set the IP address Spark binds to on this node | |
# - MESOS_NATIVE_LIBRARY, to point to your libmesos.so if you use Mesos | |
# - SPARK_JAVA_OPTS, to set node-specific JVM options for Spark. Note that | |
# we recommend setting app-wide options in the application's driver program. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RedisClient { | |
private JedisPool pool; | |
@Inject | |
public RedisClient(Settings settings) { | |
try { | |
pool = new JedisPool(new JedisPoolConfig(), settings.get("redis.host"), settings.getAsInt("redis.port", 6379)); | |
} catch (SettingsException e) { | |
// ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.avro.Schema; | |
import org.apache.avro.generic.GenericData; | |
import org.apache.avro.generic.GenericDatumWriter; | |
import org.apache.avro.generic.GenericRecord; | |
import org.apache.avro.io.Encoder; | |
import org.apache.avro.io.EncoderFactory; | |
import org.apache.kafka.clients.producer.KafkaProducer; | |
import org.apache.kafka.clients.producer.ProducerRecord; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; |
OlderNewer