下載最新版本 Elasticsearch 安裝包
具有網路環境,可直接新增 yum repo 來源,所以:
cat > /etc/yum.repos.d/elastic.repo << EOF
[elasticsearch-7.x]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
EOF
yum install elasticsearch
離線環境下,下載 rpm 檔,並透過 rpm 檔進行安裝:
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.11.0-x86_64.rpm
rpm -ivh elasticsearch-7.11.0-x86_64.rpm
編輯 elasticsearch.yml 設定
sudo vim /etc/elasticsearch/elasticsearch.yml
修改下面兩個設定
network.host: "{ YOUR IP }"
cluster.initial_master_nodes: ${HOSTNAME}
啟動 Elasticsearch
systemctl start elasticsearch
驗證 Elasticsearch
Browser 上輸入網址: http:// {{ IP }}:9200
如看到如下相關資訊,表示安裝成功{
"name" : "localhost.localdomain",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "SHCdqrgxQRWSWx03gvP51Q",
"version" : {
"number" : "7.11.0",
"build_flavor" : "default",
"build_type" : "rpm",
"build_hash" : "78722783c38caa25a70982b5b042074cde5d3b3a",
"build_date" : "2022-07-23T19:30:09.227964828Z
","build_snapshot" : false,
"lucene_version" : "9.2.0",
"minimum_wire_compatibility_version" : "7.17.0",
"minimum_index_compatibility_version" : "7.0.0"
},
"tagline" : "You Know, for Search"
}
有任何問題,或是想看新主題?
聯絡我們