cat es-change-alias-pointer.md

ElasticSearch 維運 - Change Alias Pointer

2021-06-24 1 min技術
ElasticSearch 維運 - Change Alias Pointer
tree .

Change Alias Pointer

The alias is your writer enterance, sometimes if you need to change the alias pointer to different concrete indices.

Run Step 1. Create the new target concrete indices

PUT /test_new_target_indices

Run Step2. Change pointer

[WARN]
Update old indices is_write_index to false, the new one to true
POST /_aliases
{
    "actions" : [
        {
            "add" : {
                 "index" : "qlog-f-vbs-202104-0430-000006",
                 "alias" : "qlog-f-vbs-202104",
                 "is_write_index" : false
            }
        },
        {
            "add" : {
                 "index" : "test_new_target_indices",
                 "alias" : "qlog-f-vbs-202104",
                 "is_write_index" : true
            }
        }
    ]
}