Elasticsearch是一個基于Apache Lucene(TM)的開源搜索引擎。無論在開源還是專有領(lǐng)域管行,Lucene可以被認(rèn)為是迄今為止最先進(jìn)、性能最好的、功能最全的搜索引擎庫起胰。
下面介紹一下Mac下安裝Elasticsearch的步驟
更新brew
brew update
安裝java8
brew cask install homebrew/cask-versions/java8
運(yùn)行es必須安裝java
安裝es
brew install elasticsearch
你也可以先brew search elasticsearch
運(yùn)行es
brew services start elasticsearch
查看安裝信息執(zhí)行 brew info elasticsearch
本地瀏覽器訪問http://localhost:9200
{
name: "90LNUen",
cluster_name: "elasticsearch_shengyulong",
cluster_uuid: "vMztQUmQS7-_aJ1b37URYg",
version: {
number: "6.6.2",
build_flavor: "oss",
build_type: "tar",
build_hash: "3bd3e59",
build_date: "2019-03-06T15:16:26.864148Z",
build_snapshot: false,
lucene_version: "7.6.0",
minimum_wire_compatibility_version: "5.6.0",
minimum_index_compatibility_version: "5.0.0",
},
tagline: "You Know, for Search",
}
安裝Kibana
Kibana是ES的一個配套工具,可以讓用戶在網(wǎng)頁中與ES進(jìn)行交互
brew install kibana
啟動Kibana
brew services start kibana
本地瀏覽器訪問
http://localhost:5601
查看集群健康狀態(tài)
localhost:9200/_cat/health?v
注意看
status
字段,他有三個值含義分別如下
- green:一切都很好(集群功能齊全)
- yellow:所有數(shù)據(jù)都可用,但尚未分配一些副本(群集功能齊全)
- Red:某些數(shù)據(jù)由于某種原因不可用(群集部分功能)