Skip to content

Instantly share code, notes, and snippets.

@bugthesystem
Last active March 14, 2016 13:21
Show Gist options
  • Save bugthesystem/67b2c68930a168735052 to your computer and use it in GitHub Desktop.
Save bugthesystem/67b2c68930a168735052 to your computer and use it in GitHub Desktop.
#!/bin/bash
ELASTICSEARCH_VERSION=1.7
### Download and install the Public Signing Key
wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
### Setup Repository
echo "deb http://packages.elastic.co/elasticsearch/${ELASTICSEARCH_VERSION}/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elk.list
### Install Elasticsearch
sudo apt-get update && sudo apt-get install elasticsearch -y
### Use the following commands to ensure, that elasticsearch starts when the system is booted and then start up elasticsearch
sudo update-rc.d elasticsearch defaults 95 10
sudo service elasticsearch start
### Lets wait a little while ElasticSearch starts
sleep 20
### Make sure service is running
curl http://localhost:9200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment