此文檔針對es在centos7環境3節點部署,3節點ip分別爲:172.16.10.102.172.16.10.103,172.16.10.104
1、增長host
每一個節點下增長host配置
172.16.10.102 HadoopMaster
172.16.10.103 HadoopSlave1
172.16.10.104 HadoopSlave2
2、而後下載es安裝包
cd /opt wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.4.0.tar.gz
3、解壓es安裝包
tar -zxvf elasticsearch-6.4.0.tar.gz
4、編輯es配置文件(master配置以下,其餘2個slave修改node.master:false便可)
vim config/elasticsearch.yml
network.host: 0.0.0.0
discovery.zen.ping_timeout: 120s
client.transport.ping_timeout: 60s
discovery.zen.ping.unicast.hosts: ["172.16.10.102","172.16.10.103", "172.16.10.104"]
cluster.name: escluster
node.name: HadoopMaster
path.data: /opt/elasticsearch-6.4.0/data
path.logs: /opt/elasticsearch-6.4.0/datalog
node.master: true
node.data: true
node.attr.rack: r1
bootstrap.memory_lock: true
bootstrap.system_call_filter: false
http.port: 9200
http.cors.enabled: true
http.cors.allow-origin: "*"
5、修改系統參數
vim /etc/security/limits.conf
新增node
安裝nodejs環境git
yum -y install nodejs
cd elasticsearch-head/
npm installgithub
npm install -g grunt-cli
grunt server &
Open http://localhost:9100
(若是提示報錯phantomjs-prebuilt@2.1.16 install: node install.js
)
npm install phantomjs-prebuilt@2.1.16 --ignore-scripts 便可
從新啓動es程序。
打開網頁:http://172.16.10.102:9100(若是head的9200鏈接不上,檢查配置文件的http.cors.enabled: true
http.cors.allow-origin: "*" 是否配置)npm