Giter Site home page Giter Site logo

anchorfree / vmbackup-sidecar Goto Github PK

View Code? Open in Web Editor NEW
10.0 9.0 2.0 47 KB

Backup sidecar container for VictoriaMetrics

License: Apache License 2.0

Dockerfile 7.44% Go 92.56%
victoriametrics snapshot backup sync sidecar sidecar-container s3 docker-image team-kyiv-devops project-monitoring

vmbackup-sidecar's Introduction

GitHub license Go Report GitHub release (latest by date including pre-releases)

Warning: use this tool only with VictoriaMetrics version < 1.29.0. Starting from v1.29.0 VictoriaMetrics added native vmbackup and vmrestore tools for fast backups on GCS and S3.

vmbackup-sidecar

Provides a sidecar backup service for VictoriaMetrics vmstorage component.

How it works

vmbackup-sidecar provides /backup/create API endpoint. After receiving GET request, it creates VictoriaMetrics vmstorage snapshot via snapshot API and syncs it with S3 bucket using aws s3 sync. When sync with S3 is completed, all vmstorage snapshots are removed to free up space. Depending on the number of vmstorage instances (pods) running, snapshots will be stored in S3 bucket in following tree:

<s3-bucket-name>
├── <vmstorage-pod-1>
│   ├── data
│   └── indexdb
├── <vmstorage-pod-2>
│   ├── data
│   └── indexdb
└── <vmstorage-pod-3>
    ├── data
    └── indexdb

Docker image

$ docker pull anchorfree/vmbackup-sidecar:latest

Configuration

Parameters for communicating with vmstorage instance and credentials for accessing S3 bucket are stored in environment variables:

VMSTORAGE_HOST: localhost      # vmstorage hostname (should be available via localhost as both containers are in the same Pod)
VMSTORAGE_PORT: "8482"         # which port vmstorage is listening for API requests
VM_SNAPSHOT_BUCKET: my-bucket  # S3 bucket name for syncing snapshot
VM_STORAGE_DATA_PATH: "/vmstorage-data"  # Corresponds to --storageDataPath flag in VictoriaMetrics setup
ENVIRONMENT: "dev"            # either "prod" or "dev", affects logs output (structlog for prod, plain for dev)
AWS_ACCESS_KEY_ID: <access_key>
AWS_SECRET_ACCESS_KEY: <secret_key>

Command-line options:

./backup-vm -h
Usage of ./backup-vm:
  -help
    Show usage
  -only-show-errors
    Only errors and warnings are displayed. All other output is suppressed
  -port int
    Port to listen (default 8488)

Deployment

vmbackup-sidecar container is supposed to be running in the same pod as VictoriaMetrics vmstorage component.

Here is a helm-chart which implements such kind of vmbackup-sidecar deployment: https://github.com/AnchorFree/helm-charts/blob/master/stable/victoria-metrics/templates/vmstorage-statefulset.yaml

vmbackup-sidecar's People

Contributors

alezkv avatar viktor-aura avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

b00men pavdmyt

vmbackup-sidecar's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.