?參考文章:
elasticsearch安裝配置_qianhuan_的博客-CSDN博客_elasticsearch安裝配置
CentOS7.3安裝elasticsearch6.8.6 - 簡(jiǎn)書(shū)
##1.1 下載安裝elasticsearch6.8.6, 并放到/usr/local/src/目錄后
cd /usr/local/src/
unzip elasticsearch-6.8.6.zip
vim /usr/local/src/elasticsearch-6.6.2/config/elasticsearch.yml
##1.2 修改jvm.options
vim /usr/local/src/elasticsearch-6.8.6/config/jvm.options
————————————————
22行:-Xms1g ———>-Xms512m
23行:-Xmx1g ———>-Xmx512m
————————————————
##1.2 修改elasticsearch.yml
vim /usr/local/src/elasticsearch-6.8.6/config/elasticsearch.yml
————————————————
17行:設(shè)置cluster.name: elasticsearch(自定義集群名稱(chēng))
23行:設(shè)置node.name: master(自定義當(dāng)前es的節(jié)點(diǎn)名稱(chēng))
43行:設(shè)置
bootstrap.network.host: 0.0.0.0
bootstrap.memory_lock: false
44行:設(shè)置bootstrap.system_call_filter: false
56行:?network.host: 0.0.0.0 (設(shè)置當(dāng)前節(jié)點(diǎn)的IP)
60行: 設(shè)置端口號(hào) http.port: 9200
xpack.ml.enabled: false
network.host: 0.0.0.0
http.port: 9200
#內(nèi)存
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
#允許跨域
http.cors.enabled: true
http.cors.allow-origin: "*"
#集群和節(jié)點(diǎn)
cluster.name: elasticsearch-cluster
node.name: master
node.master: true
————————————————
##2.下載安裝elasticsearch插件
/usr/local/src/elasticsearch-6.8.6/bin/elasticsearch-plugin install analysis-icu
/usr/local/src/elasticsearch-6.8.6/bin/elasticsearch-plugin list
##3.新建es賬戶
groupadd elasticsearch
useradd -g elasticsearch elasticsearch
chown -R elasticsearch:elasticsearch /usr/local/src/elasticsearch-6.8.6/
##4.修改配置
vi /etc/security/limits.conf
##4.啟動(dòng)elasticsearch
su elasticsearch
#4.1直接啟動(dòng)
/usr/local/src/elasticsearch-6.8.6/bin/elasticsearch
#4.2后臺(tái)啟動(dòng)
/usr/local/src/elasticsearch-6.8.6/bin/elasticsearch -d
啟動(dòng)報(bào)錯(cuò)信息1: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
root 用戶:vi /etc/sysctl.conf 添加 vm.max_map_count=262144:保存退出之后,執(zhí)行命令 sysctl -p
啟動(dòng)報(bào)錯(cuò)信息2:max number of threads is too low
root 用戶:vi /etc/security/limits.conf 在文件最后添加
* soft nofile 65536
* hard nofile 65536
* soft nproc 4096
* hard nproc 4096
啟動(dòng)報(bào)錯(cuò)信息3: max number of threads [1024] for user [elasticsearch] is too low, increase to at least [4096]
vi /etc/security/limits.d/90-nproc.conf 改為4096
修改完記得退出elasticsearch 用戶再進(jìn)
一、環(huán)境
java1.8+
二、下載elasticsearch-6.8.6.tar.gz
下載地址:
解壓elasticsearch-6.8.6.tar.gz
tar -zxvf?elasticsearch-6.8.6.tar.gz
三、創(chuàng)建用戶
啟動(dòng)es必須創(chuàng)建用戶,不能使用root啟動(dòng)
useradd esuser
分配權(quán)限
chown -R esuser?elasticsearch-6.8.6(安裝的es目錄)
四、修改配置文件
1、vim?elasticsearch-6.8.6/conf/jvm.options
22行:-Xms1g ———>-Xms512m
23行:-Xmx1g ———>-Xmx512m
2、vim?elasticsearch-6.8.6/conf/elasticsearch.yml
17行:設(shè)置cluster.nam: elasticsearch(自定義集群名稱(chēng))
23行:設(shè)置node.name: node-1(自定義當(dāng)前es的節(jié)點(diǎn)名稱(chēng))
43行:設(shè)置bootstrap.mnetwork.host: 192.168.1.43emory_lock: false
44行:設(shè)置bootstrap.system_call_filter: false
56行:?network.host: 192.168.1.43 (設(shè)置當(dāng)前節(jié)點(diǎn)的IP)
60行: 設(shè)置端口號(hào) http.port: 9200
最后添加:
http.cors.enabled: true
?http.cors.allow-origin: "*"
3、此時(shí)啟動(dòng)匯報(bào)錯(cuò):ERROR: [2] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解決:編輯 /etc/security/limits.conf,追加以下內(nèi)容;
*? ? ? ? ? ? ? ? soft? ? nofile? ? ?300000
*? ? ? ? ? ? ? ? hard? ? nofile? ? ? ? ? 300000
*? ? ? ? ? ? ? ? soft? ? nproc? ? ? ? ? 102400
*? ? ? ? ? ? ? ? soft? ? memlock? ? ? ? unlimited
*? ? ? ? ? ? ? ? hard? ? memlock? ? ? ? unlimited
編輯 /etc/sysctl.conf,追加以下內(nèi)容:
vm.max_map_count=655360
保存,啟動(dòng) 在bin/elasticsearch -d 后臺(tái)啟動(dòng)
五、驗(yàn)證是否啟動(dòng)成功并能夠連接使用
在服務(wù)器端: curl http://192.168.1.43:9200
瀏覽器:http://192.168.1.43:9200
出現(xiàn)以下內(nèi)容表示成功:
{
? "name" : "node-1",
? "cluster_name" : "elasticsearch",
? "cluster_uuid" : "wwniBniiSeSnl90g2KGaIQ",
? "version" : {
? ? "number" : "6.8.6",
? ? "build_flavor" : "default",
? ? "build_type" : "tar",
? ? "build_hash" : "3d9f765",
? ? "build_date" : "2019-12-13T17:11:52.013738Z",
? ? "build_snapshot" : false,
? ? "lucene_version" : "7.7.2",
? ? "minimum_wire_compatibility_version" : "5.6.0",
? ? "minimum_index_compatibility_version" : "5.0.0"
? },
? "tagline" : "You Know, for Search"
}
六、安裝分詞器
將下載好的分詞器壓縮包上傳至elasticsearch-6.8.6/plugins目錄下,解壓重啟es即可文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-496271.html
作者:曉冬1210
鏈接:https://www.jianshu.com/p/eedc0ad09e05
來(lái)源:簡(jiǎn)書(shū)
著作權(quán)歸作者所有。商業(yè)轉(zhuǎn)載請(qǐng)聯(lián)系作者獲得授權(quán),非商業(yè)轉(zhuǎn)載請(qǐng)注明出處。文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-496271.html
到了這里,關(guān)于elasticsearch6.8.6安裝配置的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!