|
@ -37,6 +37,10 @@ public class ElasticFactory {
|
|
|
private String securityUser;
|
|
|
@Value("${es.pwflag}")
|
|
|
private String pwflag;
|
|
|
@Value("${es.user}")
|
|
|
private String user;
|
|
|
@Value("${es.password}")
|
|
|
private String password;
|
|
|
//-----------------------------------jestClient----------------------------------------
|
|
|
|
|
|
/**
|
|
@ -62,7 +66,7 @@ public class ElasticFactory {
|
|
|
HttpClientConfig httpClientConfig = new HttpClientConfig
|
|
|
.Builder(Arrays.asList(hostArray))
|
|
|
.multiThreaded(true)
|
|
|
.defaultCredentials("lion","jkzlehr")
|
|
|
.defaultCredentials(user,password)
|
|
|
.maxTotalConnection(50)// 最大链接
|
|
|
.maxConnectionIdleTime(10, TimeUnit.MINUTES)//链接等待时间
|
|
|
.connTimeout(60 * 1000*10)
|