2021-09-30 04:25:15 +08:00
|
|
|
[role="xpack"]
|
2022-02-16 01:19:04 +08:00
|
|
|
[[feature-migration-api]]
|
|
|
|
=== Feature migration APIs
|
2021-09-30 04:25:15 +08:00
|
|
|
++++
|
2022-02-16 01:19:04 +08:00
|
|
|
<titleabbrev>Feature migration</titleabbrev>
|
2021-09-30 04:25:15 +08:00
|
|
|
++++
|
|
|
|
|
2022-02-16 01:19:04 +08:00
|
|
|
include::{es-repo-dir}/migration/apis/shared-migration-apis-tip.asciidoc[]
|
2021-09-30 04:25:15 +08:00
|
|
|
|
2022-02-16 01:19:04 +08:00
|
|
|
Version upgrades sometimes require changes to how features store configuration
|
|
|
|
information and data in system indices. The feature migration APIs enable you to
|
|
|
|
see what features require changes, initiate the automatic migration process, and
|
|
|
|
check migration status.
|
2021-09-30 04:25:15 +08:00
|
|
|
|
2022-02-16 01:19:04 +08:00
|
|
|
Some functionality might be temporarily unavailable during the migration
|
|
|
|
process.
|
|
|
|
|
|
|
|
[[feature-migration-api-request]]
|
2021-09-30 04:25:15 +08:00
|
|
|
==== {api-request-title}
|
|
|
|
|
2022-05-03 08:05:02 +08:00
|
|
|
`GET /_migration/system_features`
|
2021-09-30 04:25:15 +08:00
|
|
|
|
2022-05-03 08:05:02 +08:00
|
|
|
`POST /_migration/system_features`
|
2022-02-16 01:19:04 +08:00
|
|
|
|
|
|
|
[[feature-migration-api-prereqs]]
|
2021-09-30 04:25:15 +08:00
|
|
|
==== {api-prereq-title}
|
|
|
|
|
|
|
|
* If the {es} {security-features} are enabled, you must have the `manage`
|
Implement framework for migrating system indices (#78951)
This PR adds a framework for migrating system indices as necessary prior
to Elasticsearch upgrades. This framework uses REST APIs added in
another commit:
- GET _migration/system_features
This API, which gets the status of "features" (plugins which own system
indices) with regards to whether they need to be upgraded or not. As of
this PR, this API also reports errors encountered while migrating system
indices alongside the index that was being processed when this occurred.
As an example of this error reporting:
```json
{
"feature_name": "logstash_management",
"minimum_index_version": "8.0.0",
"upgrade_status": "ERROR",
"indices": [
{
"index": ".logstash",
"version": "8.0.0",
"failure_cause": {
"error": {
"root_cause": [
{
"type": "runtime_exception",
"reason": "whoopsie",
"stack_trace": "<omitted for brevity>"
}
],
"type": "runtime_exception",
"reason": "whoopsie",
"stack_trace": "<omitted for brevity>"
}
}
}
]
}
```
- POST _migration/system_features
This API starts the migration process. The API for this has no changes,
but when called, any system indices which need to be migrated will be
migrated, with status information stored in the cluster state for later
use by the GET _migration/system_features API.
2021-10-20 08:52:22 +08:00
|
|
|
<<privileges-list-cluster,cluster privilege>> to use this API.
|
2021-09-30 04:25:15 +08:00
|
|
|
|
2022-02-16 01:19:04 +08:00
|
|
|
[[feature-migration-api-desc]]
|
|
|
|
==== {api-description-title}
|
|
|
|
|
|
|
|
Submit a GET request to the `_migration/system_features` endpoint to see what
|
|
|
|
features need to be migrated and the status of any migrations that are in
|
|
|
|
progress.
|
|
|
|
|
|
|
|
Submit a POST request to the endpoint to start the migration process.
|
|
|
|
|
|
|
|
[[feature-migration-api-example]]
|
2021-09-30 04:25:15 +08:00
|
|
|
==== {api-examples-title}
|
|
|
|
|
2022-02-16 01:19:04 +08:00
|
|
|
When you submit a GET request to the `_migration/system_features` endpoint, the
|
|
|
|
response indicates the status of any features that need to be migrated.
|
2021-09-30 04:25:15 +08:00
|
|
|
|
|
|
|
[source,console]
|
|
|
|
--------------------------------------------------
|
|
|
|
GET /_migration/system_features
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
Example response:
|
|
|
|
|
|
|
|
[source,console-result]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"features" : [
|
2021-10-08 03:18:47 +08:00
|
|
|
{
|
|
|
|
"feature_name" : "async_search",
|
|
|
|
"minimum_index_version" : "8.0.0",
|
2021-10-20 00:15:26 +08:00
|
|
|
"migration_status" : "NO_MIGRATION_NEEDED",
|
2021-10-08 03:18:47 +08:00
|
|
|
"indices" : [ ]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"feature_name" : "enrich",
|
|
|
|
"minimum_index_version" : "8.0.0",
|
2021-10-20 00:15:26 +08:00
|
|
|
"migration_status" : "NO_MIGRATION_NEEDED",
|
2021-10-08 03:18:47 +08:00
|
|
|
"indices" : [ ]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"feature_name" : "fleet",
|
|
|
|
"minimum_index_version" : "8.0.0",
|
2021-10-20 00:15:26 +08:00
|
|
|
"migration_status" : "NO_MIGRATION_NEEDED",
|
2021-10-08 03:18:47 +08:00
|
|
|
"indices" : [ ]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"feature_name" : "geoip",
|
|
|
|
"minimum_index_version" : "8.0.0",
|
2021-10-20 00:15:26 +08:00
|
|
|
"migration_status" : "NO_MIGRATION_NEEDED",
|
2021-10-08 03:18:47 +08:00
|
|
|
"indices" : [ ]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"feature_name" : "kibana",
|
|
|
|
"minimum_index_version" : "8.0.0",
|
2021-10-20 00:15:26 +08:00
|
|
|
"migration_status" : "NO_MIGRATION_NEEDED",
|
2021-10-08 03:18:47 +08:00
|
|
|
"indices" : [ ]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"feature_name" : "logstash_management",
|
|
|
|
"minimum_index_version" : "8.0.0",
|
2021-10-20 00:15:26 +08:00
|
|
|
"migration_status" : "NO_MIGRATION_NEEDED",
|
2021-10-08 03:18:47 +08:00
|
|
|
"indices" : [ ]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"feature_name" : "machine_learning",
|
|
|
|
"minimum_index_version" : "8.0.0",
|
2021-10-20 00:15:26 +08:00
|
|
|
"migration_status" : "NO_MIGRATION_NEEDED",
|
2021-10-08 03:18:47 +08:00
|
|
|
"indices" : [ ]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"feature_name" : "searchable_snapshots",
|
|
|
|
"minimum_index_version" : "8.0.0",
|
2021-10-20 00:15:26 +08:00
|
|
|
"migration_status" : "NO_MIGRATION_NEEDED",
|
2021-10-08 03:18:47 +08:00
|
|
|
"indices" : [ ]
|
|
|
|
},
|
2021-09-30 04:25:15 +08:00
|
|
|
{
|
|
|
|
"feature_name" : "security",
|
2021-10-08 03:18:47 +08:00
|
|
|
"minimum_index_version" : "8.0.0",
|
2021-10-20 00:15:26 +08:00
|
|
|
"migration_status" : "NO_MIGRATION_NEEDED",
|
2021-10-08 03:18:47 +08:00
|
|
|
"indices" : [ ]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"feature_name" : "tasks",
|
|
|
|
"minimum_index_version" : "8.0.0",
|
2021-10-20 00:15:26 +08:00
|
|
|
"migration_status" : "NO_MIGRATION_NEEDED",
|
2021-10-08 03:18:47 +08:00
|
|
|
"indices" : [ ]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"feature_name" : "transform",
|
|
|
|
"minimum_index_version" : "8.0.0",
|
2021-10-20 00:15:26 +08:00
|
|
|
"migration_status" : "NO_MIGRATION_NEEDED",
|
2021-10-08 03:18:47 +08:00
|
|
|
"indices" : [ ]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"feature_name" : "watcher",
|
|
|
|
"minimum_index_version" : "8.0.0",
|
2021-10-20 00:15:26 +08:00
|
|
|
"migration_status" : "NO_MIGRATION_NEEDED",
|
2021-10-08 03:18:47 +08:00
|
|
|
"indices" : [ ]
|
2021-09-30 04:25:15 +08:00
|
|
|
}
|
|
|
|
],
|
2021-10-20 00:15:26 +08:00
|
|
|
"migration_status" : "NO_MIGRATION_NEEDED"
|
2021-09-30 04:25:15 +08:00
|
|
|
}
|
|
|
|
--------------------------------------------------
|
2021-10-20 00:15:26 +08:00
|
|
|
// TESTRESPONSE[s/"minimum_index_version" : "8.0.0"/"minimum_index_version" : $body.$_path/]
|
2021-09-30 04:25:15 +08:00
|
|
|
|
|
|
|
|
2022-02-16 01:19:04 +08:00
|
|
|
When you submit a POST request to the `_migration/system_features` endpoint to
|
|
|
|
start the migration process, the response indicates what features will be
|
|
|
|
migrated.
|
2021-09-30 04:25:15 +08:00
|
|
|
|
|
|
|
[source,console]
|
|
|
|
--------------------------------------------------
|
|
|
|
POST /_migration/system_features
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
Example response:
|
|
|
|
|
|
|
|
[source,console-result]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"accepted" : true,
|
|
|
|
"features" : [
|
|
|
|
{
|
2022-02-16 01:19:04 +08:00
|
|
|
"feature_name" : "security" <1>
|
2021-09-30 04:25:15 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
Implement framework for migrating system indices (#78951)
This PR adds a framework for migrating system indices as necessary prior
to Elasticsearch upgrades. This framework uses REST APIs added in
another commit:
- GET _migration/system_features
This API, which gets the status of "features" (plugins which own system
indices) with regards to whether they need to be upgraded or not. As of
this PR, this API also reports errors encountered while migrating system
indices alongside the index that was being processed when this occurred.
As an example of this error reporting:
```json
{
"feature_name": "logstash_management",
"minimum_index_version": "8.0.0",
"upgrade_status": "ERROR",
"indices": [
{
"index": ".logstash",
"version": "8.0.0",
"failure_cause": {
"error": {
"root_cause": [
{
"type": "runtime_exception",
"reason": "whoopsie",
"stack_trace": "<omitted for brevity>"
}
],
"type": "runtime_exception",
"reason": "whoopsie",
"stack_trace": "<omitted for brevity>"
}
}
}
]
}
```
- POST _migration/system_features
This API starts the migration process. The API for this has no changes,
but when called, any system indices which need to be migrated will be
migrated, with status information stored in the cluster state for later
use by the GET _migration/system_features API.
2021-10-20 08:52:22 +08:00
|
|
|
// TESTRESPONSE[skip: can't actually upgrade system indices in these tests]
|
2021-09-30 04:25:15 +08:00
|
|
|
|
2022-02-16 01:19:04 +08:00
|
|
|
<1> {es} security will be migrated before the cluster is upgraded.
|
2021-09-30 04:25:15 +08:00
|
|
|
|
2022-02-16 01:19:04 +08:00
|
|
|
Subsequent GET requests will return the status of the migration process.
|