1.安裝java
# 安裝jre
sudo yum install java-1.8.0-openjdk.x86_64
# 安裝jdk
sudo yum install java-1.8.0-openjdk-devel
2.下載並安裝ES
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.4.rpm
sudo rpm -ivh elasticsearch-1.7.3.noarch.rpm
安裝目錄:/usr/share/elasticsearch/
配置文件位置:/etc/elasticsearch
啓動腳本:/etc/init.d/elasticsearch
3.設置自動啓動
sudo systemctl enable elasticsearch.service
4.配置文件
所有配置:elasticsearch.yml
日誌配置:logging.yml
日誌文件位置:/var/log/elasticsearch
5.打開端口
firewall-cmd --zone=public --permanent --add-port=9200/tcp
firewall-cmd --reload
BigDesk Plugin : 對集羣中es狀態進行監控。
Elasticsearch Head Plugin: 對ES進行各種操作,如查詢、刪除、瀏覽索引等。
https://blog.csdn.net/sinat_28224453/article/details/51134978
生產環境配置建議 https://blog.csdn.net/thomas0yang/article/details/55518105
簡單操作
添加
PUT localhost:8083/jdthink/users/102
BODY
{
"name":"cx2",
"age":19,
"sex":1
}
獲取
GET localhost:8083/jdthink/users/102
統計
localhost:8083/_cat/indices
添加新類型
Rejecting mapping update to [jdthink] as the final mapping would have more than 1 type: [news, users]
put /jdthink/news/111
{
"title":"建設世界科技強國 看習近平十大關鍵詞",
"content": "[學習進行時]5月28日,習近平總書記出席兩院院士大會並發表重要講話。他強調,中國要強盛、要復興,就一定要大力發展科學技術,努力成爲世界主要科學中心和創新高地。如何建設世界科技強國?習近平提出了哪些要求?新華社《學習進行時》原創品牌欄目“講習所”今天推出文章,爲您解讀。"
}