赞
踩
本文直接讲解正题,jdk的安装忽略,下面开始:
一、Elasticsearch集群搭建环境准备
1、三台虚拟机:
hadoop102:192.168.238.139
hadoop103:192.168.238.140
hadoop104:192.168.238.141
2、Elasticsearch相关的几个包
Elasticsearch的安装包下载地址:https://www.elastic.co/cn/downloads/elasticsearch
插件elasticsearch-head下载地址:https://github.com/mobz/elasticsearch-head
插件nodejs的下载地址 https://nodejs.org/en/download/
3、包的位置
这个是解压后包的地址
root@hadoop102:/opt/module/elasticsearch-5.6.8# pwd
/opt/module/elasticsearch-5.6.8
root@hadoop102:/opt/module/elasticsearch-5.6.8#
这里暂时没有设置环境变量。
配置文件修改
修改config下面的elasticsearch.yml文件,即:
root@hadoop102:/opt/module/elasticsearch-5.6.8/config# ll
total 28
drwxr-xr-x 3 huipanxing huipanxing 4096 9月 14 23:53 ./
drwxr-xr-x 9 huipanxing huipanxing 4096 9月 14 21:43 ../
-rw-rw---- 1 huipanxing huipanxing 3227 9月 14 23:53 elasticsearch.yml
-rw-rw---- 1 huipanxing huipanxing 3067 9月 14 23:21 jvm.options
-rw-rw---- 1 huipanxing huipanxing 4456 2月 17 2018 log4j2.properties
drwxrwxr-x 2 huipanxing huipanxing 4096 9月 14 21:05 scripts/
root@hadoop102:/opt/module/elasticsearch-5.6.8/config# vi elasticsearch.yml
三个机子分别增加内容为:
cluster.name: my-application
node.name: node-1
node.master: true
bootstrap.system_call_filter: false
bootstrap.memory_lock: false
network.host: 192.168.238.139
http.port: 9200
http.cors.enabled: true
http.cors.allow-origin: "*"
discovery.zen.ping.unicast.hosts: ["192.168.238.139:9300", "192.168.238.140:9300", "192.168.238.141:9300"]
discovery.zen.minimum_master_nodes: 2
cluster.name: my-application
node.name: node-2
node.master: true
bootstrap.system_call_filter: false
bootstrap.memory_lock: false
network.host: 192.168.238.140
http.port: 9200
http.cors.enabled: true
http.cors.allow-origin: "*"
discovery.zen.ping.unicast.hosts: ["192.168.238.139:9300", "192.168.238.140:9300", "192.168.238.141:9300"]
discovery.zen.minimum_master_nodes: 2
cluster.name: my-application
node.name: node-3
node.master: true
bootstrap.system_call_filter: false
bootstrap.memory_lock: false
network.host: 192.168.238.141
http.port: 9200
http.cors.enabled: true
http.cors.allow-origin: "*"
discovery.zen.ping.unicast.hosts: ["192.168.238.139:9300", "192.168.238.140:9300", "192.168.238.141:9300"]
discovery.zen.minimum_master_nodes: 2
5、启动三台服务,并测试是否启动成功。
root@hado
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。