Sign inSign up

evpavel/secor

By evpavel

Updated over 8 years ago

Kafka to S3 backuper

Image
0

1.6K

evpavel/secor repository overview

Secor 0.23-SNAPSHOT (Kafka 0.10.0.1)

This project uses Docker (and Gradle under the hood) to produce a Docker image containing an uber-jar (single jar containing all dependencies) version of Pinterest Secor (https://github.com/pinterest/secor).

Currently, this project packages Secor 0.23-SNAPSHOT, using Kafka client version 0.10.0.1.

docker-entrypoint.sh is the entrypoint into the image, it is responsible for taking passed in ENV vars at runtime and configuring Secor accordingly. The table below shows all ENV variables you can specify to configure Secor's operation.

Building the Image

You can build the image locally by doing:

docker build -t [yourorg/]secor .

How to Run

If you are running from outside an AWS instance, you must specify AWS credentials:

docker run \
  -e DEBUG=true \
  -e ZOOKEEPER_QUORUM=zookeeper.quorum.consul:2181 \
  -e AWS_ACCESS_KEY=YOUR_KEY \
  -e AWS_SECRET_KEY=YOUR_SECRET \
  -e SECOR_S3_BUCKET=my-kafka-backups \
  -e SECOR_GROUP=raw_logs \
  secor

There are many more configuration options that can be passed in via -e NAME=value, described in the table below.

## Releasing (to Ovotech)

The Docker Hub repo (ovotech/secor) is configured to automatically build when this repository is changed (i.e., when a change is pushed to master, or when a tag/release is created).

Configuration options

Can be configured using environment variables:

Environment Variable NameRequired?Purpose
ZOOKEEPER_QUORUMYesZookeeper quorum (not required if KAFKA_SEED_BROKER_HOST is specified)
KAFKA_SEED_BROKER_HOSTYesKafka broker hosts (not required if ZOOKEEPER_QUORUM is specified)
SECOR_S3_BUCKETYesThe S3 bucket into which backups will be persisted
SECOR_S3_PATHYesPath within S3 bucket where sequence files are stored
SECOR_FILE_READER_WRITER_FACTORYNoWhich WriterFactory to use (defaults to: SequenceFileReaderWriterFactory)
DEBUGNoEnable some debug logging (defaults to: false)
JVM_MEMORYNoHow much memory to give the JVM (via the -Xmx parameter) (defaults to: 512m)
KAFKA_SEED_BROKER_PORTNoKafka broker port (defaults to: 9092)
AWS_ACCESS_KEYNoAWS Access key
AWS_SECRET_KEYNoAWS Secret access key
AWS_REGIONNoThe AWS region for S3 uploading
AWS_ENDPOINTNoThe AWS S3 endpoint to use for uploading
SECOR_KAFKA_TOPIC_FILTERNoRegexp filter which topics it should replicate (defaults to: .*)
SECOR_KAFKA_TOPIC_BLACKLISTNoWhich topics to exclude from backing up
SECOR_MAX_FILE_BYTESNoMax bytes per file stored in S3 (defaults to: 200000000)
SECOR_MAX_FILE_SECONDSNoMax time per file before it is stored in S3 (defaults to: 3600)
SECOR_COMPRESSION_CODECNoWhich Hadoop compression codec to use for partition files
SECOR_FILE_EXTENSIONNoCustom file extension to be appended to all partition names
SECOR_TIMESTAMP_NAMENoWhen using DateMessageParser what field to use in the JSON (defaults to: timestamp)
SECOR_TIMESTAMP_PATTERNNoWhen using DateMessageParser what format the timestamp is
PARTITIONER_GRANULARITY_HOURNoShould Secor partition the files up by hour as well as day? (defaults to: false)
PARTITIONER_GRANULARITY_MINUTENoShould Secor partition the files up by hour as well as hour, and day? (defaults to: false)
SECOR_KAFKA_GROUPNoKafka consumer group name (defaults to: secor_backup)
SECOR_MESSAGE_PARSER_CLASSNoWhich message parser factory to use (defaults to: OffsetMessageParser)
SECOR_GENERATIONNoGenerational version ID to differentiate between incompatible upgrades (defaults to: 1)
SECOR_CONSUMER_THREADSNoNumber of consumer threads per Secor process (defaults to: 7)
SECOR_MESSAGES_PER_SECONDNoMaximum number of messages consumed per second for the entire process (defaults to: 10000)
SECOR_OFFSETS_PER_PARTITIONNoHow many offsets should be stored within a backed up partition? (defaults to: 10000000)
KAFKA_OFFSETS_STORAGENoShould offsets be stored in Kafka or ZooKeeper? (defaults to: kafka)
KAFKA_DUAL_COMMIT_ENABLEDNoShould Secor commit processed offsets to Kafak AND ZooKeeper? (defaults to: false)
SECOR_OSTRICH_PORTNoWhat port should Ostrich data be sent on (defaults to: 9999)

Using without Docker

If you just wish to package up Secor as a standalone uber-JAR, you can run the gradle tasks directly, e.g.:

./gradlew shadowJar

Tag summary

Content type

Image

Digest

Size

565.9 MB

Last updated

over 8 years ago

docker pull evpavel/secor