From 80c7b47a4bb4b864a5fc4425325e11f89f0be318 Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Tue, 26 May 2020 16:00:40 -0700 Subject: [PATCH] [7.x] Add steps for quickly testing to the READMEs of ILM, Rollup, and CCR. (#67213) (#67428) --- .../cross_cluster_replication/README.md | 23 +++++ .../index_lifecycle_management/README.md | 95 +++++++++++++++++++ x-pack/plugins/rollup/README.md | 19 +++- 3 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 x-pack/plugins/cross_cluster_replication/README.md create mode 100644 x-pack/plugins/index_lifecycle_management/README.md diff --git a/x-pack/plugins/cross_cluster_replication/README.md b/x-pack/plugins/cross_cluster_replication/README.md new file mode 100644 index 0000000000000..8baccf4f7333e --- /dev/null +++ b/x-pack/plugins/cross_cluster_replication/README.md @@ -0,0 +1,23 @@ +# Cross-Cluster Replication + +## Quick steps for testing cross-cluster replication + +You can run a local cluster and simulate a remote cluster within a single Kibana directory. + +1. Run `yarn es snapshot --license=trial` and kill the process once the snapshot has been installed. +2. Duplicate the ES installation by running `cp -aR .es/8.0.0 .es/8.0.0-2`. +3. Start your "local" cluster by running `.es/8.0.0/bin/elasticsearch` and starting Kibana. +4. Start your "remote" cluster by running `.es/8.0.0-2/bin/elasticsearch -E cluster.name=europe -E transport.port=9400`. +5. Index a document into your remote cluster by running `curl -X PUT http://elastic:changeme@localhost:9201/my-leader-index --data '{"settings":{"number_of_shards":1,"soft_deletes.enabled":true}}' --header "Content-Type: application/json"`. +Note that these settings are required for testing auto-follow pattern conflicts errors (see below). + +Now you can create follower indices and auto-follow patterns to replicate the `my-leader-index` +index on the remote cluster that's available at `127.0.0.1:9400`. + +### Auto-follow pattern conflict errors + +You can view conflict errors by creating two auto-follow patterns with overlapping patterns (e.g. `my*` and `my-*`) that will both capture the `my-leader-index` index on your remote cluster. Run the curl command to create `my-leader-index2` on your remote cluster, since auto-follow patterns don't replicate existing indices. + +Now, when you open the details flyout of one of the auto-follow patterns you will see a list of recent errors. + +![image](https://user-images.githubusercontent.com/1238659/79623769-e879b800-80d2-11ea-906d-0b2d6637c3a3.png) \ No newline at end of file diff --git a/x-pack/plugins/index_lifecycle_management/README.md b/x-pack/plugins/index_lifecycle_management/README.md new file mode 100644 index 0000000000000..3b72ac85810c6 --- /dev/null +++ b/x-pack/plugins/index_lifecycle_management/README.md @@ -0,0 +1,95 @@ +# Index Lifecycle Management + +## Quick steps for testing ILM in Index Management + +You can test that the `Frozen` badge, phase filtering, and lifecycle information is surfaced in +Index Management by running this series of requests in Console: + +``` +PUT /_ilm/policy/full +{ + "policy": { + "phases" : { + "hot" : { + "min_age" : "0ms", + "actions" : { + "rollover" : { + "max_docs" : 1 + } + } + }, + "warm" : { + "min_age" : "15s", + "actions" : { + "forcemerge" : { + "max_num_segments" : 1 + }, + "shrink" : { + "number_of_shards" : 1 + } + } + }, + "cold" : { + "min_age" : "30s", + "actions" : { + "freeze": {} + } + }, + "delete" : { + "min_age" : "1d", + "actions" : { + "delete" : { } + } + } + } + } +} + +PUT _template/test +{ + "index_patterns": ["test-*"], + "settings": { + "number_of_shards": 3, + "number_of_replicas": 0, + "index.lifecycle.name": "full", + "index.lifecycle.rollover_alias": "test-alias" + } +} + +PUT /test-000001 +{ + "aliases": { + "test-alias": { + "is_write_index": true + } + } +} + +PUT test-alias/_doc/1 +{ + "a": "a" +} + +PUT /_cluster/settings +{ + "transient": { + "logger.org.elasticsearch.xpack.core.indexlifecycle": "TRACE", + "logger.org.elasticsearch.xpack.indexlifecycle": "TRACE", + "logger.org.elasticsearch.xpack.core.ilm": "TRACE", + "logger.org.elasticsearch.xpack.ilm": "TRACE", + "indices.lifecycle.poll_interval": "10s" + } +} +``` + +Then go into Index Management and, after about 1 minute, you'll see a frozen index and +you'll be able to filter by the various lifecycle phases and statuses. + +![image](https://user-images.githubusercontent.com/1238659/78087831-29ee3180-7377-11ea-8e24-14cdc4035bb2.png) + +Next, add the Kibana sample data and attach the `full` policy to the index that gets created. +After about a minute, there should be an error on this index. When you click the index you'll see +ILM information in the detail panel as well as an error. You can dismiss the error by clicking +`Manage > Retry lifecycle step`. + +![image](https://user-images.githubusercontent.com/1238659/78087984-a6811000-7377-11ea-880e-1a7b182c14f1.png) \ No newline at end of file diff --git a/x-pack/plugins/rollup/README.md b/x-pack/plugins/rollup/README.md index b43f4d5981409..9c4dfee2d8bbe 100644 --- a/x-pack/plugins/rollup/README.md +++ b/x-pack/plugins/rollup/README.md @@ -1,4 +1,7 @@ +# Rollup + ## Summary + Welcome to the Kibana rollup plugin! This plugin provides Kibana support for [Elasticsearch's rollup feature](https://www.elastic.co/guide/en/elasticsearch/reference/current/xpack-rollup.html). Please refer to the Elasticsearch documentation to understand rollup indices and how to create rollup jobs. This plugin allows Kibana to: @@ -10,11 +13,25 @@ This plugin allows Kibana to: The rest of this doc dives into the implementation details of each of the above functionality. +## Quick steps for testing + +The pattern for creating a rollup job and rollup index pattern is: + +1. Install sample data (web logs is a good one). +2. Create a rollup job with an index pattern that captures this index (e.g. `k*`). +3. Set frequency to "minute". Clear the latency buffer field. +4. Select the time field which is the same time field selected in the installed index pattern (`timestamp` without an `@` in the case of web logs). +5. Specify a time bucket size (`10m` will do). +6. Select a few terms, histogram, and metrics fields. +7. Create and start the rollup job. Wait a minute for the job to run. You should see the numbers for documents and pages processed change in the detail panel. +8. Create a rollup index pattern in the Index Patterns app. +9. Now you can create visualizations using this index pattern. + --- ## Create and manage rollup jobs -The most straight forward part of this plugin! A new app called Rollup Jobs is registered in the Management section and follows a typical CRUD UI pattern. This app allows users to create, start, stop, clone, and delete rollup jobs. There is no way to edit an existing rollup job; instead, the UI offers a cloning ability. The client-side portion of this app lives in [public/crud_app](public/crud_app) and uses endpoints registered in [(server/routes/api/jobs](server/routes/api/jobs). +The most straight forward part of this plugin! A new app called Rollup Jobs is registered in the Management section and follows a typical CRUD UI pattern. This app allows users to create, start, stop, clone, and delete rollup jobs. There is no way to edit an existing rollup job; instead, the UI offers a cloning ability. The client-side portion of this app lives in [public/crud_app](public/crud_app) and uses endpoints registered in [server/routes/api/jobs](server/routes/api/jobs). Refer to the [Elasticsearch documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/rollup-getting-started.html) to understand rollup indices and how to create rollup jobs.