Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Configuring an Index Recycle Bin for an Elasticsearch Cluster

Updated on 2024-09-14 GMT+08:00

With Elasticsearch clusters, indexes are deleted without first being put into a recycle bin. To allow users to restore data after misdeletion, CSS provides an index recycle bin. Similar to other recycle bins, the index recycle bin temporarily stores deleted indexes so that users can restore them before they are finally removed from the recycle bin. This helps to improve cluster data reliability.

Constraints

  • Only Elasticsearch 7.10.2 clusters support the index recycle bin.
  • With the index recycle bin enabled, after you use the DELETE API to move an index to the recycle bin, the cluster status may stay RED for a short period of time. This is because putting the index into the recycle bin causes the index to be closed, and the Elasticsearch cluster status becomes RED when there are closed indexes.
  • When a restoration API is used to restore an index from the recycle bin, the cluster status may also stay RED for a short period of time. This is because restoring an index from the recycle bin causes that index to be reopened, and when it happens, Elasticsearch needs to re-initialize shards. This causes the cluster status to become RED momentarily.
  • Indexes stored in the recycle bin are still part of the cluster metadata. Before they are removed from the recycle bin, same-name indexes cannot be created for the cluster.

Enabling the Index Recycle Bin

Run the following command to enable the index recycle bin:

PUT _cluster/settings
{
  "persistent": {
    "index.trash.enabled": true
  }
}
Table 1 Configuration items

Configuration Item

Description

index.trash.enabled

Whether to enable the index recycle bin. The default value is false. This setting is compatible with the open-source Elasticsearch. Setting this parameter to true enables the index recycle bin. After an index is deleted, the index is stored in the recycle bin. You need to delete the index again to permanently delete the index data.

indices.trash.keep.time

Duration for retaining indexes in the recycle bin. The default value is 1d, meaning indexes will be retained in the recycle bin for one day before they are permanently deleted. The minimum value is 1d.

NOTE:
The following command deletes an index:
DELETE {INDEX_NAME}

INDEX_NAME indicates the name of the index to be deleted. Wildcards can be used to specify indexes.

Viewing Indexes in the Recycle Bin

Run the following command to view indexes in the index recycle bin:

GET _cat/trash?v=true&s=index
Table 2 Parameters

Parameter

Description

v

Whether to display the table header when the return format is a table.

  • true: display the table header.
  • false: not display the table header.

The default value is false.

s

Index sorting fields. Options include index, uuid, pri, rep, trash.ts, and delete.time.

format

Return format of the command. The default format is table. Other options include json, yaml, cobr, and smile. cobr and smile are binary formats.

h

Set the column names to be displayed. By default, all column names are displayed. To specify the column names you want to display, separate them using commas (,), for example, h=index,uuid,delete.time.

The following is an example of the output.

index    uuid                   pri rep      trash.ts delete.time
index1   CMD3FCLzTOyTg4RUekWNNA   1   1 1714465116615       23.6h
index1   6ATijuu6SfqamVI-WMyOKg   1   1 1714466233898       23.9h
Table 3 Parameters in the output

Column

Description

index

Index name

uuid

Index UUID

pri

Number of shards of an index

rep

Number of replicas of an index

trash.ts

Time when an index was moved to the recycle bin

delete.time

Remaining retention duration of an index in the recycle bin. When the value changes to 0, the index is permanently deleted.

Restoring an Index from the Recycle Bin

Run the following command to restore an index from the recycle bin:

POST /trash/recover/{INDEX_NAME}

INDEX_NAME indicates the name of the index to be restored. Wildcards can be used to specify indexes.

Emptying the Recycle Bin

Run the following command to clear the recycle bin:

POST trash/empty

Emptying the recycle bin will permanently delete all data in it. Please exercise caution.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback