GitHub's ops focused Elasticsearch library
Перейти к файлу
hoenn d3e80c18c2 Add ES8 tests, add test data for breaking change 2024-04-02 12:05:13 -04:00
.github/workflows Set go mod min to 1.17, add workflow to run tests against min 2024-02-13 12:31:00 -05:00
cmd/vulcanizer Decouple cli setup/implementation from main package 2019-12-17 10:39:09 -05:00
integration_data Add ES8 tests, add test data for breaking change 2024-04-02 12:05:13 -04:00
pkg/cli Remove unnecessary recovery cmd, shards has a subcmd for this 2022-10-14 11:52:00 -04:00
script Add ES8 tests, add test data for breaking change 2024-04-02 12:05:13 -04:00
.gitignore Add Goland specific config 2019-03-19 11:22:15 -05:00
.golangci.yaml Update go version in mod and workflows 2024-02-12 11:24:09 -05:00
.goreleaser.yml Add config file and action for goreleaser 2021-02-04 11:32:21 -05:00
CODE_OF_CONDUCT.md Add a code of conduct 2018-08-13 10:44:03 -04:00
CONTRIBUTING.md Finalize the name of the package as vulcanizer 2018-08-21 16:34:03 -04:00
LICENSE Initial commit 2018-08-13 10:33:30 -04:00
README.md Update README with new usage 2022-10-17 14:14:03 -04:00
ROADMAP.md Update roadmap and readme to display new features 2019-05-23 14:52:22 -04:00
es.go Add new method and tests for ClusterAllocationExplainWithQueryParams 2024-02-16 09:58:39 -05:00
es_test.go Add new method and tests for ClusterAllocationExplainWithQueryParams 2024-02-16 09:58:39 -05:00
go.mod Set go mod min to 1.17, add workflow to run tests against min 2024-02-13 12:31:00 -05:00
go.sum Set go mod min to 1.17, add workflow to run tests against min 2024-02-13 12:31:00 -05:00
integration_test.go Add ES8 tests, add test data for breaking change 2024-04-02 12:05:13 -04:00
util.go lints util.go 2022-08-08 12:09:06 -07:00
util_test.go first batch of linter fixes 2022-08-08 11:35:45 -07:00

README.md

vulcanizer

GitHub's ops focused Elasticsearch library

build status GoDoc Go Report Card release

This project is a golang library for interacting with an Elasticsearch cluster. It's goal is to provide a high level API to help with common tasks that are associated with operating an Elasticsearch cluster such as querying health status of the cluster, migrating data off of nodes, updating cluster settings, etc.

This project does not aim to be a fully-featured API client for querying or indexing to Elasticsearch.

Go API

You can perform custom operations in your Go application.

import "github.com/github/vulcanizer"

v = vulcanizer.NewClient("localhost", 9200)
oldSetting, newSetting, err := v.SetSetting("indices.recovery.max_bytes_per_sec", "1000mb")

Command line application

This project produces a vulcanizer binary that is a command line application that can be used to manage your Elasticsearch cluster.

$ vulcanizer help
Usage:
  vulcanizer [command]

Available Commands:
  aliases         Interact with aliases of the cluster.
  allocation      Set shard allocation on the cluster.
  analyze         Analyze text given an analyzer or a field and index.
  drain           Drain a server or see what servers are draining.
  fill            Fill servers with data, removing shard allocation exclusion rules.
  health          Display the health of the cluster.
  heap            Display the node heap stats.
  help            Help about any command
  hotthreads      Display the current hot threads by node in the cluster.
  indices         Display the indices of the cluster.
  mappings        Display the mappings of the specified index.
  nodeallocations Display the nodes of the cluster and their disk usage/allocation.
  nodes           Display the nodes of the cluster.
  repository      Interact with the configured snapshot repositories.
  setting         Interact with cluster settings.
  settings        Display all the settings of the cluster.
  shards          Get shard data by cluster node(s).
  snapshot        Interact with a specific snapshot.

Flags:
      --cacert string       Path to the certificate to check the cluster certificates against
      --cert string         Path to the certificate to use for client certificate authentication
  -c, --cluster string      Cluster to connect to defined in config file
  -f, --configFile string   Configuration file to read in (default to "~/.vulcanizer.yaml")
  -h, --help                help for vulcanizer
      --host string         Host to connect to (default "localhost")
      --key string          Path to the key to use for client certificate authentication
      --password string     Password to use during authentication
      --path string         Path to prepend to queries, in case Elasticsearch is behind a reverse proxy
  -p, --port int            Port to connect to (default 9200)
      --protocol string     Protocol to use when querying the cluster. Either 'http' or 'https'. Defaults to 'http' (default "http")
  -k, --skipverify string   Skip verifying server's TLS certificate. Defaults to 'false', ie. verify the server's certificate (default "false")
      --user string         User to use during authentication

Use "vulcanizer [command] --help" for more information about a command.

Roadmap and future releases

The proposed future for vulcanizer can be found in our ROADMAP.

Configuration and connection information

All commands take --cluster <name> to look up information in a configuration file in ~/.vulcanizer.yaml. The configuration should be in the form of

local:
  host: localhost
  port: 9200
staging:
  host: 10.10.2.1
  port: 9201
production:
  host: 10.10.1.1
  port: 9202

Alternatively, all commands take --host and --port for the connection information.

For example:

# Query for cluster health on the "local" cluster
vulcanizer health --cluster local

# Query for nodes against the node 10.10.2.1 and port 9202
vulcanizer nodes --host 10.10.2.1 --port 9202

Development

./script/build will compile the project and install the vulcanizer binary to $GOPATH/bin.

./script/test will run the tests in the project.

Supported Elasticsearch versions

Integration tests are set up to run against the latest v5 and v6 versions of Elasticsearch.

Name

Vulcanization is the process of making rubber more elastic, so vulcanizer is the library that makes Elasticsearch easier to work with!

Project status

This project is under active development.

Contributing

This repository is open to contributions. Please also see code of conduct

To get up and running, install the project into your $GOPATH and run the set up scripts.

go get github.com/github/vulcanizer

cd $GOPATH/src/github.com/github/vulcanizer

./script/bootstrap
./script/test

And the test suite should execute correctly.

License

This project is released under the MIT LICENSE. Please note it includes 3rd party dependencies release under their own licenses; dependencies are listed in our go.mod file. When using the GitHub logos, be sure to follow the GitHub logo guidelines.

Authors

Authored by GitHub Engineering