Skip to content

Instantly share code, notes, and snippets.

@MinCha
Created November 1, 2013 07:57
Show Gist options
  • Save MinCha/7262149 to your computer and use it in GitHub Desktop.
Save MinCha/7262149 to your computer and use it in GitHub Desktop.
start ElasticSearch multiple instances
#!/bin/bash
ip="`/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`"
for ((i=0; i<$1; i++)); do
hport=$(expr 21000 + $i)
tport=$(expr 22000 + $i)
name=$ip+$i
../bin/elasticsearch -Des.cluster.name=music-es-dev -Des.multicast.enabled=true -Des.http.port=$hport -Des.transport.tcp.port=$tport -Des.index.number_of_shards=10 -Des.index.number_of_replicas=4 -Des.node.name=$name
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment