使用term filter/query搜索,对搜搜文本不分词直接拿去倒排序索引中匹配.
license升级相关
docker, 从官网下的镜像,里面的es只有一个月的试用期,30天过后,就会…
症状, 看日志
docker logs -f -t –tail 20 cid
提示类似这样的
2018-10-26T07:44:35.243941000Z operations are blocked on license expiration. All data operations (read and write) continue to work.
2018-10-26T07:44:35.244366000Z If you have a new license, please update it. Otherwise, please reach out to your support contact.
2018-10-26T07:44:35.245303000Z [2018-10-26T07:44:35,243][ERROR][o.e.x.m.c.c.ClusterStatsCollector] [aLm0QHX] collector [cluster_stats] failed to collect data
2018-10-26T07:44:35.245713000Z org.elasticsearch.ElasticsearchSecurityException: current license is non-compliant for [security]
2018-10-26T07:44:35.246193000Z at org.elasticsearch.license.LicenseUtils.newComplianceException(LicenseUtils.java:35) ~[?:?]
2018-10-26T07:44:35.246561000Z at org.elasticsearch.xpack.security.action.filter.SecurityActionFilter.apply(SecurityActionFilter.java:96) ~[?:?]
2018-10-26T07:44:35.247038000Z at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:165) ~[elasticsearch-6.2.4.jar:6.2.4]
- 需要升级license ,查看 license 状态
curl -XGET ‘http://localhost:9200/_xpack/license‘
返回的json中,status:expired
- 一般是free base版本的license
申请和下载 license
https://register.elastic.co/marvel_register
然后 填写个人信息,关键是邮箱
,提交后,会收到邮件,在邮件里打开下载 license 的链接
下载相应版本,得到一个json文件
上传新licese, eslicense.json 是文件名
curl -XPUT ‘http://localhost:9200/_xpack/license?acknowledge=true‘ -H “Content-Type:application/json” -d @eslicense.json
返回
{“acknowledged”:true,”license_status”:”valid”}%
查看状态
curl -XGET ‘http://localhost:9200/_xpack/license‘
返回的json中,status:active
- 需要高端升级,延长原版本
curl -XPUT ‘http://localhost:9200/_xpack/license‘ -H “Content-Type: application/json” -d @eslicense.json
返回
{“acknowledged”:false,”license_status”:”valid”,”acknowledge”:{“message”:”This license update requires acknowledgement. To acknowledge the license, please read the following messages and update the license again, this time with the “acknowledge=true” parameter:”,”marvel”:[“basic”,”Automatic index cleanup is locked to 7 days for clusters with [{}] license.basic”]}}
- 然后就可以再用一年