当前位置:   article > 正文

linux环境Elasticsearch集群搭建和Spring Data Elasticsearch的简单使用_querybuilders.querystringquery windows 不报错 linux 报

querybuilders.querystringquery windows 不报错 linux 报错

本文直接讲解正题,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#
  • 1
  • 2
  • 3

这里暂时没有设置环境变量。
配置文件修改
修改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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

三个机子分别增加内容为:

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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

5、启动三台服务,并测试是否启动成功。

root@hado
    声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/461267
    推荐阅读
    相关标签
      

    闽ICP备14008679号