前言
- win10
- elasticsearch 8.9.0
準(zhǔn)備
安裝 jdk
ElasticSearch 是基于lucence開發(fā)的,也就是運(yùn)行需要java jdk支持。
ElasticSearch 8.9.0 自帶 OpenJDK ,無需再安裝jdk。
安裝nodejs
在Windows系統(tǒng)安裝Nodejs
ElasticSearch下載
下載安裝包:https://www.elastic.co/downloads/elasticsearch
ElasticSearch-head 下載
下載源碼:https://github.com/mobz/elasticsearch-head
安裝ElasticSearch
默認(rèn)安裝
- 下載安裝包后解壓
2. 進(jìn)入bin目錄下,雙擊執(zhí)行elasticsearch.bat
3. 看到started說明啟動(dòng)成功,打開瀏覽器測(cè)試一下
https://localhost:9200
PS:默認(rèn)開啟安全和https,因此此處是https。
PS:默認(rèn)開啟安全,會(huì)提示輸入用戶名和密碼。如想登錄看看,參考“設(shè)置用戶名密碼訪問”部分的內(nèi)容。
禁用安全
- 修改 ES/config/elasticsearch.yml 文件
xpack.security.enabled: false xpack.security.http.ssl.enabled: false http.cors: enabled: true allow-origin: "*"
- 進(jìn)入bin目錄下,雙擊執(zhí)行elasticsearch.bat
- 看到started說明啟動(dòng)成功,打開瀏覽器測(cè)試一下,如下圖
http://localhost:9200
PS:此處是http。
安裝ElasticSearch-head插件
- 解壓源碼
- 進(jìn)入 elasticsearch-head 目錄,執(zhí)行命令:
npm install
(如果報(bào)錯(cuò),嘗試:npm install phantomjs-prebuilt@2.1.16 --ignore-scripts
) - 啟動(dòng):
npm run start
- 打開: http://localhost:9100/
設(shè)置用戶名密碼訪問
-
修改 ES/config/elasticsearch.yml 文件
xpack.security.enabled: true http.cors: enabled: true allow-origin: "*" allow-headers: Authorization,X-Requested-With,Content-Length,Content-Type
-
重啟elasticsearch
-
elasticsearch 8.9.0
默認(rèn)情況下,elastic
的用戶已存在且已設(shè)置了密碼,需要執(zhí)行命令重置密碼:cmd> elasticsearch-reset-password.bat -u elastic warning: ignoring JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144; using bundled JDK This tool will reset the password of the [elastic] user to an autogenerated value. The password will be printed in the console. Please confirm that you would like to continue [y/N]y Password for the [elastic] user successfully reset. New value: qh1rG*****************
-
打開: http://localhost:9200
-
打開ElasticSearch-head :
http://localhost:9100/?auth_user=elastic&auth_password=changeme
其它
ElasticSearch 默認(rèn)用戶名和密碼
user: elastic
password: changeme
current.health=“RED” + reason: [reconcile-desired-balance]
[2023-11-29T17:45:02,577][INFO ][o.e.c.r.a.AllocationService] [LTOP-F1BU] current.health="RED" message="Cluster health status changed from [YELLOW] to [RED] (reason: [reconcile-desired-balance])." previous.health="YELLOW" reason="reconcile-desired-balance"
檢查磁盤空間,確保至少有10%以上的磁盤空間可用。文章來源:http://www.zghlxwxcb.cn/news/detail-768737.html
參考
https://www.cnblogs.com/hualess/p/11540477.html
https://blog.csdn.net/shen198623/article/details/123045793
https://blog.csdn.net/fenghuibian/article/details/86585344
https://blog.csdn.net/qq_35349114/article/details/100096115
https://huaweicloud.csdn.net/637ef507df016f70ae4ca581.html文章來源地址http://www.zghlxwxcb.cn/news/detail-768737.html
到了這里,關(guān)于windows環(huán)境下,安裝elasticsearch8.9.0的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!