安裝
wget https://mega.nz/#!q2ZgWAwZ!QppDAxt2qeDRwbncYMXz9xrWGzcuHtH-znXW-iYKN3U
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.2.tar.gz
tar -xzf elasticsearch-5.5.2.tar.gz
cd elasticsearch-5.5.2/
執行
./bin/elasticsearch
apt-get -y install curl
sudo apt-get install apt-transport-https
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.3.1/elasticsearch-2.3.1.deb
sudo dpkg -i elasticsearch-2.3.1.deb
sudo systemctl status elasticsearch.service
設定檔
sudo nano /etc/elasticsearch/elasticsearch.yml
network.host: 0.0.0.0
cluster.name: myCluster1
node.name: "myNode1"
記憶體
sudo nano /etc/elasticsearch/jvm.options
-Xms2g
-Xmx2g
change
-Xms512m
-Xmx512m
測試
curl -X GET http://192.168.10.100:9200
插入
curl -XPUT 'http://localhost:9200/brady/tweet/1' -d '{
"user" : "bradyy",
"post_date" : "2009-11-15T14:12:12",
"message" : "trying out Elastic Search"
}'
curl -XPOST 'http://jfblouvmlxecs01:9200/test/test/1' -d lane.json
curl -XPOST 'http://jfblouvmlxecs01:9200/test/_doc/1' -d @lane.json
https://stackoverflow.com/questions/15936616/import-index-a-json-file-into-elasticsearch/39990600
所有 index
基本資訊
curl -X GET http://localhost:9200?v
所有的 index
curl -X GET http://localhost:9200/_cat/indices?v
curl -X GET http://localhost:9200/_aliases?pretty=1
curl -X GET http://localhost:9200/brady?pretty=1
curl -X GET http://localhost:9200/brady/_search?pretty=1
https://codingexplained.com/coding/elasticsearch/listing-all-indexes-in-elasticsearch-cluster
https://www.mxp.tw/6185/
https://tecadmin.net/setup-elasticsearch-on-ubuntu/