Java is a prerequisite for Elasticsearch. So please install java first.
First, create a new directory where you will install the search software, and move into it.
mkdir ~/utils
cd ~/utils
Visit Elasticsearch's download page to see the latest version.
Now download the latest version of Elasticsearch. At the time of writing this article, the latest version was 1.5.0.
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.5.0.zip
Install unzip:
sudo apt-get install unzip
Unzip the archive:
unzip elasticsearch-1.5.0.zip
Navigate to the directory where you extracted it:
cd elasticsearch-1.5.0
Launch Elasticsearch by issuing the following command:
bin/elasticsearch
It will take a few seconds for Elasticsearch to start up. You'll see some startup logs as it does. Elasticsearch will now be running in the terminal window.
Note: At some point you may want to run Elasticsearch as a service so you can control it withsudo service elasticsearch restart
and similar commands; see this tutorial aboutUpstart for tips. Alternately, you can install Elasticsearch from Ubuntu's repositories, although you'll probably get an older version.
Keep this terminal open. Make another SSH connection to your server in another terminal window and check if your instance is up and running:
curl -XGET http://localhost:9200
9200 is the default port for Elasticsearch. If everything goes well, you will see output similar to that shown below:
{
"status" : 200,
"name" : "Northstar",
"cluster_name" : "elasticsearch",
"version" : {
"number" : "1.5.0",
"build_hash" : "927caff6f05403e936c20bf4529f144f0c89fd8c",
"build_timestamp" : "2015-03-23T14:30:58Z",
"build_snapshot" : false,
"lucene_version" : "4.10.4"
},
"tagline" : "You Know, for Search"
}
Note: For the later part of this article, when you will be copying data, make sure that Elasticsearch is running (and on port 9200).
No comments:
Post a Comment