linux环境Elasticsearch集群搭建和Spring Data Elasticsearch的简单使用

本文直接讲解正题,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
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值