Created
August 5, 2016 06:54
-
-
Save anam-hossain/fcbfe44c8bb2eae2c8e508231295efd8 to your computer and use it in GitHub Desktop.
Install Elasticsearch on (Homestead/Laravel Forge/Ubuntu 16.04)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo ">> Installing Elastic GPG Key" | |
wget -O - http://packages.elasticsearch.org/GPG-KEY-elasticsearch | apt-key add - | |
echo ">> Adding deb package" | |
echo "deb http://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list | |
echo ">> Updating apt" | |
add-apt-repository ppa:webupd8team/java | |
apt-get update | |
echo ">> Pre-agreeing to Oracle License" | |
echo debconf shared/accepted-oracle-license-v1-1 select true | \ | |
sudo debconf-set-selections | |
echo debconf shared/accepted-oracle-license-v1-1 seen true | \ | |
sudo debconf-set-selections | |
echo ">> Installing Java and Elastic Search" | |
apt-get -y install oracle-java7-installer elasticsearch | |
echo ">> Java Installed" | |
echo ">> Elastic Search Installed" | |
echo ">> Scheduling Elasticsearch" | |
update-rc.d elasticsearch defaults 95 10 | |
echo ">> Starting Elasticsearch" | |
/etc/init.d/elasticsearch start | |
echo ">> Running on port 9200. Make sure to add a firewall rule if you need external access." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment