1.2 installation
Elasticsearch requires at least Java 7. We recommend that you use the JDK version 1.8.0_25 of Oracle. When you install Elasticsearch , please check the Java runtime version first.
Java-version Echo $JAVA _home
once we have installed Java, we can download and run Elasticsearch. Binary files can be downloaded from www.elastic.co/downloads and https://github.com/elastic/elasticsearch/releases . For each version, you can choose zip/tar 包
,或则
deb/rpm 包。
For simplicity, we use tar 包
.
Curl-l-O https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/ 2.1.1/elasticsearch-2.1.1.tar.gz
then unzip the following ( Windows users should unzip the zip package):
Tar-xvfelasticsearch-2.1.1.tar.gz
This will create a bunch of files and folders in your current directory. Then we enter the Bin directory as follows:
CD Elasticsearch-2.1.1/bin
now we are ready to start our node and single cluster(Windows users should run the Elasticsearch.bat file):
./elasticsearch
If all goes well, you should see a bunch of messages like this:
./elasticsearch
[2014-03-1313:42:17,218] [INFO] [Node] [Newgoblin] version[2.1.1],pid[2085], build[5c03844/2014-02-25t15:52:53z]
[2014-03-1313:42:17,219] [INFO] [Node] [Newgoblin]initializing ... [2014-03-1313:42:17,223] [INFO] [Plugins] [Newgoblin] Loaded [],sites [] [2014-03-1313:42:19,831][info][node][newgoblin] initialized [2014-03-1313: 42:19,832][info][node][newgoblin] starting ... [2014-03-1313:42:19,958] [INFO] [Transport] [Newgoblin] bound_address {inet[/0:0:0:0:0:0:0:0:9300]},publish_address {inet[/192.168.8.112:9300]} [ 2014-03-1313:42:23,030][info][cluster.service][newgoblin]new_master [newgoblin][rwmtgj3dqouz2r6zfl9v4g][ Mwubuntu1][inet[/192.168.8.112:9300]],reason:zen-disco-join (Elected_as_master)
[2014-03-1313:42:23,100] [INFO] [Discovery] [Newgoblin] elasticsearch/rwmtgj3dqouz2r6zfl9v4g
[2014-03-1313:42:23,125] [INFO] [HTTP] [Newgoblin] bound_address {inet[/0:0:0:0:0:0:0:0:9200]},publish_address {inet[/192.168.8.112:9200]} [ 2014-03-1313:42:23,629][info][gateway][newgoblin] recovered [1]indices into Cluster_state
[2014-03-1313:42:23,630] [INFO] [Node] [Newgoblin] Started
we can see that our node is called "Newgoblin"(you will have a different name) that has been started, electing itself as Master in a cluster. There is no need to pay attention to master meaning. The main point is that we have started a node in a cluster.
As mentioned earlier, we can rewrite the cluster or node name. This can be done at the command line when the Elasticsearch is started, as follows:
./elasticsearch--cluster.namemy_cluster_name--node.name My_node_name
also note that the labelHTTPinformation, aboutHTTPAddress (192.168.8.112) and Port (9200). By default,Elasticsearchusing Ports9200provided byREST API. The port is available for distribution.
This article is from the Java Architect's Road blog, so be sure to keep this source http://eric100.blog.51cto.com/2535573/1743465
ELASTICSEARCH2.X Handbook-1th Chapter Getting Started Guide-1.2 Installation