Centos7安裝ElasticSearch

阿里云ECS
配置:1核1G內(nèi)存
系統(tǒng):Centos7

  • Elasticsearch默認(rèn)不推薦使用root用戶啟動(dòng),所以創(chuàng)建用戶elastic
useradd   elastic
  • 設(shè)置密碼 (回車后輸入密碼)
passwd   elastic
  • 切到elastic用戶目錄下
cd /home/elastic
  • 下載Elasticsearch安裝包
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.2.tar.gz
  • 解壓安裝包
tar -xzvf elasticsearch-5.5.2.tar.gz
  • 給elastic用戶設(shè)置文件讀寫權(quán)限
chown -R elastic:elastic  elasticsearch-5.5.2
  • 切換到elastic用戶,并啟動(dòng)elasticsearch
su elastic
sh elasticsearch-5.5.2/bin/elasticsearch
啟動(dòng)過程中可能遇到的錯(cuò)誤

  • max number of threads [3895] for user [elk] is too low, increase to at least [4096]
查看服務(wù)器當(dāng)前用戶的最大線程數(shù)為3895,修改配置文件件/etc/security/limits.d/20-nproc.conf(Centos7):
image.png
  • max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
# 切換到root用戶,編輯limits.conf 
vi /etc/security/limits.conf

# 添加如下內(nèi)容
* hard nofile 65536
* soft nofile 65536
  • max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
# 切換到root用戶修改配置sysctl.conf
vi /etc/sysctl.conf

# 添加下面配置:
vm.max_map_count=655360

# 并執(zhí)行命令:
sysctl -p

# 重啟 Elasticsearch
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

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