Elasticsearch起步之安裝(一)

Elasticsearch起步之安裝(以Ubuntu爲例)

elasticsearch下載

  • 下載安裝包並保存至 /tmp 目錄下
wget -P /tmp https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.1.1-linux-x86_64.tar.gz
  • 創建文件夾opt/soft/elasticsearch
sudo mkdir -p /opt/soft/elasticsearch
  • 將下載好的壓縮包移至目標目錄並解壓
mv /tmp/elasticsearch-7.1.1-linux-x86_64.tar.gz  /opt/soft/elasticsearch
tar -xzf elasticsearch-7.1.1-linux-x86_64.tar.gz
mv elasticsearch-7.1.1-linux-x86_64.tar.gz
  • 創建一個軟鏈接
    開發環境如JDK、MAVEN等統一鏈接至/usr/local目錄下方便以後查找
sudo ln -s /opt/soft/elasticsearch/elasticsearch-7.1.1 /usr/local/elasticsearch

啓動

配置

配置文件目錄:/usr/local/elasticsearch/config/elasticsearch.yml

#任何IP都可訪問
network.host: 0.0.0.0
discovery.seed_hosts: ["127.0.0.1"]

啓動

啓動命令如下:

#進入es安裝目錄
cd /usr/local/elasticsearch/bin
#普通執行
./elasticsearch
#後臺執行
./elasticsearch -d

驗證ES是否啓動成功,瀏覽器輸入:

http://[服務器IP]:9200?pretty

輸出如下,即說明ES安裝成功

{
  "name" : "deepin",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "O5FQdGkpRi2gVz3RePkyMA",
  "version" : {
    "number" : "7.1.1",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "7a013de",
    "build_date" : "2019-05-23T14:04:00.380842Z",
    "build_snapshot" : false,
    "lucene_version" : "8.0.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章