前言
- win10
- elasticsearch 8.9.0
准备
安装 jdk
ElasticSearch 是基于lucence开发的,也就是运行需要java jdk支持。
ElasticSearch 8.9.0 自带 OpenJDK ,无需再安装jdk。
安装nodejs
在Windows系统安装Nodejs
ElasticSearch下载
下载安装包:https://www.elastic.co/downloads/elasticsearch
ElasticSearch-head 下载
下载源码:https://github.com/mobz/elasticsearch-head
安装ElasticSearch
默认安装
- 下载安装包后解压
2. 进入bin目录下,双击执行elasticsearch.bat
3. 看到started说明启动成功,打开浏览器测试一下
https://localhost:9200
PS:默认开启安全和https,因此此处是https。
PS:默认开启安全,会提示输入用户名和密码。如想登录看看,参考“设置用户名密码访问”部分的内容。
禁用安全
- 修改 ES/config/elasticsearch.yml 文件
xpack.security.enabled: false xpack.security.http.ssl.enabled: false http.cors: enabled: true allow-origin: "*"
- 进入bin目录下,双击执行elasticsearch.bat
- 看到started说明启动成功,打开浏览器测试一下,如下图
http://localhost:9200
PS:此处是http。
安装ElasticSearch-head插件
- 解压源码
- 进入 elasticsearch-head 目录,执行命令:
npm install
(如果报错,尝试:npm install phantomjs-prebuilt@2.1.16 --ignore-scripts
) - 启动:
npm run start
- 打开: http://localhost:9100/
设置用户名密码访问
-
修改 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
默认情况下,elastic
的用户已存在且已设置了密码,需要执行命令重置密码: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 默认用户名和密码
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%以上的磁盘空间可用。文章来源:https://www.toymoban.com/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文章来源地址https://www.toymoban.com/news/detail-768737.html
到了这里,关于windows环境下,安装elasticsearch8.9.0的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!