Elasticsearch集羣搭建筆記(elasticsearch-6.3.0)

# 檢查Java版本
java -version
# 安裝Elasticsearch,全部節點均安裝並解壓
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch6.3.0.tar.gz 2.tar -xf elasticsearch-6.3.0.tar.gz -C /usr/local
# 修改配置文件
vim /usr/local/elasticsearch6.3.0/config/elasticsearch.yml
    # 主節點(master)
cluster.name: master-node # 集羣中的名稱   node.name: master # 該節點名稱   node.master: true # 意思是該節點不爲主節點   node.data: false # 表示這是數據節點   path.data: /usr/local/elasticsearch-6.3.0/data/lib # 數據存儲路徑   path.logs: /usr/local/elasticsearch-6.3.0/data/log # 日誌路徑   network.host: 0.0.0.0 # 監聽所有ip,在實際環境中應設置爲一個安全的ip   network.publish_host: *.*.*.* #公網IP,內網可註釋此行   http.port: 9200 # es服務的端口號   discovery.zen.ping.unicast.hosts: ["*.*.*.*", "*.*.*.*","*.*.*.*"] # 配置自動發現
    # 從節點(node-n)
cluster.name: master-node # 集羣中的名稱,不管是否計劃創建集羣,建議配置 一個名稱 node.name: node-n # 該節點名稱    node.master: false # 意思是該節點不爲主節點    node.data: true # 表示這是數據節點    path.data: /usr/local/elasticsearch-6.3.0/data/lib # 數據存儲路徑    path.logs: /usr/local/elasticsearch-6.3.0/data/log # 日誌路徑    network.host: 0.0.0.0 # 監聽所有ip,在實際環境中應設置爲一個安全的ip    network.publish_host: *.*.*.* #公網IP,內網可註釋此行    http.port: 9200 # es服務的端口號    discovery.zen.ping.unicast.hosts: ["*.*.*.*","*.*.*.*","*.*.*.*"] # 配置自動 發現
#5.0後elasticsearch不支持root用戶啓動
useradd elas
passwd elas
# 給安裝目錄賦權
chown -R elas /usr/local/elasticsearch-6.3.0/
# 修改hosts配置
vim /etc/hosts
  *.*.*.* master-node 
  *.*.*.* node-1
  *.*.*.* node-2
# 進入elas帳戶
su else
# 啓動全部節點的elasticsearch # 1前臺啓動,可查看錯誤信息,退出即關閉
/usr/local/elasticsearch-6.3.0/bin/elasticsearch # 2後臺啓動 /usr/local/elasticsearch-6.3.0/bin/elasticsearch -d
# 驗證elasticsearch安裝成功
# 1查看進程
ps -ef | grep elasticsearch
# 2查看端口占用
netstat -lnpt | grep java
相關文章
相關標籤/搜索