Linux 安裝 Elastticsearch

1、下載

下載地址

image.png

下載到本地,可以通過scp命令上傳至指定服務器。移至/soft目錄下

2、解壓

tar -xzvf elasticsearch-5.6.2.tar.gz -C /soft

3、進入解壓目錄創(chuàng)建data和logs目錄

cd /soft/elasticsearch-5.6.2
mkdir data
mkdir logs

4、修改配置文件 /soft/elasticsearch-5.6.2/config/elasticsearch.yml

cluster.name: my-application //去掉#號
node.name: node-1 //去掉#號
path.data: /soft/elasticsearch-5.6.2/data //將路徑填寫為上述創(chuàng)建的data目錄路徑
path.logs: /soft/elasticsearch-5.6.2/logs //將路徑填寫為上述創(chuàng)建的logs目錄路徑
network.host: 192.168.154.201 //將ip地址更換為自己外網(wǎng)ip
discovery.zen.ping.unicast.hosts: ["s201"] //選擇一個主機名

5、執(zhí)行啟動命令

./bin/elasticsearch

6、瀏覽器訪問

  http://192.168.154.201:9200/
image.png

常見問題

一、 出現(xiàn)錯誤:can not run elasticsearch as root
  • 解決方法:
    1.創(chuàng)建用戶
    useradd es
    
    2.切換用戶
    su es
    
    3.執(zhí)行
    ./bin/elasticsearch
    
二、出現(xiàn)錯誤:max virtual memory areas vm.max_map_count [65530] is too low, increase to at least
  • 解決方法
    1. 編輯文件 /etc/security/limits.conf 添加以下內(nèi)容
    * soft nofile 65536
    * hard nofile 131072
    * soft nproc 2048
    * hard nproc 4096
    
    2.編輯文件 /etc/sysctl.conf 添加以下內(nèi)容
    vm.max_map_count=655360
    
    3.執(zhí)行
    ./bin/elasticsearch
    
?著作權歸作者所有,轉載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

友情鏈接更多精彩內(nèi)容