草庐IT

ES报错Native controller process has stopped - no new native processes can be started

一、问题描述在Linux中启动ES发现如下错误:Nativecontrollerprocesshasstopped-nonewnativeprocessescanbestarted,问题如下所示:问题代码[2022-01-30T23:37:59,659][INFO][o.e.x.m.p.NativeController][node-1]Nativecontrollerprocesshasstopped-nonewnativeprocessescanbestarted[2022-01-30T23:37:59,663][INFO][o.e.n.Node][node-1]stopping...[20

dataFrame(DF)将数据插入ES时报错 org.elasticsearch.hadoop.EsHadoopIllegalArgumentException: Cannot detect E

SparkSql插入ES时报错解决(针对增加用户权限之后的报错解决)org.elasticsearch.hadoop.EsHadoopIllegalArgumentException:CannotdetectESversion-typicallythishappensifthenetwork/ElasticsearchclusterisnotaccessibleorwhentargetingaWAN/Cloudinstancewithoutthepropersetting‘es.nodes.wan.only’以下是报错信息Exceptioninthread"main"org.elasticse

解决ES search.max_buckets参数问题

Tryingtocreatetoomanybuckets.Mustbelessthanorequalto:[65535]butwas[65536].Thislimitcanbesetbychangingthe[search.max_buckets]clusterlevelsetting.临时解决办法:PUT/_cluster/settings{"transient":{"search.max_buckets":1000000}}或者 curl-XPUT"http://127.0.0.1:9200/_cluster/settings"-H'Content-Type:application/jso

es最大相似度检索(原生与java客户端)

原生rest:对“不好”进行分词,"operator":"and"意思是同时满足。POSTcorpus_details_22/_search{"query":{"dis_max":{"queries":[{"match":{"sourceContent":{"query":"不好","operator":"and"}}}]}}}结果:{"took":0,"timed_out":false,"_shards":{"total":1,"successful":1,"skipped":0,"failed":0},"hits":{"total":{"value":3,"relation":"eq"},

es 二、核心概念

目录Nrtcluster集群概念node节点Document文档Index索引Field字段Type类型shard分片Replicashard副本数据库和es概念对比Nrt      写入一秒后就能搜到cluster集群概念      一台机器启动一个实例即可,多个组成node节点      一个实例一个节点Document文档      Json文档存储数据,存在一个索引中Index索引      相等于表Field字段      定义字段Type类型      快被删除了用来分类es9.0后变成type.docshard分片      shard=3三个分片共同存储分片数据      *减

ES-安装和集群启动

安装ES  1.下载ES  2.解压并且启动ES  把elasticsearch-7.1.1-windows-x86_64压缩包解压到G:\opt\ES\elasticsearch-7.1.1  执行下面命令:G:\opt\ES\elasticsearch-7.1.1\bin>elasticsearch3.在浏览器中打开http://127.0.0.1:9200/看到以下信息表示ES启动成功{"name":"node0","cluster_name":"pplus","cluster_uuid":"5-pLwvgKQSip_HFWwmEeMA","version":{"number":"7.1

ES聚合分页(group by分组后分页)

ES实现类似sql的groupby后如何分页?{"query":{......//搜索条件},"aggs":{"count":{//COUNT(*),统计GROUPBY后的总数"cardinality":{"field":"goods_id"//因为我这里GROUPBY的字段是goods_id,所以就用goods_id来计数了}},"goods_id":{"terms":{"field":"goods_id",//选择GROUPBY的字段"size":20//取出20条GROUPBY的数据。数量应设置为sql中offset+limit的数量。注:其实es聚合操作不是很支持分页,于是只能先将数据

使用java来查询es索引(基于es7.8)

1、先引入pom依赖:org.elasticsearchelasticsearch7.8.0org.elasticsearch.clientelasticsearch-rest-high-level-client7.8.0org.apache.logging.log4jlog4j-api2.8.2org.apache.logging.log4jlog4j-core2.8.2com.fasterxml.jackson.corejackson-databind2.9.9junitjunit4.122、然后在main方法里进行测试:importorg.apache.http.HttpHost;imp

ES 修改数据

方法一:PUT和CREATE一样,PUT的时候将所有field带上,只调整修改的部分即可PUT/spouse/female/5{"name":"lengmeng","age":26,"desc":"actress"}返回结果;{"_index":"spouse","_type":"female","_id":"5","_version":2,//修改后,_version会+1,值代表数据改动的次数"result":"updated","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":6,"_primary_term":1}方法二

es索引分片重新分配cluster.routing.allocation

Index-levelshardallocationfiltering|ElasticsearchGuide[master]|Elasticindex.routing.allocation.include.{attribute}Assigntheindextoanodewhose {attribute} hasatleastoneofthecomma-separatedvalues.index.routing.allocation.require.{attribute}Assigntheindextoanodewhose {attribute} has all ofthecomma-separ