1、Elasticsearch安装



1、软件准备:
-rw-r--r--.  1 root root  27900004 5月  24 15:32 elasticsearch-1.4.4.tar.gz
-rw-r--r--.  1 root root   2054208 5月  24 15:31 elasticsearch-servicewrapper-master.zip


2、解压启动:
[root@baozi local]# tar -zxvf elasticsearch-1.4.4.tar.gz

[root@baozi elasticsearch-1.4.4]# ll
总用量 40
drwxr-xr-x. 2 root root  4096 6月  27 14:01 bin
drwxr-xr-x. 2 root root  4096 6月  27 14:01 config
drwxr-xr-x. 3 root root  4096 6月  27 14:01 lib
-rw-rw-r--. 1 root root 11358 2月  19 20:13 LICENSE.txt
-rw-rw-r--. 1 root root   150 2月  19 20:13 NOTICE.txt
-rw-rw-r--. 1 root root  8438 2月  19 20:51 README.textile

启动:
这个脚本没有提供在后台执行的命令,只能在前台启动:
[root@baozi elasticsearch-1.4.4]# bin/elasticsearch


启动信息:
[root@baozi elasticsearch-1.4.4]# bin/elasticsearch
[2015-06-27 14:06:33,682][INFO ][node                     ] [Ravage 2099] version[1.4.4], pid[2023], build[c88f77f/2015-02-19T13:05:36Z]
[2015-06-27 14:06:33,683][INFO ][node                     ] [Ravage 2099] initializing ...
[2015-06-27 14:06:33,705][INFO ][plugins                  ] [Ravage 2099] loaded [], sites []
[2015-06-27 14:06:38,843][INFO ][node                     ] [Ravage 2099] initialized
[2015-06-27 14:06:38,844][INFO ][node                     ] [Ravage 2099] starting ...
[2015-06-27 14:06:38,962][INFO ][transport                ] [Ravage 2099] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/192.168.1.200:9300]}
[2015-06-27 14:06:39,077][INFO ][discovery                ] [Ravage 2099] elasticsearch/kQMp2frHQm-L0bjAIqXoiw
[2015-06-27 14:06:42,868][INFO ][cluster.service          ] [Ravage 2099] new_master [Ravage 2099][kQMp2frHQm-L0bjAIqXoiw][baozi][inet[/192.168.1.200:9300]], reason: zen-disco-join (elected_as_master)
[2015-06-27 14:06:42,909][INFO ][http                     ] [Ravage 2099] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/192.168.1.200:9200]}
[2015-06-27 14:06:42,909][INFO ][node                     ] [Ravage 2099] started
[2015-06-27 14:06:42,924][INFO ][gateway                  ] [Ravage 2099] recovered [0] indices into cluster_state
^C[2015-06-27 14:09:35,800][INFO ][node                     ] [Ravage 2099] stopping ...
[2015-06-27 14:09:35,839][INFO ][node                     ] [Ravage 2099] stopped
[2015-06-27 14:09:35,839][INFO ][node                     ] [Ravage 2099] closing ...
[2015-06-27 14:09:35,849][INFO ][node                     ] [Ravage 2099] closed


在网页网址输入:http://192.168.1.200:9200/


显示如下:
{
  "status" : 200,
  "name" : "Ravage 2099",
  "cluster_name" : "elasticsearch",
  "version" : {
    "number" : "1.4.4",
    "build_hash" : "c88f77ffc81301dfa9dfd81ca2232f09588bd512",
    "build_timestamp" : "2015-02-19T13:05:36Z",
    "build_snapshot" : false,
    "lucene_version" : "4.10.3"
  },
  "tagline" : "You Know, for Search"
}




我用Google Chrome浏览器可以正常显示,之前用猎豹无法显示。



3、安装插件:
elasticsearch-servicewrapper-master.zip


3.1、解压插件:
[root@baozi local]# unzip elasticsearch-servicewrapper-master.zip


把插件的service拷贝到es的bin目录下:
[root@baozi local]# cd elasticsearch-servicewrapper-master
[root@baozi elasticsearch-servicewrapper-master]# ll
总用量 8
-rw-r--r--. 1 root root 2510 3月  22 02:50 README.md
drwxr-xr-x. 4 root root 4096 3月  22 02:50 service


[root@baozi elasticsearch-servicewrapper-master]# cp -r service/ ../elasticsearch-1.4.4/bin/
[root@baozi elasticsearch-servicewrapper-master]#


3.2、后台启动:
进入es的bin/service目录:
[root@baozi service]# pwd
/usr/local/elasticsearch-1.4.4/bin/service


[root@baozi service]# ./elasticsearch start
Starting Elasticsearch...
Waiting for Elasticsearch......
running: PID:2158
[root@baozi service]#


3.3、查看进程:
[root@baozi service]# jps
2223 Jps
2160 WrapperSimpleApp
[root@baozi service]#


3.4、日志文件:
日志信息:
[root@baozi elasticsearch-1.4.4]# ll logs/elasticsearch.log
-rw-r--r--. 1 root root 52116 6月  27 14:16 logs/elasticsearch.log
[root@baozi elasticsearch-1.4.4]#


使用插件日志:
[root@baozi elasticsearch-1.4.4]# ll logs/service.log
-rw-r--r--. 1 root root 536 6月  27 14:16 logs/service.log
[root@baozi elasticsearch-1.4.4]#


3.5、停止es:
[root@baozi elasticsearch-1.4.4]# bin/service/elasticsearch stop
Stopping Elasticsearch...
Stopped Elasticsearch.


[root@baozi elasticsearch-1.4.4]# jps
2343 Jps

[root@baozi elasticsearch-1.4.4]#



你可能感兴趣的:(1、Elasticsearch安装)