ElasticSearch Direct Upgrade
Overview
Unlike rolling upgrades, direct upgrades involve migrating from an older version to a newer one in a single coordinated operation.
This comprehensive guide outlines the step-by-step process for deploying an Elasticsearch 8.11.3 cluster with enhanced security features. The document not only covers the initial deployment of the cluster but also includes instructions for seamlessly migrating data from an existing Elasticsearch cluster to the new one, allowing for a direct upgrade.
Steps
Clone the DIGIT-DevOps repo and checkout to the branch <branch_name>.
git clone https://github.com/egovernments/DIGIT-DevOps.git
git checkout digit-lts-go
code .If you want to make any changes to the elasticsearch cluster like namespaces etc. You'll find the helm chart for elastic search in the path provided below. In the below chart, security is enabled for elasticsearch. If you want to disable the security, please set the environment variable
xpack.security.enabledas false in the helmchart statefulset template.
cd deploy-as-code/helm/backbone-services/elasticsearch-master
cd deploy-as-code/helm/backbone-services/elasticsearch-dataDeploy the Elastic Search Cluster using the below commands.
cd deploy-as-code/deployer
export KUBECONFIG=<path_to_kubeconfig>
kubectl config current-context
go run main.go deploy -e <env_file_name> elasticsearch-master
go run main.go deploy -e <env_file_name> elasticsearch-master
Check the pods status using the below command.
Once all pods are running, execute the below commands inside the playground pod to dump data from the old elasticsearch cluster and restore it to the new elasticsearch cluster.
Using the above script, you can take the data dump from the old cluster and restore it in the new elasticsearch in a single command.
After restoring the data successfully in the new elasticsearch cluster, check the cluster health and document count using the below command.
Now the deployment and restoring the data are completed successfully. It's time to change the es_url and indexer_url in egov-config configmap using the below command.
Restart all the pods which have a dependency on elasticsearch to pick a new elasticsearch_url.
Last updated
Was this helpful?