ES安裝、注意點(Elasticsearch 7.3.2)
時間:2019年10月22日
系統:CentOS 7.2
JDK安裝
1.8
下載安裝包
網頁地址:https://www.elastic.co/cn/downloads/elasticsearch
下載地址:https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.3.2-linux-x86_64.tar.gz
cd /usr/local/es
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.3.2-linux-x86_64.tar.gz
tar -zxvf elasticsearch-7.3.2-linux-x86_64.tar.gz
TIPS:
1. 官方地址下載比較慢
使用elastic用戶管理
#建立用戶
useradd elsearch
#目錄受權
chown -R elsearch:elsearch /usr/local/es
#切換用戶
su elsearch
配置
cd /usr/local/es/elasticsearch-7.3.2
vim config/elasticsearch.yml
#支持遠程訪問
network.host: 192.168.1.92
#配置須要發現的初始節點列表
discovery.seed_hosts: ["192.168.1.92"]
#設置節點名稱
node.name: master
#設置主節點列表
cluster.initial_master_nodes: ["master"]
啓動和中止
cd /usr/local/es/elasticsearch-7.3.2
#啓動
./bin/elasticsearch
#守護進程啓動
./bin/elasticsearch -d
#其餘啓動方式【未驗證】
./bin/elasticsearch -Xms512m -Xmx512m
#中止集羣【未驗證】
curl -X POST http://主機IP:9200/_cluster/nodes/節點標識符(如es-node1)/_shutdown
#檢查服務是否啓動
curl http://127.0.0.1:9200
curl http://192.168.1.92:9200
{
"name" : "da3f6f7a9b00",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "o_KisXPYS26kfhcLhaPldg",
"version" : {
"number" : "7.3.2",
"build_flavor" : "default",
"build_type" : "tar",
"build_hash" : "1c1faf1",
"build_date" : "2019-09-06T14:40:30.409026Z",
"build_snapshot" : false,
"lucene_version" : "8.1.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
注意點
- 系統條件不知足
ERROR: [1] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
#切換到root用戶修改配置sysctl.conf
vim /etc/sysctl.conf
#添加配置
vm.max_map_count=262144
#應用
sysctl -p
- 添加配置
network.host: 192.168.1.92
後啓動報錯
ERROR: [1] bootstrap checks failed
[1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers,cluster.initial_master_nodes] must be configured
【分析】:須要至少配置一項[discovery.seed_hosts, discovery.seed_providers,cluster.initial_master_nodes]
【解決方案】添加配置:discovery.seed_hosts: ["192.168.1.92"]
- 待續
HEAD插件安裝
見同目錄文檔:==ES-HEAD插件安裝.md==
IK分詞器安裝
見同目錄文檔:==ES-IK中文分詞器安裝.md==
Kibana安裝
見同目錄文檔:==ES-Kibana安裝.md==