Skip to content

Instantly share code, notes, and snippets.

@karthik20522
Last active January 27, 2016 15:42
Show Gist options
  • Save karthik20522/f6b0d956e9db14873137 to your computer and use it in GitHub Desktop.
Save karthik20522/f6b0d956e9db14873137 to your computer and use it in GitHub Desktop.
es_upgrade in place
curl -X POST http://localhost:9200/_cluster/nodes/_local/_shutdown
wget https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.1.1/elasticsearch-2.1.1.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
mv elasticsearch-* elasticsearch
rm -rf /usr/share/elasticsearch
mkdir /usr/share/elasticsearch
rsync -a elasticsearch/ /usr/share/elasticsearch
rm -rf /usr/share/elasticsearch/config
chmod -R 777 /usr/share/elasticsearch
ECONF=/etc/sysconfig/elasticsearch
ECONFIG=/etc/elasticsearch/dsa/elasticsearch.yml
CLUSTER_NAME='dsa-elasticsearch'
cat /dev/null > ${ECONFIG}
echo "cluster.name: ${CLUSTER_NAME}" >> ${ECONFIG}
echo "node.master: true" >> ${ECONFIG}
echo "node.data: true" >> ${ECONFIG}
echo "index.number_of_shards: 7" >> ${ECONFIG}
echo "index.number_of_replicas: 1" >> ${ECONFIG}
echo "bootstrap.mlockall: true" >> ${ECONFIG}
echo "threadpool.index.type: fixed" >> ${ECONFIG}
echo "threadpool.index.size: 8" >> ${ECONFIG}
echo "threadpool.index.queue_size: 1000" >> ${ECONFIG}
echo "index.refresh_interval: 5s" >> ${ECONFIG}
echo "script.inline: on" >> ${ECONFIG}
echo "script.indexed: on" >> ${ECONFIG}
echo "http.compression: true" >> ${ECONFIG}
echo "cloud.aws.region: us-west-2" >> ${ECONFIG}
echo "discovery.type: ec2" >> ${ECONFIG}
echo "discovery.ec2.groups: sg-1aa6357f" >> ${ECONFIG}
echo "network.host: 0.0.0.0" >> ${ECONFIG}
echo "discovery.zen.minimum_master_nodes: 3" >> ${ECONFIG}
echo "gateway.recover_after_nodes: 3" >> ${ECONFIG}
echo "gateway.expected_nodes: 3" >> ${ECONFIG}
echo "gateway.recover_after_time: 5m" >> ${ECONFIG}
echo "action.destructive_requires_name: true" >> ${ECONFIG}
echo "action.disable_shutdown: true" >> ${ECONFIG}
echo "cluster.routing.allocation.disk.threshold_enabled: true" >> ${ECONFIG}
echo "cluster.info.update.interval: 60s" >> ${ECONFIG}
echo "index.load_fixed_bitset_filters_eagerly: false" >> ${ECONFIG}
echo "indices.cache.filter.size:: 20%" >> ${ECONFIG}
echo "index.merge.scheduler.max_thread_count: 1" >> ${ECONFIG}
echo "cloud.node.auto_attributes: true" >> ${ECONFIG}
echo "discovery.zen.ping.multicast.enabled: false" >> ${ECONFIG}
echo "path.data: /var/elasticsearch/data" >> ${ECONFIG}
echo "path.logs: /var/elasticsearch/logs" >> ${ECONFIG}
echo "http.cors.enabled : true" >> ${ECONFIG}
echo "Installing elastic search plugins"
/usr/share/elasticsearch/bin/plugin install mobz/elasticsearch-head
/usr/share/elasticsearch/bin/plugin install royrusso/elasticsearch-HQ
/usr/share/elasticsearch/bin/plugin install cloud-aws
/usr/share/elasticsearch/bin/plugin install lmenezes/elasticsearch-kopf
/etc/init.d/elasticsearch-dsa restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment