elgo

module
v0.0.0-...-54e1649 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: MIT

README

elgo is an Elasticsearch management tool written in Go.

elgo connects by default to http://localhost:9200.
Specify -host and -port to create a different URL.
Specify -host WITHOUT "http://".

So far elgo supports index actions like create, remove, list, exists,
repository actions like create and remove, snapshot actions like create,
delete and restore, bulk indexing, searching and cluster health information.
SEE THE WIKI PAGE FOR DETAILS

elgo also can index documents to indexes, using the index-doc action.
The document and metadata must be provided as a json file. this repository contains an example file
that can be used as a demo.
The following example indexes the doc defined in o.json o index "ovi" with type "doc".

$ ./elgo -action index-doc -i ovindex -type doc -f o.json

Bulk request has been added and an example input file can be found here (bi.json)
All bulk request must be provided including index, type. See example file bi.json
All bulk requests must be supplied in a file, that respects the Elasticsearch requirements, just like the example file bi.json.

./elgo -action bulk-request -f bi.json
Using Elasticsearch URL:  http://localhost:9200
No documents created.
No documents deleted.
No documents updated.
Created documents:  0
Indexed documents:  100001
Updated documents:  0
Deleted documents:  0

elgo writes a logfile called elgo.out in the current working directory.

When creating an index an input file can also be specified (examples: i.json or simple.index.json) to define
index settings at creation, or mappings etc.

Creating a repository requirs a name, a type and location. location can be a directory or directory tree
that will be created inside path.repo as specified in elasticsearch.yml.

$ ./elgo -action create-repo -r repo1 -type fs -l tmp/repo1

In this example we create a repository of type fs called repo1 in tmp/repo1.
If the path.repo path is /var/backups, the full directory for this repository will be /var/backups/tmp/repo1/
Make sure repo.path is defined and the path exists.

snap-create and snap-restore support all indices, or just specific indices. For ex:

$ ./elgo -action snap-create -s snap2 -r repo0 -i ovi*

creates a snapshot for all indices starting with "ovi",
but if "-i ovi" is used , only index "ovi" will be snapshoted.
If no index is specified with "-i", all indexes will be implied. Restore action works the same way.

$ ./elgo

    At least one action is required. 
    Use -action with one of the following supported actions:
    ==> create-index - requires at least -i <index name>. Optional -f input body in json format to pass index settings.
    ==> remove-index - requires -i <index name>
    ==> list-indexes - returns a list of all indexes.
    ==> index-exists - requires -i <index name>
    ==> index-doc - requires -i <index name> -type <type> -f input json file to be indexed.
    ==> create-repo - requires -r <repo name> -type <type> -l <location>.
    ==> remove-repo - required -r <repo name>.
    ==> snap-create - required -r <repo name> -s <snap name>. Optional -i <index name>. * or multiple indexes accepted.
    ==> snap-delete - required -r <repo name> -s <snap name>
    ==> snap-restore - requires -r <repo name> -s <snap name>
    ==> cluster-info - returns cluster information
    ==> bulk-request - create/index/delete or update using the bulk interface. -f <json file> required containing the bulk request to 
be sent to elasticsearch.

Directories

Path Synopsis
src

Jump to

Keyboard shortcuts

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