1骇径、centos7以前的版本需要關閉 bootstrap.memory_lock,配置內(nèi)容如下:
原因:
這是在因為Centos6不支持SecComp,而ES6.1.1默認bootstrap.system_call_filter為true進行檢測痢毒,所以導致檢測失敗澜建,失敗后直接導致ES不能啟動向挖。
解決:
在elasticsearch.yml中配置bootstrap.system_call_filter為false,注意要在Memory下面:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
可以查看issues
https://github.com/elastic/elasticsearch/issues/22899
2炕舵、ik最新插件安裝
./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.1.1/elasticsearch-analysis-ik-6.1.1.zip
測試步驟如下:
curl -XPOST http://11.0.0.35:9200/index/fulltext/_mapping -H 'Content-Type: application/json' -d'
{
"properties": {
"content": {
"type": "text",
"analyzer": "ik_max_word",
"search_analyzer": "ik_max_word"
}
}
}'
curl -XPOST http://11.0.0.35:9200/index/fulltext/1 -H 'Content-Type: application/json' -d'
{"content":"美國留給伊拉克的是個爛攤子嗎"}
'
curl -XPOST http://11.0.0.35:9200/index/fulltext/2 -H 'Content-Type: application/json' -d'
{"content":"公安部:各地校車將享最高路權"}
'
curl -XPOST http://11.0.0.35:9200/index/fulltext/3 -H 'Content-Type: application/json' -d'
{"content":"中韓漁警沖突調查:韓警平均每天扣1艘中國漁船"}
'
curl -XPOST http://11.0.0.35:9200/index/fulltext/4 -H 'Content-Type: application/json' -d'
{"content":"中國駐洛杉磯領事館遭亞裔男子槍擊 嫌犯已自首"}
'
curl -XPOST http://11.0.0.35:9200/index/fulltext/_search -H 'Content-Type: application/json' -d'
{
"query" : { "match" : { "content" : "中國" }},
"highlight" : {
"pre_tags" : ["<tag1>", "<tag2>"],
"post_tags" : ["</tag1>", "</tag2>"],
"fields" : {
"content" : {}
}
}
}
'
{"took":16,"timed_out":false,"_shards":{"total":5,"successful":5,"skipped":0,"failed":0},"hits":{"total":2,"max_score":0.6489038,"hits":[{"_index":"index","_type":"fulltext","_id":"4","_score":0.6489038,"_source":
{"content":"中國駐洛杉磯領事館遭亞裔男子槍擊 嫌犯已自首"}
,"highlight":{"content":["<tag1>中國</tag1>駐洛杉磯領事館遭亞裔男子槍擊 嫌犯已自首"]}},{"_index":"index","_type":"fulltext","_id":"3","_score":0.2876821,"_source":
{"content":"中韓漁警沖突調查:韓警平均每天扣1艘中國漁船"}
,"highlight":{"content":["中韓漁警沖突調查:韓警平均每天扣1艘<tag1>中國</tag1>漁船"]}}]}}
3何之、java的jvm參數(shù)修改config下面的jvm.options即可。