1. 程式人生 > >ElasticSearch基礎

ElasticSearch基礎

在Ubuntu Server(16 LTS)上安裝ES。

#安裝JDK
sudo apt-get update && sudo apt-get install default-jdk

#
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -

# 安裝https庫訪問工具
sudo apt-get install apt-transport-https

#
echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-5.x.list

#安裝ES
sudo apt-get update && sudo apt-get install elasticsearch

#修改ES配置
sudo vim /etc/elasticsearch/elasticsearch.yml

#將network.host: 192.168.0.1 改為 network.host: 0.0.0.0

#將ES服務配置為自動啟動
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
sudo /bin/systemctl start elasticsearch.service