Page MenuHomePhabricator

Update Elasticsearch on logstash* to elasticsearch-1.7.0.deb
Closed, ResolvedPublic

Description

1.6.1 or 1.7.0 fixes two security issues:
https://www.elastic.co/blog/elasticsearch-1-7-0-and-1-6-1-released

In addition OpenJDK fixes for the latest vulnerabilities in Java will probably be available by beginning of next week, so we can combine those two updates for the cluster restart.

Event Timeline

MoritzMuehlenhoff raised the priority of this task from to Needs Triage.
MoritzMuehlenhoff updated the task description. (Show Details)
fgiunchedi added a subscriber: fgiunchedi.
bd808 renamed this task from Update Elasticsearch on logstash* to Update Elasticsearch on logstash* to elasticsearch-1.7.0.deb.Jul 21 2015, 2:16 AM
bd808 set Security to None.

Upgraded deployment-logstash2 in beta cluster to elasticsearch-1.7.0.deb

Scheduled to start 2015-07-24T16:00Z

bd808 added a subscriber: Manybubbles.

Done. The addition of /_flush/synced in Elasticsearch 1.6.0 made this process much nicer than previous upgrades. The upgrade to 1.6.0 took a bit over 9 hours; the upgrade to 1.7.0 took less than 30 minutes.

#!/usr/bin/env bash

# Stop cluster from reallocating shards
curl -s -XPUT localhost:9200/_cluster/settings?pretty -d '{
  "transient" : {
    "cluster.routing.allocation.enable": "primaries"
  }
}'

# Set sync marker on idle shards
curl -s -XPOST 'localhost:9200/_flush/synced'

# Install new ES package
sudo service elasticsearch stop
sudo dpkg -i --force-confdef --force-confold /home/bd808/elasticsearch-1.7.0.deb
sudo service elasticsearch start

# Wait for service to restart
until curl -s localhost:9200/_cluster/health?pretty; do
    sleep 1
done

# Re-enable shard allocation
curl -s -XPUT localhost:9200/_cluster/settings?pretty -d '{
  "transient" : {
    "cluster.routing.allocation.enable": "all"
  }
}'

# Wait for the cluster to recover
until curl -s localhost:9200/_cluster/health?pretty |
    tee /tmp/health |
    grep green; do
    cat /tmp/health
    sleep 1
done

@Manybubbles said after that the curl -s -XPOST 'localhost:9200/_flush/synced' step shouldn't be necessary as Elasticsearch does this internally on idle shards.