1、安裝node
在安裝以前,請先設置jdk環境,到oracle官網下載相應的jdk版本,我這邊使用的是jdk1.7的版本vim
vim /etc/profile 在文件的最後加入相應的環境變量 export JAVA_HOME=/usr/local/jdk/jdk1.7.0_80 export PATH=$JAVA_HOME/bin:$PATH
到官網下載對應的ElasticSearch,目前最新版本爲6.x,我這邊下載的是ElasticSearch2.4.6(它運行在jdk1.7+),5.x及6.x都須要jdk1.8的支持跨域
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-2.4.6.tar.gz tar -zxvf elasticsearch-2.4.6 cd elasticsearch-2.4.6 ./bin/elasticsearch
執行以前就得修改配置文件:vim config/elasticsearch.ymlbash
vim config/elasticsearch.yml
修改方法參考以下:oracle
#集羣名稱 cluster.name: elk_test.cluster #節點名稱 node.name: node-01 #node.master: true #node.data: true #或設置成具體的值 192.168.0.153 network.host: 0.0.0.0 http.port: 9200 discovery.zen.ping.unicast.hosts: ["192.168.0.153","192.168.0.154","192.168.0.155"] #discovery.zen.ping.multicast.enabled: false discovery.zen.minimum_master_nodes: 2 #針對5.x版本後,插件就必須獨立運行,解決跨域問題的設置 #http.cors.enabled: true #http.cors.allow-origin: "*"
集羣的其餘節點設置如上。cors
二,head插件的安裝elasticsearch
針對5.x+版本,head插件必須獨立運行,不能再用/bin/plugin -install mobz/elasticsearch-head安裝了,針對2.x版本,咱們仍是以這種方式進行在線安裝(/bin/plugin -install mobz/elasticsearch-head),針對5.x+版本,能夠參考這篇文章.net
cd /usr/local/es/elasticsearch-2.4.6/bin ./plugin install mobz/elasticsearch-head -Dhttps.protocols=TLSv1.2
加入-Dhttps.protocols=TLSv1.2 是爲了解決https.protocols版本報錯的問題插件
安裝成功以後,就能夠訪問http://192.168.0.153:9200/_plugin/head/code
至此,已經完成了,待續……