環(huán)境準(zhǔn)備:JDk是1.8以上版本
1、官方下載Elasticsearch部署安裝
訪問官網(wǎng),進(jìn)入主頁(yè)下載。
2、在下載頁(yè)面,可以看到選擇操作系統(tǒng),選擇系統(tǒng)后點(diǎn)擊下載。(我這里下載的Windows版本)
3下載完成后,解壓文件,找到下載位置
4、配置環(huán)境變量
- 打開文件,選擇此電腦,右鍵屬性打開屬性,選擇高級(jí)系統(tǒng)設(shè)置打開,選擇環(huán)境變量。
- 找到系統(tǒng)變量,選擇新建,輸入以下信息,單擊確認(rèn)。
- 在系統(tǒng)變量里找到Path,將ES_HOME添加進(jìn)去,然后選擇確定。
5、配置文件修改
進(jìn)入下載文件的路徑,打開進(jìn)入config,找到elasticsearch.yml ,底部添加如下配置(此配置適用elasticsearch-8.1.2,8.x以下版本可能需要修改配置)。
# 換個(gè)集群的名字,免得跟別人的集群混在一起
cluster.name: el-m
# 換個(gè)節(jié)點(diǎn)名字
node.name: el_node_m1
# 修改一下ES的監(jiān)聽地址,這樣別的機(jī)器也可以訪問
network.host: 0.0.0.0
#設(shè)置對(duì)外服務(wù)的http端口,默認(rèn)為9200
http.port: 9200
#設(shè)置索引數(shù)據(jù)的存儲(chǔ)路徑
path.data: E:\elasticsearch-8.1.2\data #換成自己的路徑
#設(shè)置日志文件的存儲(chǔ)路徑
path.logs: E:\elasticsearch-8.1.2\logs #換成自己的路徑
# 關(guān)閉http訪問限制
xpack.security.enabled: false
# 增加新的參數(shù),head插件可以訪問es
http.cors.enabled: true
http.cors.allow-origin: "*"
#----------------------- BEGIN SECURITY AUTO CONFIGURATION -----------------------
# Enable security features
#xpack.security.enabled: false
xpack.security.enrollment.enabled: true
# Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
xpack.security.http.ssl:
enabled: false
keystore.path: certs/http.p12
# Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl:
enabled: true
verification_mode: certificate
keystore.path: certs/transport.p12
truststore.path: certs/transport.p12
# Create a new cluster with the current node only
# Additional nodes can still join the cluster later
cluster.initial_master_nodes: ["el_node_m1"] #注意,這個(gè)要與node.name填寫一致
#----------------------- END SECURITY AUTO CONFIGURATION -------------------------
6、啟動(dòng)服務(wù),
cmd打開窗口,在命令行中cd進(jìn)入路徑
cd /d E:\elasticsearch-8.1.2\bin
進(jìn)入到bin路徑下后輸入:elasticsearch.bat
看到starting則啟動(dòng)成功
注:若未啟動(dòng)成功,可參考《win10安裝elasticSearch8.1.2,報(bào)錯(cuò)解決方案》
瀏覽器訪問網(wǎng)址:http://localhost:9200/,顯示如下。文章來源:http://www.zghlxwxcb.cn/news/detail-402137.html
下一步 《Elasticsearch可視化管理工具 —Elasticsearch-head部署安裝》文章來源地址http://www.zghlxwxcb.cn/news/detail-402137.html
到了這里,關(guān)于win10部署安裝Elasticsearch8.1.2的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!