Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds documentation for Admin UI index operations #2403

Merged
merged 15 commits into from
Jan 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
242 changes: 242 additions & 0 deletions _dashboards/admin-ui-index/index-management.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
---
layout: default
title: Index Management
parent: Admin UI for index operations in OpenSearch Dashboards
ariamarble marked this conversation as resolved.
Show resolved Hide resolved
nav_order: 10
---

# Index Management
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

The Index Management section in the admin UI allows you to preform the operations available in the [Index API]({{site.url}}{{site.baseurl}}/api-reference/index-apis/index/) from OpenSearch Dashboards' web UI.
ariamarble marked this conversation as resolved.
Show resolved Hide resolved
Introduced 2.5
{: .label .label-purple }

## Index Policies

[Policies]({{site.url}}{{site.baseurl}}/im-plugin/ism/policies/) are are configurations (JSON documents can also be uploaded) that define the following:
ariamarble marked this conversation as resolved.
Show resolved Hide resolved
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

* The states that an index can be in, including the default state for new indexes. For example, you might name your states “hot,” “warm,” “delete,” and so on. For more information, see [States]({{site.url}}{{site.baseurl}}/im-plugin/ism/policies/#states).
* Any actions that you want the plugin to take when an index enters a state, such as performing a rollover. For more information, see [Actions]({{site.url}}{{site.baseurl}}/im-plugin/ism/policies/#actions).
* The conditions that must be met for an index to move into a new state, known as transitions. For example, if an index is more than eight weeks old, you might want to move it to the “delete” state. For more information, see [Transitions]({{site.url}}{{site.baseurl}}/im-plugin/ism/policies/#transitions).

In other words, a policy defines the states that an index can be in, the actions to perform when in a state, and the conditions that must be met to transition between states.
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

You have complete flexibility in the way you can design your policies. You can create any state, transition to any other state, and specify any number of actions in each state.
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

To attach policies to indices:
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

* `Index policies` under `Index Management`.
* Choose the index or indexes that you want to attach your policy to.
* Choose Apply policy.
* From the Policy ID menu, choose the policy that you created. * You can see a preview of your policy.
* If your policy includes a rollover operation, specify a rollover alias. Make sure that the alias that you enter already exists. For more information about the rollover operation, see rollover.
* Choose Apply.
* After you attach a policy to an index, ISM creates a job that runs every 5 minutes by default to perform policy actions, check conditions, and transition the index into different states. To change the default time interval for this job, see Settings.

(Screenshots)

Policy jobs are not run if the cluster state is red.
ariamarble marked this conversation as resolved.
Show resolved Hide resolved
{: .note}

## Managed Indices
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

To attach policies to indicies:
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

* `Manage Indices` under `Index Management`.
* Choose the index or indices that you want to attach your policy to.
* Select the `Change policy` button.
* Choose Apply policy.

(Screenshots)

## Indices
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

Displays a list of indices in your OpenSearch cluster. Various properties are listed for each index including Heath (Green, Yellow, Red), if the index is managed by a policy, status, total size, size of primaries, total documents, deleted documents, primaries and replicas.
ariamarble marked this conversation as resolved.
Show resolved Hide resolved
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

(Screenshot)

#### Create Index

While you can [create an index]({{site.url}}{{site.baseurl}}/api-reference/index-apis/create-index/) by using a document as a base, you can also just create an empty index for use later.
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

To create an index, select the blue `Create Index` button located under the `Indices` section of `Index Management`. Then, define the index by setting the following:

* Index name.
* Number of primary shards.
* Number of replicas.
* Refresh interval.
* Add fields and objects using either the visual editor or the JSON editor.

`Advanced settings` allows you to upload a JSON configuration.

(Screenshot)

#### Apply policy
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

If you analyze time-series data, you likely prioritize new data over old data. You might periodically perform certain operations on older indices, such as reducing replica count or deleting them.
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

[Index State Management]({{site.url}}{{site.baseurl}}/im-plugin/ism/index/) (ISM) is a plugin that lets you automate these periodic, administrative operations by triggering them based on changes in the index age, index size, or number of documents. The admin UI uses the ISM plugin to define policies that automatically handle index rollovers or deletions to fit your use case.
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

For example, you can define a policy that moves your index into a `read_only` state after 30 days and then deletes it after a set period of 90 days. You can also set up the policy to send you a notification message when the index is deleted.

You might want to perform an index rollover after a certain amount of time or run a `force_merge` operation on an index during off-peak hours to improve search performance during peak hours.

To apply a policy, select the index you want to apply the policy to in the `Indices` list under `Index Management`. Then select the `Actions` button, and select `Apply policiy` from the drop-down menu.

(Screenshot)

#### Close
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

The [close]({{site.url}}{{site.baseurl}}/api-reference/index-apis/close-index/) operation closes an index. Once an index is closed, you cannot add data to it or search for any data within the index.
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

To close an index, select the index you want to close in the `Indices` list under `Index Management`. Then select the `Actions` button, and select `Close` from the drop-down menu.

(Screenshot)

#### Open
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

The [open]({{site.url}}{{site.baseurl}}/api-reference/index-apis/open-index/) index operation opens a closed index, letting you add or search for data within the index.
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

To open an index, select the index you want to open in the `Indices` list under `Index Management`. Then select the `Actions` button, and select `Open` from the drop-down menu.

(Screenshot)

#### Reindex
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

The [reindex]({{site.url}}{{site.baseurl}}/api-reference/document-apis/reindex/) operation lets you copy all or a subset of your data from a source index into a destination index.
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

To reindex an index, select the index you want to reindex in the `Indices` list under `Index Management`. Then select the `Actions` button, and select `Reindex` from the drop-down menu.

(Screenshot)

#### Shrink
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

The [shrink]({{site.url}}{{site.baseurl}}/api-reference/index-apis/shrink-index/) index operation moves all of your data in an existing index into a new index with fewer primary shards.
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

To shrink an index, select the index you want to shrink in the `Indices` list under `Index Management`. Then select the `Actions` button, and select `Shrink` from the drop-down menu.

(Screenshot)
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

#### Split
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

The [split]({{site.url}}{{site.baseurl}}/api-reference/index-apis/split/) index operation splits an existing read-only index into a new index, cutting each primary shard into some amount of primary shards in the new index.
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

To split an index, select the index you want to split in the `Indices` list under `Index Management`. Then select the `Actions` button, and select `Split` from the drop-down menu.

(Screenshot)

#### Delete
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

If you no longer need an index, you can use the [delete]({{site.url}}{{site.baseurl}}/api-reference/index-apis/delete-index/) index operation to delete it.
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

To delete an index, select the index you want to delete in the `Indices` list under `Index Management`. Then select the `Actions` button, and select `Delete` from the drop-down menu.

(Screenshot)

## Templates

[Index templates]({{site.url}}{{site.baseurl}}/opensearch/index-templates/) let you initialize new indices with predefined mappings and settings. For example, if you continuously index log data, you can define an index template so that all of these indices have the same number of shards and replicas.
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

To create a template, select the blue `Create template` button on the `Templates` page under `Index Management`.

Next, define the template:

* Enter the template name.
* Select the template type.
* Specify any index patterns you would like to use.
* Set the priority of the template.
* Select an index alias.
* Set the number of primary shards.
* Set the number of replicas.
* Set the refresh intervals.
* Add fields and objects for your index mapping using either the visual editor or the JSON editor.

(Screenshots)

## Aliases

An alias is a virtual index name that can point to one or more indexes. If your data is spread across multiple indexes, rather than keeping track of which indexes to query, you can create an alias and query it instead.

To create an alias:
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

* Select the blue `Create Alias` button on the `Aliases` page under `Index Management`.
* Specify the alias name.
* Enter the index, or index patterns to be part of the alias.
* Select `Create alias`.

To edit an alias:
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

* Select the alias you want to edit.
* Select the `Actions` button.
* Select `Edit` from the drop-down menu.

To delete an alias:
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

* Select the alias you want to edit.
* Select the `Actions` button.
* Select `Delete` from the drop-down menu.

(Screenshots)

## Rollup Jobs

The `Rollup Jobs` section under `Index Management` allows you to create or update index rollup jobs.

To create a rollup job:
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

* Select the blue `Create rollup job` button on the `Rollup Jobs` page under `Index Management`.
* Set the name, source index, and target index.
* Select `Next`.
* Set the timestamp field and interval type.
* Optionally you can set additional aggregations and additional metrics.
* Select `Next`.
* Under `Schedule`, check or uncheck `Enable job by default`.
* Set the Continuous, execution frequency, rollup interval and page per execution settings.
* Additionally, you can set an execution delay.
* Select `Next`.
* Review the settings for the rollup job and select `Create`.

You can also disable and enable rollup jobs by selecting the corresponding buttons on the `Rollup Jobs` page.

(Screenshots)

## Transform Jobs

Using the admin UI in OpenSearch Dashboards, you can create, start, stop, and complete operations with [transform]({{site.url}}{{site.baseurl}}/im-plugin/index-transforms/transforms-apis/) jobs.

To create a transform job:
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

* Select the blue `Create transform job` button on the `Transform Jobs` page under `Index Management`.
* Set the name, source index, and target index.
* Select `Next`.
* Select the fields to transform. From the table above, select a field you want to transform by clicking `+` next to the field name.
* Select `Next`.
* Check or uncheck `Job enabled by default`.
* Set wheter the schedule is continuous and the transform execution interval.
* Optionally you can set pages per execution under the `Advanced` drop-down.
* Select `Next`.
* Review the settings for the rollup job and select `Create`.

You can also disable and enable rollup jobs by selecting the corresponding buttons on the `Transform Jobs` page.

(Screenshots)

## Long running operation status check
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

Certain index operations take time to complete (usually more than 30 secs, but could take tens of minutes or hours). This is tracked on the index status on indices page.
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

For reindex, shrink, and split operations as they are one-time operations and not recursive, you can check the new index status for the progress of these operations.
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

## Security Integration

Permission control is managed with existing [permissions]({{site.url}}{{site.baseurl}}/security-plugin/access-control/permissions/) or action groups that are enforced at the API level. There is currently no UI level permission control. Whoever can access the ISM plugin is able to view new pages, but whether they can make changes depends on whether they have permission to run the related APIs.
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

## Error Handling

Similar to API calls, if the operation fails immediately, you will be notified with an error message. However, if it is a long running operation, you will be notified of the failure at the time of failure, or you can check the index status on the `Indices` page.

(Screenshot)

## Notifications

The admin UI uses the notification plugin to inform you of the completion of long running operations such as split, shrink, and reindex.
ariamarble marked this conversation as resolved.
Show resolved Hide resolved
21 changes: 21 additions & 0 deletions _dashboards/admin-ui-index/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
layout: default
title: Admin UI for index operations in OpenSearch Dashboards
nav_order: 1
has_children: true
redirect_from:
- /dashboards/admin-ui-index/
---

# Admin UI for index operations in OpenSearch Dashboards
Introduced 2.5
{: .label .label-purple }

The admin user interface (UI) for index operation allows you to perform common index operations through a user-friendly interface and prevent unintentional changes.
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

The admin UI interface allows you to perform basic cluster administrative operations, or to view cluster health metrics and status. While there have been some administration user experiences in OpenSearch Dashboards (ISM, Alerting on HTTP inputs, Security, etc.), there is now a unified web UI experience for cluster administrators to administer their deployments.

(Screenshot)

Screenshot test
<img src="{{site.url}}{{site.baseurl}}/images/dashboard-flight.png" alt="User interface showing several data visualizations">
123 changes: 123 additions & 0 deletions _dashboards/admin-ui-index/snapshot-management.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
---
layout: default
title: Snapshot Management
parent: Admin UI for index operations in OpenSearch Dashboards
nav_order: 20
---

# Snapshot Management

The Snapshot Management section in the admin UI allows you to preform operations available in the [Snapshots API]({{site.url}}{{site.baseurl}}/api-reference/snapshots/index/) from OpenSearch Dashboards' web UI.
Introduced 2.5
{: .label .label-purple }

## Snapshot Policies

[Snapshot Management]({{site.url}}{{site.baseurl}}/opensearch/snapshots/snapshot-management) (SM) lets you automate taking snapshots. To use this feature, you need to install the [Index Management (IM) Plugin]({{site.url}}{{site.baseurl}}/im-plugin/index/). Snapshots store only incremental changes since the last snapshot. Thus, while taking an initial snapshot may be a heavy operation, subsequent snapshots have minimal overhead. To set up automatic snapshots, you have to create a snapshot policy with a desired SM schedule and configuration.
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

When you create an SM policy, its document ID is given the name `<policy_name>-sm-policy`. Because of this, SM policies have to obey the following rules:

* SM policies must have unique names.
* You cannot update the policy name after its creation.

SM-created snapshots have names in the format `<policy_name>-<date>-<random number>`. Two snapshots created by different policies at the same time always have different names because of the `<policy_name>` prefix. To avoid name collisions within the same policy, each snapshot’s name contains a random string suffix.

Each policy has associated metadata that stores the policy status. Snapshot Management saves SM policies and metadata in the system index and reads them from the system index. Thus, Snapshot Management depends on the OpenSearch cluster’s indexing and searching functions. The policy’s metadata keeps information about the latest creation and deletion only. The metadata is read before running every scheduled job so that SM can continue execution from the previous job’s state. You can view the metadata using the explain API.

An SM schedule is a cron expression. It consists of two parts: a creation schedule and a deletion schedule. You must set up a creation schedule that specifies the frequency and timing of snapshot creation. Optionally, you can set up a separate schedule for deleting snapshots.

An SM configuration includes the indices and repository for the snapshots and supports all parameters you can define when creating a snapshot. Additionally, you can specify the format and time zone for the date used in the snapshot’s name.

To create a snapshot policy:

* Select the blue `Create policy` button in the `Snapshot Policies` section under `Snapshot Management`.
* Enter a policy name.
* Select your source index and snapshot repository.
* Configure your schedule. This can be set hourly, daily, weekly, monthly, or as a cron expression.
* Set your retention period.
* Choose whether or not to enable notifications.

(Screenshot)

Optional advanced settings include:

* Include cluster state in snapshots.
* Ignore unavailable indices.
* Allow partial snapshots.

(Screenshot)

You can also disable and enable snapshot policies using the corresponding buttons on the `Snapshot Policies` page.

(Screenshot)

## Snapshots

[Snapshots]({{site.url}}{{site.baseurl}}/opensearch/snapshots/index/) are backups of a cluster’s indices and state. The state includes cluster settings, node information, index metadata (mappings, settings, templates, etc.), and shard allocation.

Snapshots have two main uses:

1. Recovering from failure

For example, if cluster health goes red, you might restore the red indexes from a snapshot.

2. Migrating from one cluster to another

For example, if you’re moving from a proof-of-concept to a production cluster, you might take a snapshot of the former and restore it on the latter.

You can take and restore snapshots using the admin UI in Dashboards.

If you need to automate taking snapshots, you can use the Snapshot policies feature as described in the previous section.

#### Take snapshot

To take a snapshot, navigate to the `Snapshots` section under `Snapshot management`. Then select the blue `Take snapshot` button. This [creates]({{site.url}}{{site.baseurl}}/api-reference/snapshots/create-snapshot/) a snapshot within an existing repository. To learn more about snapshots, see [Snapshots]({{site.url}}{{site.baseurl}}/opensearch/snapshots/index).

(Screenshot)

To view a list of your repositories, select the `Repositories` section under `Snapshot Management`.

(Screenshot)

#### Delete

[Deletes]({{site.url}}{{site.baseurl}}/api-reference/snapshots/delete-snapshot/) a snapshot from a repository.

* To view a list of your repositories, select `Repositories` under the `Snapshot Management` section.
* To view a list of your snapshots, select `Snapshots` under the `Snapshot Management` section.

(Screenshot)

#### Restore

[Restores]({{site.url}}{{site.baseurl}}/api-reference/snapshots/restore-snapshot/) a snapshot of a cluster or specified data streams and indices.

(Screenshot)

## Repositories

`Repositories` under the `Snapshot Management` section of the admin UI allows you to see all remote storage locations used to store snapshots configured in the cluster.

(Screenshot)

To add a repository, select the blue `Create repository` button. Then, enter the `Repository name`, `Repository type`, and `Location`.

(Screenshot)

You can also select the `Advanced settings` drop down to enter a JSON config roe a repository. Storage locations such as S3 will require this custom configuration.

(Screenshot)

#### Register snapshot repository

Before you can take a snapshot, you have to “[register]({{site.url}}{{site.baseurl}}/opensearch/snapshots/snapshot-restore#register-repository)” a snapshot repository. A snapshot repository is just a storage location: a shared file system, Amazon S3, Hadoop Distributed File System (HDFS), Azure Storage, etc.

To create a snapshot repository. select the blue `Create repository` button.

(Screenshot)

#### Delete snapshot repository configuration

To delete a snapshot repository configuration, select the repository in the `Repositories` list and select the `Delete` button above.

(Screenshot)
Binary file added images/admin-ui-index/aliases.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/admin-ui-index/apply-policy.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/admin-ui-index/create-alias.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/admin-ui-index/create-template.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/admin-ui-index/reindex-expanded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/admin-ui-index/reindex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/admin-ui-index/shrink.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/admin-ui-index/split-expanded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/admin-ui-index/split.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/admin-ui-index/templates.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/admin-ui-index/view-template.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.