在CentOS6.5上运行ElasticSearch

以下是在Vagrant上启动的CentOS6.5服务器,从官方网站上下载ElasticSearch的tar文件并启动的步骤备忘录。

从官方网站上下载tar文件。该版本是截至现在(2014年11月16日)的1.4.0版本。

$ sudo yum install wget java-1.8.0-openjdk-devel -y
$ wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.0.tar.gz
$ tar -xvf elasticsearch-1.4.0.tar.gz

启动ElasticSearch。

$ cd elasticsearch-1.4.0/
$ ./bin/elasticsearch
[2014-11-16 04:29:28,660][INFO ][node                     ] [Thena] version[1.4.0], pid[2551], build[bc94bd8/2014-11-05T14:26:12Z]
[2014-11-16 04:29:28,661][INFO ][node                     ] [Thena] initializing ...
[2014-11-16 04:29:28,668][INFO ][plugins                  ] [Thena] loaded [], sites []
[2014-11-16 04:29:32,724][INFO ][node                     ] [Thena] initialized
[2014-11-16 04:29:32,731][INFO ][node                     ] [Thena] starting ...
[2014-11-16 04:29:32,968][INFO ][transport                ] [Thena] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/10.0.2.15:9300]}
[2014-11-16 04:29:33,030][INFO ][discovery                ] [Thena] elasticsearch/9IhKlDvZQE-T0zT5SXRaSA
[2014-11-16 04:29:36,873][INFO ][cluster.service          ] [Thena] new_master [Thena][9IhKlDvZQE-T0zT5SXRaSA][elastic-search][inet[/10.0.2.15:9300]], reason: zen-disco-join (elected_as_master)
[2014-11-16 04:29:36,929][INFO ][http                     ] [Thena] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/10.0.2.15:9200]}
[2014-11-16 04:29:36,930][INFO ][node                     ] [Thena] started

对ElasticSearch进行访问(通过HTTP请求)。

$ curl localhost:9200
{
  "status" : 200,
  "name" : "Thena",
  "cluster_name" : "elasticsearch",
  "version" : {
    "number" : "1.4.0",
    "build_hash" : "bc94bd81298f81c656893ab1ddddd30a99356066",
    "build_timestamp" : "2014-11-05T14:26:12Z",
    "build_snapshot" : false,
    "lucene_version" : "4.10.2"
  },
  "tagline" : "You Know, for Search"
}

结束了。

广告
将在 10 秒后关闭
bannerAds