自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

聊聊 Elastic-Search 部署和應(yīng)用

開發(fā) 架構(gòu)
Elasticsearch 是一個(gè)分布式可擴(kuò)展的實(shí)時(shí)搜索和分析引擎,一個(gè)建立在全文搜索引擎 Apache Lucene(TM) 基礎(chǔ)上的搜索引擎。

es簡(jiǎn)介

Elasticsearch 是一個(gè)分布式可擴(kuò)展的實(shí)時(shí)搜索和分析引擎,一個(gè)建立在全文搜索引擎 Apache Lucene(TM) 基礎(chǔ)上的搜索引擎

Elastic官網(wǎng)

https://www.elastic.co/cn/

主要功能:

分布式搜索

數(shù)據(jù)分析

分組和聚合

es下載地址

https://www.elastic.co/cn/downloads/

linux安裝es

  • 將下載的安裝包上傳導(dǎo)linux服務(wù)器,我的版本是elasticsearch-7.2.0-linux-x86_64.tar.gz
  • 創(chuàng)建usr/local/soft/es目錄,將es解壓到這個(gè)目錄中
  • 修改es的yum文件
node.name: node-1
// 這個(gè)很重要
http.host: 0.0.0.0
http.port: 9200
  • 修改es的jvm.options
-Xms256M
-Xmx256M
  • 創(chuàng)建新的用戶來啟動(dòng)es
  • useradd esuser
  • 賦予權(quán)限
chown -R esuser:esuser /usr/local/software/elasticsearch-7.2.0
  • 切換到esuser用戶
su esuser
  • 通過es用戶后臺(tái)啟動(dòng)es
sh elasticsearch -d
  • 驗(yàn)證是否啟動(dòng)成功
curl -X GET "http://localhost:9200"

添加ik到es中

  • 下載ik的版本必須和es版本對(duì)應(yīng)
  • 將ik放到es的plugin目錄下進(jìn)行解壓

es重啟后會(huì)加載ik

es中新增索引post

curl -X PUT "localhost:9200/post" 

將分詞器修改成ik

  • 關(guān)閉索引
POST post/_close
  • 配置ik
PUT post/_settings
{
"number_of_replicas": 0,
"index":{
"analysis.analyzer.default.type":"ik_max_word",
"analysis.search_analyzer.default.type":"ik_smart"
}
}
  • 開啟post索引
POST post/_open

創(chuàng)建es的mapping,根據(jù)自己的需求創(chuàng)建

curl --location --request PUT '787k.fun:9200/post/_mapping' \
--header 'Content-Type: application/json' \
--data-raw '{
"properties": {
"id": {
"type": "integer"
},
"title": {
"type": "text"
},
"content": {
"type": "text"
},
"blogImg": {
"type": "keyword"
},
"html_content": {
"type": "keyword"
},
"authorId": {
"type": "integer"
},
"authorName": {
"type": "keyword"
},
"tag": {
"type": "integer"
},
"type": {
"type": "integer"
},
"status": {
"type": "integer"
},
"commentCount": {
"type": "integer"
},
"score": {
"type": "double"
},
"created": {
"type": "date"
},
"updated": {
"type": "date"
}
}
}'

springboot集成es

  • pom文件加入依賴
<!--es開始-->
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>7.2.0</version>
</dependency>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>7.2.0</version>
</dependency>
<!--es結(jié)束-->
  • yum文件添加文件
elasticsearch.host=localhost
elasticsearch.port=9200


責(zé)任編輯:武曉燕 來源: 今日頭條
相關(guān)推薦

2022-10-24 00:18:41

Elasticsea分布式數(shù)量

2017-09-02 16:23:45

AWSAZ群集

2020-06-10 08:55:36

Docker容器工具

2022-10-11 09:27:45

搜索引擎es索引

2017-07-31 09:20:52

Elastic seaKibana數(shù)據(jù)

2021-06-26 07:40:45

Greenplum集群部署

2015-05-13 09:15:50

應(yīng)用程序開發(fā)PaaSAWS

2019-11-12 09:32:39

分布式elastic-job分片

2022-02-18 10:52:52

Elastic亞馬遜AWS

2021-08-12 18:49:41

DataStreamAPI注冊(cè)

2020-12-22 06:05:43

Mbedtls應(yīng)用基礎(chǔ)

2019-01-09 13:20:28

GPU虛擬化應(yīng)用

2011-06-01 11:37:48

searchmatchjavascript

2013-06-28 17:47:59

移動(dòng)應(yīng)用

2022-11-02 09:39:51

數(shù)據(jù)恢復(fù)Kubernetes

2022-11-26 08:16:26

2018-05-18 08:20:32

數(shù)據(jù)治理應(yīng)用

2021-04-22 05:40:45

iOS應(yīng)用瘦身

2019-04-10 15:29:58

Elastic

2023-04-06 07:09:25

自動(dòng)化部署Actions
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)