First, the environment
System centos6.4x64 Minimized installation
Elk-search1 192.168.3.71
ELK-SEARCH2 192.168.3.72
Ii. Installation of JDK
[[Email protected] ~]# ll |grep tar.gz-rw-r--r-- 1 root root 28478292 Mar 17 15:36 elasticsearch-1.7.2.tar.gz-rw-r--r-- 1 root root 173271626 mar 17 15:39 jdk-8u45-linux-x64.tar.gz-rw-r--r-- 1 root root 10675082 mar 17 15:39 Kibana-4.1.0-linux-x64.tar.gz-rw-r--r-- 1 root root 89853616 mar 17 15:40 logstash-1.5.5.tar.gz# Unpacking the installation package [[email protected] ~]# tar xf jdk-8u45-linux-x64.tar.gz [[email protected] ~]# cp -r jdk1.8.0_45 /usr/ local/[[email protected] ~]# cat /etc/profile.d/java.shjava_home=/usr/local/jdk1.8.0_ 45java_bin=/usr/local/jdk1.8.0_45/binjre_home=/usr/local/jdk1.8.0_45/jrepath= $PATH:/usr/local/jdk1.8.0_45/bin :/usr/local/jdk1.8.0_45/jre/binclasspath=/usr/local/jdk1.8.0_45/jre/lib:/usr/local/jdk1.8.0_45/lib:/usr/local/jdk1.8.0_45/jre/lib/charsets.jar# Let environment variables take effect [[email protected] ~] # source /etc/profile.d/java.sh# test results [[Email protected] ~]# java -versionjava version "1.8.0_45" java (TM) SE Runtime Environment (BUILD 1.8.0_45-B14) Java hotspot (TM) 64-Bit Server VM (Build 25.45-b02, mixed mode)
Three, install Elasticsearch
[[email protected] ~]# pwd /root[[email protected] ~]# ll |grep search-rw-r--r-- 1 root root 28478292 mar 17 15:36 Elasticsearch-1.7.2.tar.gz[[email protected] ~]# tar xf elasticsearch-1.7.2.tar.gz -c /usr/local/#目录结构 [[email protected] ~]# cd /usr/local/elasticsearch-1.7.2/[[ Email protected] elasticsearch-1.7.2]# lltotal 40drwxr-xr-x 2 root root 4096 mar 17 15:51 bindrwxr-xr-x 2 root root 4096 mar 17 15:51 configdrwxr-xr-x 3 root root 4096 mar 17 15:51 lib-rw-rw-r-- 1 root root 11358 Sep 14 2015 license.txt-rw-rw-r-- 1 root root 150 sep 14 2015 Notice.txt-rw-rw-r-- 1 root root 8700 sep 14 2015 readme.textile[[email protected] elasticsearch-1.7.2]# egrep -v ' ^#|^$ ' config/elasticsearch.yml #修改集群名称cluster. Name: elk-search# Modify the node name node.name: "Elk-search1" #启动Elasticsearch服务 # start the next boot mode elasticsearch[[email protected] elasticsearch-1.7.2]# /usr/local/elasticsearch-1.7.2/bin/elasticsearch -d [[email protected] elasticsearch-1.7.2]# netstat -tunlp |grep 9200tcp 0 0 :::9200 :::* LISTEN 1239/java #检查结果 [[email protected] ~]# curl http://192.168.3.71:9200{ "status"  : 200, "name" : "Elk-search1", #自定义的节点名称 "cluster_name" : "Elk-search", # Custom Cluster Name "version" : { "number" : "1.7.2", "Build_hash" : "E43676b1385b8125d647f593f7202acbd816e8ec", "build _timestamp " : " 2015-09-14t09:49:53z ", " Build_snapshot " : false, "Lucene_version" : "4.10.4" }, "tagline" : " You know, for search "}
Iv. configuring Elasticsearch as a system startup service
[[email protected] ~]# curl -l http://github.com/elasticsearch/ Elasticsearch-servicewrapper/tarball/master | tar -xz[[email protected] ~]# mv *servicewrapp*/service /usr/local/elasticsearch-1.7.2/bin/[[email protected] ~]# / usr/local/elasticsearch-1.7.2/bin/service/elasticsearch install# test startup script [[email protected] ~]# ll /etc/init.d/elasticsearch lrwxrwxrwx 1 root root 56 mar 17 16:10 /etc/init.d/elasticsearch -> /usr/local/elasticsearch-1.7.2/bin/service/ elasticsearch [[email protected] ~]# netstat - tunlp |grep 9200tcp 0 0 :::9200 :::*   &NBsp; listen 1239/java# Close the Elasticsearch service and kill the process directly with the KILL command [[ email protected] ~]# netstat -tunlp |grep 9200[[email protected] ~]# ps aux |grep elas |grep -v grep# starts Elasticsearch[[email using the system service startup script Start method protected] ~]# /etc/init.d/elasticsearch startstarting elasticsearch ... Waiting for elasticsearch......running: pid:2490[[email protected] ~]# netstat -tunlp |grep 9200tcp 0 0 :::9200 :::* listen 2492/java [[email protected] ~]# curl http:// 192.168.3.71:9200{ "status" : 200, "name" : "Elk-search1", "Cluster_Name" : "Elk-search", "version" : { " Number " : " 1.7.2 ", " Build_hash " : " E43676b1385b8125d647f593f7202acbd816e8ec ", " Build_timestamp " : " 2015-09-14T09 : 49:53z ", " Build_snapshot " : false, " Lucene_version " : "4.10.4" }, "tagline" : "You know, for search"}# Use the Stop method to stop the Elasticsearch service [[email protected] ~]# /etc/init.d/elasticsearch stopstopping elasticsearch ... Stopped elasticsearch. [[email protected] ~]# netstat -tunlp |grep 9200 |grep -v grep# Restart the Elaeticsearch service using the Restart method [[email protected] ~]# /etc/init.d/elasticsearch Restartstopping elasticsearch ... Elasticsearch was not running. Starting elasticsearch ... Waiting for elasticsearch......running: pid:2757[[email protected] ~]# netstat -tunlp |grep 9200tcp 0 0 :::9200 :::* LISTEN 2759/java [[email protected] ~]# curl http://192.168.3.71:9200{ "status" : 200, "name" : "Elk-search1", " Cluster_Name " : " Elk-search ", " version " : { " number " : "1.7.2", "Build_hash" : " E43676b1385b8125d647f593f7202acbd816e8ec ", " Build_timestamp " : " 2015-09-14T09 : 49:53z ", " Build_snapshot " : false, " Lucene_version " : "4.10.4" }, "tagline" : "You know, for search"}
Install head Plug-in
[[email protected] ~]#/usr/local/elasticsearch-1.7.2/bin/plugin-install mobz/elasticsearch-head# View results [email Protected] ~]# ll/usr/local/elasticsearch-1.7.2/plugins/total 4drwxr-xr-x 5 root root 4096 Mar 16:34 head
View results in browser, access address http://192.168.3.71:9200/_plugin/head/
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/7D/8D/wKiom1bqbNXzd_9PAABoqk2EG2M271.png "title=" Eta_ 7SS (8rulsymn7%3oja2.png "alt=" Wkiom1bqbnxzd_9paaboqk2eg2m271.png "/>
Vi. Installing the Bigdesk plug-in
[Email protected] ~]#/usr/local/elasticsearch-1.7.2/bin/plugin-install lukas-vlcek/bigdesk# View results [[email protected] ~]# ll/usr/local/elasticsearch-1.7.2/plugins/total 8drwxr-xr-x 3 root root 4096 Mar 16:39 bigdeskdrwxr-xr-x 5 root Roo T 4096 Mar 16:34 head
Browser view results, Access address Http://192.168.3.71:9200/_plugin/bigdesk
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/7D/8A/wKioL1bqbjrRfKZJAABa_RpIM0w472.png "title=" u6jx0~ (e[jz4$mc722~s}o3.png "alt=" Wkiol1bqbjrrfkzjaaba_rpim0w472.png "/>
This article is from the "ly36843" blog, please be sure to keep this source http://ly36843.blog.51cto.com/3120113/1752177
Installation of the Elasticsearch cluster