EMsnap commented on code in PR #4595:
URL: https://github.com/apache/incubator-inlong/pull/4595#discussion_r892227046
##########
inlong-audit/audit-store/src/main/java/org/apache/inlong/audit/config/ElasticsearchConfig.java:
##########
@@ -83,14 +86,27 @@ public class ElasticsearchConfig {
@Value("${elasticsearch.auditIdSet}")
private String auditIdSet;
- @Bean(destroyMethod = "close",name = "restClient")
+ @Bean(destroyMethod = "close", name = "restClient")
public RestHighLevelClient initRestClient() {
- final CredentialsProvider credentialsProvider = new
BasicCredentialsProvider();
- credentialsProvider.setCredentials(AuthScope.ANY, new
UsernamePasswordCredentials(username, password));
- RestClientBuilder restClientBuilder = RestClient.builder(new
HttpHost(host, port, "http"))
- .setHttpClientConfigCallback(httpAsyncClientBuilder ->
-
httpAsyncClientBuilder.setDefaultCredentialsProvider(credentialsProvider));
+ // support es cluster with multi hosts
+ List<HttpHost> hosts = new ArrayList<>();
+ String[] hostArrays = host.split(",");
+ for (String h : hostArrays) {
Review Comment:
h is unapparent, host is better
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]