ElasticSearch on ubuntu
For installation run these commands
sudo apt-get install elasticsearch
sudo systemctl daemon-reload
To automatically start elasticsearch when system reboots
sudo systemctl enable elasticsearch.service
Navigate to file /etc/elasticsearch/elasticsearch.yml
Edit the file and uncomment following lines
# network.host: localhost
# http.port: 9200
Change to the following (make sure not leave any space)
network.host: localhost
http.port: 9200
Add new line
discovery.type: single-node
Navigate to file /etc/elasticsearch/jvm.options
Add the following lines
-Xms2g
-Xmx4g
You can change the above two lines according to your system's memory, here 2g represents 2GB. -Xms2g is a minimum of 2GB assigned to ES and -Xsmx4g is a maximum of 4GB assigned.
If you want to assign memory in MBs you can use
-Xms512m
will give a minimum of 512MB memory to ES.
NOTE: While removing comments from the files mentioned above. be careful not to leave any spaces from the line start this would not allow ElasticSearch to start
Run the following command to start
sudo systemctl start elasticsearch
curl http://localhost:9200/
Run this command to see the health of your ES cluster
curl -XGET 'localhost:9200/_cluster/health?pretty=true'
Plugin install in case of error:400
sudo /usr/share/elasticsearch/bin/elasticsearch-plugin install analysis-icu
For uninstallation run these commands
sudo apt-get remove --purge elasticsearch
sudo rm -rf /etc/elasticsearch
sudo rm -rf /var/lib/elasticsearch
ElasticSearch on MacBook / HomeBrew
Elastic publishes Homebrew formulae so you can install Elasticsearch with the Homebrew package manager.
To install with Homebrew, you first need to tap the Elastic Homebrew repository:
brew tap elastic/tap
Once you’ve tapped the Elastic Homebrew repo, you can use brew install to install the latest version of Elasticsearch:
brew install elastic/tap/elasticsearch-full
To install the Elasticsearch plugin on Mac use the following command
/usr/local/var/homebrew/linked/elasticsearch-full/bin/elasticsearch-plugin install <plugin_name>
Note that the path to bin may vary according to your system
/usr/local/var/homebrew/linked/elasticsearch-full/bin
Top comments (0)