cagrr

package module
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2016 License: BSD-3-Clause Imports: 7 Imported by: 0

README

Cassandra Go Range Repair tool

Build Status Go Report Card Coverage Status

Anti-entropy Cassandra cluster tool. It uses repair service written in Java.

Prerequisites

You need cajrr up and running.

Run tests:

make integration   # Make a "hole" and check existence
make check         # Only check, no write/restart cycle

Repair your cluster:

cagrr -k keyspace

Analyze your logs in Kibana interface available at:

http://172.16.237.50:5601

Check your metrics in Grafana interface available at:

http://172.16.237.30:3000

##Troubleshooting

  1. Elasticsearch didn't start with vm.max_map_count error:

    Run on your host machine:

    sudo sysctl -w vm.max_map_count=262144
    

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterConfig

type ClusterConfig struct {
	Host      string   `yaml:"host"`
	Port      int      `yaml:"port"`
	Interval  string   `yaml:"interval"`
	Keyspaces []string `yaml:"keyspaces"`
}

ClusterConfig contains configuration of cluster item

type Config

type Config struct {
	Clusters []ClusterConfig `yaml:"clusters"`
}

Config is a configuration file struct

type Fixer

type Fixer interface {
	Repair(keyspace string, callback string) ([]Repair, error)
}

Fixer repairs cluster

type Fragment

type Fragment struct {
	ID       int    `json:"id"`
	Endpoint string `json:"endpoint"`
	Start    string `json:"start"`
	End      string `json:"end"`
}

Fragment of Token range for repair

func (Fragment) Repair

func (f Fragment) Repair(r Ring, keyspace string, callback string) Repair

Repair fragment

type Repair

type Repair struct {
	ID       int64    `json:"id"`
	Fragment Fragment `json:"fragment"`

	T1       time.Time
	T2       time.Time
	Callback string `json:"callback"`
	Keyspace string `json:"keyspace"`
	// contains filtered or unexported fields
}

Repair is a Unit of repair work

func (*Repair) Duration

func (r *Repair) Duration() time.Duration

Duration measure time of fragment's repair

func (*Repair) Run

func (r *Repair) Run() error

Run repair in cluster

func (*Repair) StartMeasure

func (r *Repair) StartMeasure()

StartMeasure fixes start time of Request

func (*Repair) StopMeasure

func (r *Repair) StopMeasure()

StopMeasure fixes end time of Request

type RepairStatus

type RepairStatus struct {
	Repair   Repair `json:"repair"`
	Command  int    `json:"command"`
	Count    int    `json:"count"`
	Duration int    `json:"duration"`
	Error    bool   `json:"error"`
	Message  string `json:"message"`
	Session  string `json:"session"`
	Total    int    `json:"total"`
	Type     string `json:"type"`
}

RepairStatus keeps status of repair

type Ring

type Ring struct {
	Host        string
	Port        int
	Cluster     int     `json:"cluster"`
	Name        string  `json:"name"`
	Partitioner string  `json:"partitioner"`
	Tokens      []Token `json:"tokens"`
}

Ring represents several node combined in ring

func (Ring) Count

func (r Ring) Count() int

Count fragments of ring

func (Ring) Obtain

func (r Ring) Obtain(keyspace, callback string, cluster int) ([]repair.Runner, error)

Obtain ring

func (Ring) Repair

func (r Ring) Repair(keyspace string, callback string) ([]repair.Runner, error)

Repair ring

type Token

type Token struct {
	ID     string     `json:"key"`
	Ranges []Fragment `json:"ranges"`
}

Token represents primary key range

Directories

Path Synopsis
cmd
cagrr command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL