elasticsearch on docker

# docker pull elasticsearch:6.8.5 
 SCRIPT=`realpath $0`
 BASE=`dirname $SCRIPT` 

         mkdir -p $BASE/esdata1
         docker run -p 9200:9200 --name elasticsearch -v $BASE/esdata1:/usr/share/elasticsearch/data \
         -e "http.host=0.0.0.0" \
         -e "cluster.name=elasticlogging" \
         -e "node.name=esnode1" \
         -e "node.master=true" \
         -e "node.data=true" \
         -e "http.cors.allow-origin=*" \
         -e "ES_JAVA_OPTS=-Xms256m -Xmx256m" \
         -e "discovery.zen.minimum_master_nodes=1" \
         -d elasticsearch:6.8.5
 

         mkdir -p $BASE/esdata2
         docker run --name elasticsearch2 -v $BASE/esdata2:/usr/share/elasticsearch/data --link elasticsearch \
         -e "http.host=0.0.0.0" \
         -e "cluster.name=elasticlogging" \
         -e "node.name=esnode2" \
         -e "http.cors.allow-origin=*" \
         -e "ES_JAVA_OPTS=-Xms256m -Xmx256m" \
         -e "discovery.zen.ping.unicast.hosts=elasticsearch" \
         -d elasticsearch:6.8.5 

Leave a Reply

Your email address will not be published.

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