1.下载运行Elasticsearch
1.下载解压elasticsearch
Elasticsearch官网地址:https://www.elastic.co/ Elasticsearch最新版下载地址:https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html
下载文件elasticsearch-1.7.2.zip到linux或Windows上,解压如下:
[lizhiwei@localhost ElasticSearch]$ ll
total 31028
drwxr-xr-x. 8 lizhiwei lizhiwei 4096 Oct 9 05:32 elasticsearch-1.7.2
-rwxrwxr-x. 1 lizhiwei lizhiwei 31766366 Oct 9 05:06 elasticsearch-1.7.2.zip
[lizhiwei@localhost ElasticSearch]$ cd elasticsearch-1.7.2
[lizhiwei@localhost elasticsearch-1.7.2]$ ll
total 52
drwxr-xr-x. 2 lizhiwei lizhiwei 4096 Sep 14 09:51 bin
drwxr-xr-x. 2 lizhiwei lizhiwei 4096 Sep 14 09:51 config
drwxrwxr-x. 3 lizhiwei lizhiwei 4096 Oct 9 05:17 data
drwxr-xr-x. 3 lizhiwei lizhiwei 4096 Sep 14 09:51 lib
-rw-rw-r--. 1 lizhiwei lizhiwei 11358 Sep 14 09:20 LICENSE.txt
drwxrwxr-x. 2 lizhiwei lizhiwei 4096 Oct 9 05:17 logs
-rw-rw-r--. 1 lizhiwei lizhiwei 150 Sep 14 09:20 NOTICE.txt
drwxrwxr-x. 4 lizhiwei lizhiwei 4096 Oct 9 05:38 plugins
-rw-rw-r--. 1 lizhiwei lizhiwei 8700 Sep 14 09:22 README.textile
[lizhiwei@localhost elasticsearch-1.7.2]$
2.运行elasticsearch
elasticsearch启动脚本在解压目录bin下:
[lizhiwei@localhost elasticsearch-1.7.2]$ cd bin/
[lizhiwei@localhost bin]$ ll
total 324
-rwxr-xr-x. 1 lizhiwei lizhiwei 8114 Sep 14 09:51 elasticsearch
-rw-rw-r--. 1 lizhiwei lizhiwei 901 Sep 14 09:51 elasticsearch.bat
-rw-rw-r--. 1 lizhiwei lizhiwei 2797 Sep 14 09:51 elasticsearch.in.bat
-rwxr-xr-x. 1 lizhiwei lizhiwei 2170 Sep 14 09:51 elasticsearch.in.sh
-rw-rw-r--. 1 lizhiwei lizhiwei 104448 Sep 14 09:22 elasticsearch-service-mgr.exe
-rw-rw-r--. 1 lizhiwei lizhiwei 103936 Sep 14 09:22 elasticsearch-service-x64.exe
-rw-rw-r--. 1 lizhiwei lizhiwei 80896 Sep 14 09:22 elasticsearch-service-x86.exe
-rwxr-xr-x. 1 lizhiwei lizhiwei 2523 Sep 14 09:51 plugin
-rw-rw-r--. 1 lizhiwei lizhiwei 482 Sep 14 09:51 plugin.bat
-rw-rw-r--. 1 lizhiwei lizhiwei 6210 Sep 14 09:51 service.bat
Linux以默认方式启动elasticsearch(依赖Java1.7):
[lizhiwei@localhost bin]$ ./elasticsearch
[2015-10-09 06:05:51,126][INFO ][node ] [Agamemnon] version[1.7.2], pid[3387], build[e43676b/2015-09-14T09:49:53Z]
[2015-10-09 06:05:51,127][INFO ][node ] [Agamemnon] initializing ...
[2015-10-09 06:05:51,249][INFO ][plugins ] [Agamemnon] loaded [marvel], sites [marvel, head]
[2015-10-09 06:05:51,304][INFO ][env ] [Agamemnon] using [1] data paths, mounts [[/ (/dev/sda2)]], net usable_space [86.5gb], net total_space [95.3gb], types [ext4]
[2015-10-09 06:05:53,939][INFO ][node ] [Agamemnon] initialized
[2015-10-09 06:05:53,939][INFO ][node ] [Agamemnon] starting ...
[2015-10-09 06:05:54,004][INFO ][transport ] [Agamemnon] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/192.168.110.100:9300]}
[2015-10-09 06:05:54,017][INFO ][discovery ] [Agamemnon] elasticsearch/g0UtBViqRGOUdboFWcBUbw
[2015-10-09 06:05:57,815][INFO ][cluster.service ] [Agamemnon] new_master [Agamemnon][g0UtBViqRGOUdboFWcBUbw][localhost.localdomain][inet[/192.168.110.100:9300]], reason: zen-disco-join (elected_as_master)
[2015-10-09 06:05:57,936][INFO ][http ] [Agamemnon] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/192.168.110.100:9200]}
[2015-10-09 06:05:57,937][INFO ][node ] [Agamemnon] started
[2015-10-09 06:05:58,062][INFO ][gateway ] [Agamemnon] recovered [2] indices into cluster_state
检查是否启动成功,浏览器访问http://IP:9200/,如:http://192.168.110.100:9200/
2.安装Elasticsearch插件
1.安装Marvel插件插件
Elasticsearch Marvel是一个管理和监视工具,免费供开发使用。安装过程如下:
[lizhiwei@localhost bin]$ ./plugin -i elasticsearch/marvel/latest
-> Installing elasticsearch/marvel/latest...
Trying http://download.elasticsearch.org/elasticsearch/marvel/marvel-latest.zip...
Downloading .......................................DONE
Installed elasticsearch/marvel/latest into /home/lizhiwei/SoftWare/ElasticSearch/elasticsearch-1.7.2/plugins/marvel
2.安装head插件
head插件也是ElasticSearch管理工具,安装如下:
[lizhiwei@localhost bin]$ ./plugin -install mobz/elasticsearch-head
-> Installing mobz/elasticsearch-head...
Trying https://github.com/mobz/elasticsearch-head/archive/master.zip...
Downloading ............................DONE
Installed mobz/elasticsearch-head into /home/lizhiwei/SoftWare/ElasticSearch/elasticsearch-1.7.2/plugins/head
范围路径:http://IP:9200/_plugin/head/ 如下: