How to Rebuild Search Index Without Downtime¶
Customer Managed Applies to customer-managed instances of Alation
Applies from version 2023.3.5
Warning
Initiate these steps only when directed.
The steps require backend access to the Alation server.
Rebuilding the search index operates in the background and does not require downtime. The process duration depends on your Alation database size and may extend to several hours on large instances.
To rebuild the search index:
Use SSH to connect to your Alation server.
The process is designed to be interruption-free, but given its potential length, we recommend using a session management tool like Screen for tracking it. For example, start a Screen session:
screen -SL rebuild_es_index
Enter the Alation shell.
sudo /etc/init.d/alation shell
Switch to the
alationuser.sudo su alation
Start the index rebuild with the following script.
python /opt/alation/django/rosemeta/one_off_scripts/search_rebuild_index.pyc --using default --using default_large
The script runs in the background. A completion message will appear upon success:
"message": "[Job <64>] Updating status: NA --> SUCCEEDED", "timestamp": "2024-02-01T02:17:13.509146Z", "level": "INFO"}[Job <64>] Updating status: NA --> SUCCEEDED
Verify indices with the following command:
curl localhost:9200/_cat/indices?vLook for indices prefixed with
second_in the output. This means that the new indices have been created successfully.
Update index aliases with the next command. Follow the prompts, typing
yand pressing Enter to confirm each action. See an example below.python /opt/alation/django/rosemeta/one_off_scripts/search_alias_update.pycExample
Are you sure you want to reassign search index aliases (y/n)?y GET http://localhost:9200/_alias [status:200 duration:0.003s] Are you sure you want to reassign search index alias: live (y/n)?y POST http://localhost:9200/_aliases [status:200 duration:0.011s]
On completion, exit from the
alationuser and the Alation shell by using the commandexittwo times.