kibana/x-pack/plugins/snapshot_restore
Spencer fecdba7eba
[eslint] add rule to prevent export* in plugin index files (#109357)
* [eslint] add rule to prevent export* in plugin index files

* deduplicate export names for types/instances with the same name

* attempt to auto-fix duplicate exports too

* capture exported enums too

* enforce no_export_all for core too

* disable rule by default, allow opting-in for help fixing

* update tests

* reduce yarn.lock duplication

* add rule but no fixes

* disable all existing violations

* update api docs with new line numbers

* revert unnecessary changes to yarn.lock which only had drawbacks

* remove unnecessary eslint-disable

* rework codegen to split type exports and use babel to generate valid code

* check for "export types" deeply

* improve test by using fixtures

* add comments to some helper functions

* disable fix for namespace exports including types

* label all eslint-disable comments with related team-specific issue

* ensure that child exports of `export type` are always tracked as types

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-01 18:05:45 -07:00
..
__jest__/client_integration Migrate Stack Management apps to consume internal EuiCodeEditor (#108629) 2021-08-19 10:23:55 -07:00
common [eslint] add rule to prevent export* in plugin index files (#109357) 2021-09-01 18:05:45 -07:00
public Add Snapshot and Restore locator. (#109886) 2021-08-24 17:41:32 -07:00
server [Snapshots + Restore] Fix no snapshots prompt 2021-07-15 08:50:17 -04:00
test/fixtures Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
jest.config.js Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
kibana.json Add Snapshot and Restore locator. (#109886) 2021-08-24 17:41:32 -07:00
README.md
tsconfig.json [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00

Snapshot Restore

Quick steps for testing

File system

  1. Add the file system path you want to use to elasticsearch.yml or as part of starting up ES. Note that this path should point to a directory that exists.
path:
  repo: /tmp/es-backups

or

yarn es snapshot --license=trial -E path.repo=/tmp/es-backups
  1. Use Console or UI to add a repository. Use the file system path above as the location setting:
PUT /_snapshot/my_backup
{
  "type": "fs",
  "settings": {
    "location": "/tmp/es-backups",
    "chunk_size": "10mb"
  }
}
  1. Adjust settings as necessary, all available settings can be found in docs: https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html#_shared_file_system_repository

Readonly

Readonly repositories only take url setting. Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html#_read_only_url_repository

It's easy to set up a file: url:

PUT _snapshot/my_readonly_repository
{
  "type": "url",
  "settings": {
    "url": "file:///tmp/es-backups"
  }
}

Source only

Source only repositories are special in that they are basically a wrapper around another repository type. Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html#_source_only_repository

This means that the settings that are available depends on the delegate_type parameter. For example, this source only repository delegates to fs (file system) type, so all file system rules and available settings apply:

PUT _snapshot/my_src_only_repository
{
  "type" : "source",
  "settings" : {
    "delegate_type" : "fs",
    "location" : "/tmp/es-backups"
  }
}

Plugin-based repositories:

There are four official repository plugins available: S3, GCS, HDFS, Azure. Available plugin repository settings can be found in the docs: https://www.elastic.co/guide/en/elasticsearch/plugins/master/repository.html.

To run ES with plugins:

  1. Run yarn es snapshot from the Kibana directory like normal, then exit out of process.
  2. cd .es/8.0.0
  3. bin/elasticsearch-plugin install https://snapshots.elastic.co/downloads/elasticsearch-plugins/repository-s3/repository-s3-8.0.0-SNAPSHOT.zip
  4. Repeat step 3 for additional plugins, replacing occurrences of repository-s3 with the plugin you want to install.
  5. Run bin/elasticsearch from the .es/8.0.0 directory. Otherwise, starting ES with yarn es snapshot would overwrite the plugins you just installed.