Skip to content

Instantly share code, notes, and snippets.

@EikeDehling
Last active September 14, 2017 09:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EikeDehling/e07aac236bb13f1a005b35d2d69fc1b0 to your computer and use it in GitHub Desktop.
Save EikeDehling/e07aac236bb13f1a005b35d2d69fc1b0 to your computer and use it in GitHub Desktop.
Shell script to install elastic 5.6 (as root) on debian
# Install elasticsearch
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -
apt-get install apt-transport-https
echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-5.x.list
apt-get update
apt-get install elasticsearch
# Configure memory settings
mkdir -p /etc/systemd/system/elasticsearch.service.d
echo -e "[Service]\nLimitMEMLOCK=infinity" > /etc/systemd/system/elasticsearch.service.d/elasticsearch.conf
# Configure elastic
sed -i '/#bootstrap.memory_lock: true/c\bootstrap.memory_lock: true' /etc/elasticsearch/elasticsearch.yml
sed -i '/#network.host: 192.168.0.1/c\network.host: 0.0.0.0' /etc/elasticsearch/elasticsearch.yml
# Start!
systemctl daemon-reload
systemctl enable elasticsearch.service
systemctl start elasticsearch.service
# Check it runs
curl http://localhost:9200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment