下载地址
Past Releases of Elastic Stack Software | Elastic
解压
解压完的样子
进入BIN目录
D:\Develop\elasticsearch\elasticsearch-7.12.0\bin
按住shift +鼠标右键 打开 powershell 窗口
查看ES版本
.\elasticsearch.bat --version
出现问题了
警告:不赞成使用JAVA_HOME,请使用ES_JAVA_HOME
PS D:\Develop\elasticsearch\elasticsearch-7.12.0\bin> .\elasticsearch.bat --version
"warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME"
Future versions of Elasticsearch will require Java 11; your Java version from [C:\Program Files\Java\jdk1.8.0_241\jre] does not meet this requirement. Consider switching to a distribution of Elasticsearch with a bundled JDK. If you are already using a distribution with a bundled JDK, ensure the JAVA_HOME environment variable is not set.
Warning: with JDK 8 on Windows, Elasticsearch may be unable to derive correct
ergonomic settings due to a JDK issue (JDK-8074459). Please use a newer
version of Java.
Warning: MaxDirectMemorySize may have been miscalculated due to JDK-8074459.
Please use a newer version of Java or set MaxDirectMemorySize explicitly.
Version: 7.12.0, Build: default/zip/78722783c38caa25a70982b5b042074cde5d3b3a/2021-03-18T06:17:15.410153305Z, JVM: 1.8.0_241
新增一个 ES_JAVA_HOME
再次执行 .\elasticsearch.bat --version
PS D:\Develop\elasticsearch\elasticsearch-7.12.0\bin> .\elasticsearch.bat --version
Future versions of Elasticsearch will require Java 11; your Java version from [C:\Program Files\Java\jdk1.8.0_241\jre] does not meet this requirement. Consider switching to a distribution of Elasticsearch with a bundled JDK. If you are already using a distribution with a bundled JDK, ensure the JAVA_HOME environment variable is not set.
Warning: with JDK 8 on Windows, Elasticsearch may be unable to derive correct
ergonomic settings due to a JDK issue (JDK-8074459). Please use a newer
version of Java.
Warning: MaxDirectMemorySize may have been miscalculated due to JDK-8074459.
Please use a newer version of Java or set MaxDirectMemorySize explicitly.
Version: 7.12.0, Build: default/zip/78722783c38caa25a70982b5b042074cde5d3b3a/2021-03-18T06:17:15.410153305Z, JVM: 1.8.0_241
不报错了。
启动ES
.\elasticsearch.bat
提示[2023-08-17T14:30:12,880][INFO ][o.e.x.s.s.SecurityStatusChangeListener] [DESKTOP-QT6GKBM] Active license is now [BASIC]; Security is disabled
活动许可证现在为[BASIC];安全性已禁用
就卡在这里了,哎。
检查是否成功启动
在浏览器中输入:http://localhost:9200/?pretty
出现这样的结果。Elasticsearch 现在已设置并正在运行,但是没有密码保护。 Elastic Stack 免费提供基于角色的访问控制(RBAC)。
先用用试试,在修改他的安全性吧。