基础
官网地址
- 直接下载官方提供的压缩包
- 启动 Elasticsearch,
bin/elasticsearch 或
bin\elasticsearch.bat
插件
这个插件对中文支持友好
github地址
安装指令:
bin/elasticsearch-plugin install https://get.infini.cloud/elasticsearch/analysis-ik/9.4.2
注意: 请务必将版本号替换为您的
Elasticsearch 版本号。
设置JVM 堆大小
G:\elasticsearch-9.4.2\config\jvm.options
1 2 3 4
| 堆大小由 Elasticsearch 根据系统可用内存以及每个节点所配置的职责自动设置。如果需要指定堆大小,应通过 jvm.options.d 目录中的文件进行设置,该文件需以 .options 结尾,并将最小值和最大值设为相同的数值。例如,若要将堆大小设置为 4 GB,请在 jvm.options.d 目录中创建一个新文件,内容如下:
-Xms4g -Xmx4g
|
关闭安全策略
G:\elasticsearch-9.4.2\config\elasticsearch.yml
1 2 3 4 5 6 7 8 9 10
| # 彻底关闭安全验证,本地开发无需密码 # Enable security features xpack.security.enabled: false # 确保注册功能也一并关闭(避免冲突) xpack.security.enrollment.enabled: false # 彻底关闭 HTTPS,本地直接使用 http://localhost:9200 # Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents xpack.security.http.ssl: enabled: false keystore.path: certs/http.p12
|
测试
游览器访问http://localhost:9200/ 确认是否正常启动
返回:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| { "name" : "DESKTOP-AEKPB2Q", "cluster_name" : "elasticsearch", "cluster_uuid" : "WYzAQFk2SoKFpuQ_vQYWJg", "version" : { "number" : "9.4.2", "build_flavor" : "default", "build_type" : "zip", "build_hash" : "c402c2b36d90eae29c0182f86bd9050fd0b746cc", "build_date" : "2026-05-25T22:10:36.017759931Z", "build_snapshot" : false, "lucene_version" : "10.4.0", "minimum_wire_compatibility_version" : "8.19.0", "minimum_index_compatibility_version" : "8.0.0" }, "tagline" : "You Know, for Search" }
|