Elasticsearch rolling upgrade

Share the joy
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Step 1: Disable shard allocation

PUT _cluster/settings
{
“transient”: {
“cluster.routing.allocation.enable”: “none”
}
}

Step 2: Stop non-essential indexing and perform a synced flush (Optional)

POST _flush/synced

Step 3: Stop and upgrade a single node

# stop elasticsearch and kibana
sudo service elasticsearch stop
sudo service kibana stop

# remove plugins, if installed
sudo bin/plugin remove license
sudo bin/plugin remove kopf
sudo bin/plugin remove marvel-agent

# download debian
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.4.1.deb
sha1sum elasticsearch-5.4.1.deb
sudo dpkg -i elasticsearch-5.4.1.deb

# install plguins, if installed
cd /usr/share/elasticsearch/
sudo bin/plugin install license
sudo bin/plugin install marvel-agent

# reload and restart elasticsearch and kibana
sudo systemctl daemon-reload
sudo service elasticsearch start
sudo service kibana start

Step 4: Start the upgraded node
Confirm that started node joins the cluster
GET _cat/nodes

Step 5: Re-enable shard allocation
Once the node has joined the cluster, reenable shard allocation to start using the node
PUT _cluster/settings
{
“transient”: {
“cluster.routing.allocation.enable”: “all”
}
}

Step 6: Wait for the node to recover
GET _cat/health


Share the joy
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.