ElasticSearch(三)mac安裝
1.首先要安裝jdk
2.到官網或是用brew下載ElasticSearch 安裝包,這邊我們選擇在官網下載對應的安裝包 https://www.elastic.co/cn/downloads/elasticsearch
3.解壓縮到對應的目錄下,我們解壓縮到了 /usr/local/elasticsearch-6.5.2
解壓縮後的相關目錄如下:
4.快速啟動
1).進入到bin目錄下,執行elasticsearch腳本,sh elasticsearch 或 ./elasticsearch
2).我們可以看到started關鍵字,表示已經啟動成功,綁定端口為9200
[2018-12-12T09:36:45,853][INFO ][o.e.x.s.t.n.SecurityNetty4HttpServerTransport] [PX7a_3A] publish_address {127.0.0.1:9200}, bound_addresses {[::1]:9200}, {127.0.0.1:9200}
[2018-12-12T09:36:45,854][INFO ][o.e.n.Node ] [PX7a_3A] started
3).查看es jvm進程
? ~ jps -l |grep Elasticsearch
1052 org.elasticsearch.bootstrap.Elasticsearch
4).或是我們可以用curl http://localhost:9200/?pretty檢查是否啟動成功
? ~ curl http://localhost:9200/\?pretty
{
"name" : "PX7a_3A",
"cluster_name" : "elasticsearch", //集群名稱(默認的集群名稱就是elasticsearch)
"cluster_uuid" : "mnnG3X4aSpakShysGdqy0w",
"version" : {
"number" : "6.5.2",
"build_flavor" : "default",
"build_type" : "tar",
"build_hash" : "9434bed",
"build_date" : "2018-11-29T23:58:20.891072Z",
"build_snapshot" : false,
"lucene_version" : "7.5.0",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
5).我們發現control+c停止了Elasticsearch,有closed關鍵字,所以要進行後臺啟動
[2018-12-12T09:48:36,732][INFO ][o.e.n.Node ] [PX7a_3A] stopped
[2018-12-12T09:48:36,732][INFO ][o.e.n.Node ] [PX7a_3A] closing ...
[2018-12-12T09:48:36,747][INFO ][o.e.n.Node ] [PX7a_3A] closed
6).後臺啟動Elasticsearch
執行命令 sh elasticsearch -d
ElasticSearch(三)mac安裝