在我 运行 springboot Java 程序和 elasticsearch 传输节点未加载到我的 Java 程序后,Elasticsearch 停止工作
Elasticsearch stops working after I run the springboot Java program and elasticsearch transport node is not loading in my Java Program
Elasticsearch 版本 8.1.3
Java 版本 1.8
我正在尝试将 elasticsearch 与 Java springboot 程序连接起来。我的 Elasticsearch 工作正常,直到我 运行 Java 程序,我的 java 程序也工作正常,但使用“.d.e.r.s.AbstractElasticsearchRepository :无法加载 elasticsearch 节点: org.elasticsearch.client.transport.NoNodeAvailableException:None 个已配置节点可用:[{#transport#-1}{LsJSQJtCS56wr7IM_S0h4Q}{localhost}{127.0.0.1:9300}]"关于 springboot 错误。
此外,一旦我 运行 我的程序 java 应用程序 elasticsearch 停止使用“[WARN ][o.e.x.c.s.t.n.SecurityNetty4Transport] [DESKTOP-ADQ0I0S] 收到明文流量在加密通道上,关闭连接 Netty4TcpChannel{localAddress=/127.0.0.1:9300, remoteAddress=/127.0.0.1:59255, profile=default}"
我的pom.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>
4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.elasticsearch</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>spring-boot-elasticsearch-example</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
Application.properties 文件
spring.data.elasticsearch.cluster-name=mycluster
spring.data.elasticsearch.cluster-nodes=localhost:9300
我的 java 程序的输出
. ____ _ __ _ _
/\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.1.RELEASE)
2022-04-22 20:53:48.890 INFO 18300 --- [ restartedMain] pringBootElasticsearchExampleApplication : Starting SpringBootElasticsearchExampleApplication on DESKTOP-ADQ0I0S with PID 18300 (started by Hp in D:\STS Project\demo)
2022-04-22 20:53:48.895 INFO 18300 --- [ restartedMain] pringBootElasticsearchExampleApplication : No active profile set, falling back to default profiles: default
2022-04-22 20:53:49.012 INFO 18300 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2022-04-22 20:53:49.012 INFO 18300 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2022-04-22 20:53:50.085 INFO 18300 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
2022-04-22 20:53:50.169 INFO 18300 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 77ms. Found 1 repository interfaces.
2022-04-22 20:53:51.242 INFO 18300 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2022-04-22 20:53:51.280 INFO 18300 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2022-04-22 20:53:51.281 INFO 18300 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/9.0.13
2022-04-22 20:53:51.302 INFO 18300 --- [ restartedMain] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [D:\STS\sts-4.13.0.RELEASE\plugins\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.1.v20211116-1657\jre\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;D:/STS/sts-4.13.0.RELEASE//plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.1.v20211116-1657/jre/bin/server;D:/STS/sts-4.13.0.RELEASE//plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.1.v20211116-1657/jre/bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files\Java\jdk1.8.0_202\bin;C:\Program Files\Git\cmd;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC0\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\Tools\Binn\;C:\Program Files\Microsoft SQL Server0\Tools\Binn\;C:\Program Files\Microsoft SQL Server0\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\DTS\Binn\;C:\Program Files\Azure Data Studio\bin;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\MySQL\MySQL Shell 8.0\bin\;C:\Users\Hp\AppData\Local\Microsoft\WindowsApps;;C:\Users\Hp\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Hp\AppData\Roaming\npm;C:\Program Files\Azure Data Studio\bin;C:\Program Files\Azure Data Studio\bin;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.1\bin;;D:\STS\sts-4.13.0.RELEASE;;.]
2022-04-22 20:53:51.464 INFO 18300 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2022-04-22 20:53:51.464 INFO 18300 --- [ restartedMain] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2452 ms
2022-04-22 20:53:51.996 INFO 18300 --- [ restartedMain] o.elasticsearch.plugins.PluginsService : no modules loaded
2022-04-22 20:53:51.997 INFO 18300 --- [ restartedMain] o.elasticsearch.plugins.PluginsService : loaded plugin [org.elasticsearch.index.reindex.ReindexPlugin]
2022-04-22 20:53:51.997 INFO 18300 --- [ restartedMain] o.elasticsearch.plugins.PluginsService : loaded plugin [org.elasticsearch.join.ParentJoinPlugin]
2022-04-22 20:53:51.998 INFO 18300 --- [ restartedMain] o.elasticsearch.plugins.PluginsService : loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]
2022-04-22 20:53:51.998 INFO 18300 --- [ restartedMain] o.elasticsearch.plugins.PluginsService : loaded plugin [org.elasticsearch.script.mustache.MustachePlugin]
2022-04-22 20:53:51.998 INFO 18300 --- [ restartedMain] o.elasticsearch.plugins.PluginsService : loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2022-04-22 20:53:53.600 INFO 18300 --- [ restartedMain] o.s.d.e.c.TransportClientFactoryBean : Adding transport node : 127.0.0.1:9300
2022-04-22 20:53:53.962 INFO 18300 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2022-04-22 20:53:53.985 ERROR 18300 --- [ restartedMain] .d.e.r.s.AbstractElasticsearchRepository : failed to load elasticsearch nodes : org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [{#transport#-1}{LsJSQJtCS56wr7IM_S0h4Q}{localhost}{127.0.0.1:9300}]
2022-04-22 20:53:54.354 INFO 18300 --- [ restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2022-04-22 20:53:54.920 INFO 18300 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2022-04-22 20:53:54.924 INFO 18300 --- [ restartedMain] pringBootElasticsearchExampleApplication : Started SpringBootElasticsearchExampleApplication in 6.707 seconds (JVM running for 8.106)
当我 运行 Java 程序
时,我就进入了 elasticsearch 终端
[2022-04-22T20:46:04,821][INFO ][o.e.i.g.DatabaseNodeService] [DESKTOP-ADQ0I0S] successfully loaded geoip database file [GeoLite2-City.mmdb]
[2022-04-22T20:53:53,786][WARN ][o.e.x.c.s.t.n.SecurityNetty4Transport] [DESKTOP-ADQ0I0S] received plaintext traffic on an encrypted channel, closing connection Netty4TcpChannel{localAddress=/127.0.0.1:9300, remoteAddress=/127.0.0.1:59255, profile=default}
要使用 Java 访问 Elasticsearch 我已经学习了这个 YouTube 视频教程
[1]: https://www.youtube.com/watch?v=dlChXjE7IHw&t=541s
此外,我无法在我的模型的@Document 注释中添加类型和分片参数。它只接受
@Document(indexName= "myindex")
根据视频应该是
@Document(indexName= "myindex" type="customer", shards=2)
elasticsearch.yml 文件
cluster.name: mycluster
path.data: D:\STS Project\demo
action.auto_create_index: .monitoring*,.watches,.triggered_watches,.watcher-history*,.ml*
xpack.security.enabled: true
xpack.security.enrollment.enabled: true
xpack.security.http.ssl:
enabled: true
keystore.path: certs/http.p12
xpack.security.transport.ssl:
enabled: true
verification_mode: certificate
keystore.path: certs/transport.p12
truststore.path: certs/transport.p12
cluster.initial_master_nodes: ["DESKTOP-ADQ0I0S"]
http.host: [_local_, _site_]
我使用的传输客户端 9300 在 Elasticsearch 7 中已弃用且在版本 8 中不受支持,我使用的是版本 8.1.3。
这里我们可以使用支持的Elastic版本7.x或者使用ElasticsearchJavaAPI客户端。 [Elasticsearch Java API 客户端 8.1.3] Elasticsearch Java API Client 8.1.3
Elasticsearch 版本 8.1.3 Java 版本 1.8
我正在尝试将 elasticsearch 与 Java springboot 程序连接起来。我的 Elasticsearch 工作正常,直到我 运行 Java 程序,我的 java 程序也工作正常,但使用“.d.e.r.s.AbstractElasticsearchRepository :无法加载 elasticsearch 节点: org.elasticsearch.client.transport.NoNodeAvailableException:None 个已配置节点可用:[{#transport#-1}{LsJSQJtCS56wr7IM_S0h4Q}{localhost}{127.0.0.1:9300}]"关于 springboot 错误。 此外,一旦我 运行 我的程序 java 应用程序 elasticsearch 停止使用“[WARN ][o.e.x.c.s.t.n.SecurityNetty4Transport] [DESKTOP-ADQ0I0S] 收到明文流量在加密通道上,关闭连接 Netty4TcpChannel{localAddress=/127.0.0.1:9300, remoteAddress=/127.0.0.1:59255, profile=default}"
我的pom.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>
4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.elasticsearch</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>spring-boot-elasticsearch-example</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
Application.properties 文件
spring.data.elasticsearch.cluster-name=mycluster
spring.data.elasticsearch.cluster-nodes=localhost:9300
我的 java 程序的输出
. ____ _ __ _ _
/\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.1.RELEASE)
2022-04-22 20:53:48.890 INFO 18300 --- [ restartedMain] pringBootElasticsearchExampleApplication : Starting SpringBootElasticsearchExampleApplication on DESKTOP-ADQ0I0S with PID 18300 (started by Hp in D:\STS Project\demo)
2022-04-22 20:53:48.895 INFO 18300 --- [ restartedMain] pringBootElasticsearchExampleApplication : No active profile set, falling back to default profiles: default
2022-04-22 20:53:49.012 INFO 18300 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2022-04-22 20:53:49.012 INFO 18300 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2022-04-22 20:53:50.085 INFO 18300 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
2022-04-22 20:53:50.169 INFO 18300 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 77ms. Found 1 repository interfaces.
2022-04-22 20:53:51.242 INFO 18300 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2022-04-22 20:53:51.280 INFO 18300 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2022-04-22 20:53:51.281 INFO 18300 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/9.0.13
2022-04-22 20:53:51.302 INFO 18300 --- [ restartedMain] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [D:\STS\sts-4.13.0.RELEASE\plugins\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.1.v20211116-1657\jre\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;D:/STS/sts-4.13.0.RELEASE//plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.1.v20211116-1657/jre/bin/server;D:/STS/sts-4.13.0.RELEASE//plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.1.v20211116-1657/jre/bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files\Java\jdk1.8.0_202\bin;C:\Program Files\Git\cmd;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC0\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\Tools\Binn\;C:\Program Files\Microsoft SQL Server0\Tools\Binn\;C:\Program Files\Microsoft SQL Server0\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\DTS\Binn\;C:\Program Files\Azure Data Studio\bin;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\MySQL\MySQL Shell 8.0\bin\;C:\Users\Hp\AppData\Local\Microsoft\WindowsApps;;C:\Users\Hp\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Hp\AppData\Roaming\npm;C:\Program Files\Azure Data Studio\bin;C:\Program Files\Azure Data Studio\bin;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.1\bin;;D:\STS\sts-4.13.0.RELEASE;;.]
2022-04-22 20:53:51.464 INFO 18300 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2022-04-22 20:53:51.464 INFO 18300 --- [ restartedMain] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2452 ms
2022-04-22 20:53:51.996 INFO 18300 --- [ restartedMain] o.elasticsearch.plugins.PluginsService : no modules loaded
2022-04-22 20:53:51.997 INFO 18300 --- [ restartedMain] o.elasticsearch.plugins.PluginsService : loaded plugin [org.elasticsearch.index.reindex.ReindexPlugin]
2022-04-22 20:53:51.997 INFO 18300 --- [ restartedMain] o.elasticsearch.plugins.PluginsService : loaded plugin [org.elasticsearch.join.ParentJoinPlugin]
2022-04-22 20:53:51.998 INFO 18300 --- [ restartedMain] o.elasticsearch.plugins.PluginsService : loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]
2022-04-22 20:53:51.998 INFO 18300 --- [ restartedMain] o.elasticsearch.plugins.PluginsService : loaded plugin [org.elasticsearch.script.mustache.MustachePlugin]
2022-04-22 20:53:51.998 INFO 18300 --- [ restartedMain] o.elasticsearch.plugins.PluginsService : loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2022-04-22 20:53:53.600 INFO 18300 --- [ restartedMain] o.s.d.e.c.TransportClientFactoryBean : Adding transport node : 127.0.0.1:9300
2022-04-22 20:53:53.962 INFO 18300 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2022-04-22 20:53:53.985 ERROR 18300 --- [ restartedMain] .d.e.r.s.AbstractElasticsearchRepository : failed to load elasticsearch nodes : org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [{#transport#-1}{LsJSQJtCS56wr7IM_S0h4Q}{localhost}{127.0.0.1:9300}]
2022-04-22 20:53:54.354 INFO 18300 --- [ restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2022-04-22 20:53:54.920 INFO 18300 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2022-04-22 20:53:54.924 INFO 18300 --- [ restartedMain] pringBootElasticsearchExampleApplication : Started SpringBootElasticsearchExampleApplication in 6.707 seconds (JVM running for 8.106)
当我 运行 Java 程序
时,我就进入了 elasticsearch 终端[2022-04-22T20:46:04,821][INFO ][o.e.i.g.DatabaseNodeService] [DESKTOP-ADQ0I0S] successfully loaded geoip database file [GeoLite2-City.mmdb]
[2022-04-22T20:53:53,786][WARN ][o.e.x.c.s.t.n.SecurityNetty4Transport] [DESKTOP-ADQ0I0S] received plaintext traffic on an encrypted channel, closing connection Netty4TcpChannel{localAddress=/127.0.0.1:9300, remoteAddress=/127.0.0.1:59255, profile=default}
要使用 Java 访问 Elasticsearch 我已经学习了这个 YouTube 视频教程 [1]: https://www.youtube.com/watch?v=dlChXjE7IHw&t=541s
此外,我无法在我的模型的@Document 注释中添加类型和分片参数。它只接受
@Document(indexName= "myindex")
根据视频应该是
@Document(indexName= "myindex" type="customer", shards=2)
elasticsearch.yml 文件
cluster.name: mycluster
path.data: D:\STS Project\demo
action.auto_create_index: .monitoring*,.watches,.triggered_watches,.watcher-history*,.ml*
xpack.security.enabled: true
xpack.security.enrollment.enabled: true
xpack.security.http.ssl:
enabled: true
keystore.path: certs/http.p12
xpack.security.transport.ssl:
enabled: true
verification_mode: certificate
keystore.path: certs/transport.p12
truststore.path: certs/transport.p12
cluster.initial_master_nodes: ["DESKTOP-ADQ0I0S"]
http.host: [_local_, _site_]
我使用的传输客户端 9300 在 Elasticsearch 7 中已弃用且在版本 8 中不受支持,我使用的是版本 8.1.3。 这里我们可以使用支持的Elastic版本7.x或者使用ElasticsearchJavaAPI客户端。 [Elasticsearch Java API 客户端 8.1.3] Elasticsearch Java API Client 8.1.3