草庐IT

ES集群安装(docker)7.2.0

docker离线安装方法_探路者之旅的博客-CSDN博客部署步骤1.初始化es配置文件--拉取es镜像dockerpullelasticsearch:7.2.0--创建挂载目录[data:存放索引数据,plugins:存放es插件]mkdir-p/home/software/elasticsearchmkdir-p/home/software/elasticsearch/config/data1mkdir-p/home/software/elasticsearch/config/data2mkdir-p/home/software/elasticsearch/config/data3mkdir

pyflink map 字典写入ES

[root@masterpyflink]#cattest.py #-*-coding:utf-8-*-frompyflink.datastreamimportStreamExecutionEnvironmentfrompyflink.datastream.functionsimport MapFunction,RuntimeContext,KeyedProcessFunctionfromabcimportABC,abstractmethodfrompyflink.datastreamimportStreamExecutionEnvironmentfrompyflink.datastream.f

springboot整合ES索引引擎

在Springboot整合ES提供了启动依赖jar。该jar包封了一个类:RestHighLevelClient该类可以对象ES中各个接口进行相应的操作。1.创建springboot工程并导入相关的依赖2.3.12.RELEASE2.创建一个配置类,返回RestHighLevelClient修改一下版本创建路径config包下的ESconfig类@ConfigurationpublicclassESConfig{//springboot连接ES提供的一个客户端类.RestHighLevelClient@BeanpublicRestHighLevelClientrestHighLevelClie

es多字段模糊匹配wildcardQuery,java实现

es版本:7.10.1spring-cloud版本:2.3.5.RELEASEspring-boot-starter-data-elasticsearch版本 2.3.12.RELEASEspring-data-elasticsearch版本 4.0.9.RELEASEes查询,需求:title或者content任意一个字段能匹配到关键词即可DSL 使用dsl查询语句如下,构建一个query,should只要一个匹配即可POST/article/_search{"query":{"bool":{"should":[{"wildcard":{"title":"*路数*"}},{"wildcard

使用ES对一段中文进行分词

ES连接使用org.elasticsearch.client.RestHighLevelClient。获取分词的代码如下:importcom.alibaba.fastjson.JSON;importcom.alibaba.fastjson.JSONArray;importcom.alibaba.fastjson.JSONObject;importorg.apache.http.util.EntityUtils;importorg.elasticsearch.client.Request;importorg.elasticsearch.client.Response;importorg.elas

【elasticsearch】修改es集群的索引副本数量

前言最近海外es集群进行调整,从3节点变成了单节点。所以需要将集群模式改为单点模式,并需要将es集群的全部索引副本个数改为0,不然会有很多未分配的分片,导致集群状态为yellow。具体实践1.先将现有的index的副本数量为0个此步骤是为了解决现有的索引副本数。PUT*/_settings{"index":{"number_of_replicas":0}}2.创建模板匹配所有index,并设置副本数量为0此步骤是为了解决新增的索引副本数PUT_template/template_log{"order":0,"template":"*","settings":{"index":{"number_

Elasticsearch es查询结果只返回指定筛选字段_source

参考:https://www.exception.site/elasticsearch/elasticsearch-query-custom-columns1、查询特别值查询,结果只返回指定字段***只返回title、channel结果;下列两种语法方式都可以{"_source":["title","channel"],"query":{"term":{"aid":"cfxa***253i1y"}}}{"_source":["title","channel"],"query":{"query_string":{"default_field":"aid","query":"cfx***53i1y

es配合java使用--代码示范

本地搭建es镜像环境及谷歌插件可视化环境https://blog.csdn.net/qq_60191219/article/details/125867721?spm=1001.2014.3001.5501一:配置文件--用于配置链接elasticsearch:host:127.0.0.1port:9200scheme:httpdelayTime:10index:event:eventpeople:peopleplace:place二:es工具类--为service提供方法packagecom.spacesystech.config;importlombok.Getter;importorg.

centos7下es(elasticsearch)安装

本篇文章主要讲解centos7下es的安装1、下载安装包直接官网下载:https://www.elastic.co/cn/downloads/elasticsearch注意:选择linux版本2、解压2.1上传至/usr/local2.2解压压缩包:tar-zxvfelasticsearch-7.5.1-linux-x86_64.tar.gz2.3目录介绍 *bin:可执行文件在里面,运行es的命令就在这个里面,包含了一些脚本文件等 *config:配置文件目录 *JDK:java环境 *lib:依赖的jar,类库 *logs:日志文件 *modules:es相关的模块 *plugins:可以

future versions of Elasticsearch will require Java 11 --记录es启动报错

ES启动时候报错:futureversionsofElasticsearchwillrequireJava11;yourJavaversionfrom[/data/jdk1.8.0_111/jre]doesnotmeetthisrequirement es启动时候会使用环境变量的jdk,在不改变现有环境变量的情况下使用自带的openjdk,需要执行以下步骤:    es版本:7.5.1    自带的openjdk版本:13.0.1修改elasticsearch-env内容,截图如下:重启ES,成功之后则忽略以下步骤: 如果重启发现还不成功,报这个错 OpenJDK64-BitServerVMw