Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
killuaz丶x
SkyWalking
提交
536b7d23
S
SkyWalking
项目概览
killuaz丶x
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyWalking
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
536b7d23
编写于
7月 01, 2021
作者:
wu-sheng
提交者:
GitHub
7月 01, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Support connectTimeout and socketTimeout settings (#7214)
上级
0975809e
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
41 addition
and
10 deletion
+41
-10
CHANGES.md
CHANGES.md
+1
-0
docs/en/setup/backend/configuration-vocabulary.md
docs/en/setup/backend/configuration-vocabulary.md
+4
-0
oap-server/server-bootstrap/src/main/resources/application.yml
...erver/server-bootstrap/src/main/resources/application.yml
+4
-0
oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/elasticsearch/ElasticSearchClient.java
...ver/library/client/elasticsearch/ElasticSearchClient.java
+12
-1
oap-server/server-library/library-client/src/test/java/org/apache/skywalking/oap/server/library/client/elasticsearch/ITElasticSearchClient.java
...r/library/client/elasticsearch/ITElasticSearchClient.java
+1
-1
oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/StorageModuleElasticsearchConfig.java
...lugin/elasticsearch/StorageModuleElasticsearchConfig.java
+12
-0
oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/StorageModuleElasticsearchProvider.java
...gin/elasticsearch/StorageModuleElasticsearchProvider.java
+2
-2
oap-server/server-storage-plugin/storage-elasticsearch7-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch7/StorageModuleElasticsearch7Provider.java
...n/elasticsearch7/StorageModuleElasticsearch7Provider.java
+1
-1
oap-server/server-storage-plugin/storage-elasticsearch7-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch7/client/ElasticSearch7Client.java
...ge/plugin/elasticsearch7/client/ElasticSearch7Client.java
+4
-5
未找到文件。
CHANGES.md
浏览文件 @
536b7d23
...
@@ -61,6 +61,7 @@ Release Notes.
...
@@ -61,6 +61,7 @@ Release Notes.
*
Performance: enhance persistent session mechanism, about differentiating cache timeout for different dimensionality
*
Performance: enhance persistent session mechanism, about differentiating cache timeout for different dimensionality
metrics. The timeout of the cache for minute and hour level metrics has been prolonged to ~5 min.
metrics. The timeout of the cache for minute and hour level metrics has been prolonged to ~5 min.
*
Performance: Add L1 aggregation flush period, which reduce the CPU load and help young GC.
*
Performance: Add L1 aggregation flush period, which reduce the CPU load and help young GC.
*
Support connectTimeout and socketTimeout settings for ElasticSearch6 and ElasticSearch7 storages.
#### UI
#### UI
...
...
docs/en/setup/backend/configuration-vocabulary.md
浏览文件 @
536b7d23
...
@@ -81,6 +81,8 @@ core|default|role|Option values, `Mixed/Receiver/Aggregator`. **Receiver** mode
...
@@ -81,6 +81,8 @@ core|default|role|Option values, `Mixed/Receiver/Aggregator`. **Receiver** mode
| - | - | nameSpace | Prefix of indexes created and used by SkyWalking. | SW_NAMESPACE | - |
| - | - | nameSpace | Prefix of indexes created and used by SkyWalking. | SW_NAMESPACE | - |
| - | - | clusterNodes | ElasticSearch cluster nodes for client connection.| SW_STORAGE_ES_CLUSTER_NODES |localhost|
| - | - | clusterNodes | ElasticSearch cluster nodes for client connection.| SW_STORAGE_ES_CLUSTER_NODES |localhost|
| - | - | protocol | HTTP or HTTPs. | SW_STORAGE_ES_HTTP_PROTOCOL | HTTP|
| - | - | protocol | HTTP or HTTPs. | SW_STORAGE_ES_HTTP_PROTOCOL | HTTP|
| - | - | connectTimeout | Connect timeout of ElasticSearch client. Unit is ms. | SW_STORAGE_ES_CONNECT_TIMEOUT | 500|
| - | - | socketTimeout | Socket timeout of ElasticSearch client. Unit is ms. | SW_STORAGE_ES_SOCKET_TIMEOUT | 30000|
| - | - | user| User name of ElasticSearch cluster| SW_ES_USER | - |
| - | - | user| User name of ElasticSearch cluster| SW_ES_USER | - |
| - | - | password | Password of ElasticSearch cluster | SW_ES_PASSWORD | - |
| - | - | password | Password of ElasticSearch cluster | SW_ES_PASSWORD | - |
| - | - | trustStorePath | Trust JKS file path. Only work when user name and password opened | SW_STORAGE_ES_SSL_JKS_PATH | - |
| - | - | trustStorePath | Trust JKS file path. Only work when user name and password opened | SW_STORAGE_ES_SSL_JKS_PATH | - |
...
@@ -104,6 +106,8 @@ core|default|role|Option values, `Mixed/Receiver/Aggregator`. **Receiver** mode
...
@@ -104,6 +106,8 @@ core|default|role|Option values, `Mixed/Receiver/Aggregator`. **Receiver** mode
| - | - | nameSpace | Prefix of indexes created and used by SkyWalking. | SW_NAMESPACE | - |
| - | - | nameSpace | Prefix of indexes created and used by SkyWalking. | SW_NAMESPACE | - |
| - | - | clusterNodes | ElasticSearch cluster nodes for client connection.| SW_STORAGE_ES_CLUSTER_NODES |localhost|
| - | - | clusterNodes | ElasticSearch cluster nodes for client connection.| SW_STORAGE_ES_CLUSTER_NODES |localhost|
| - | - | protocol | HTTP or HTTPs. | SW_STORAGE_ES_HTTP_PROTOCOL | HTTP|
| - | - | protocol | HTTP or HTTPs. | SW_STORAGE_ES_HTTP_PROTOCOL | HTTP|
| - | - | connectTimeout | Connect timeout of ElasticSearch client. Unit is ms. | SW_STORAGE_ES_CONNECT_TIMEOUT | 500|
| - | - | socketTimeout | Socket timeout of ElasticSearch client. Unit is ms. | SW_STORAGE_ES_SOCKET_TIMEOUT | 30000|
| - | - | user| User name of ElasticSearch cluster| SW_ES_USER | - |
| - | - | user| User name of ElasticSearch cluster| SW_ES_USER | - |
| - | - | password | Password of ElasticSearch cluster | SW_ES_PASSWORD | - |
| - | - | password | Password of ElasticSearch cluster | SW_ES_PASSWORD | - |
| - | - | trustStorePath | Trust JKS file path. Only work when user name and password opened | SW_STORAGE_ES_SSL_JKS_PATH | - |
| - | - | trustStorePath | Trust JKS file path. Only work when user name and password opened | SW_STORAGE_ES_SSL_JKS_PATH | - |
...
...
oap-server/server-bootstrap/src/main/resources/application.yml
浏览文件 @
536b7d23
...
@@ -120,6 +120,8 @@ storage:
...
@@ -120,6 +120,8 @@ storage:
nameSpace
:
${SW_NAMESPACE:""}
nameSpace
:
${SW_NAMESPACE:""}
clusterNodes
:
${SW_STORAGE_ES_CLUSTER_NODES:localhost:9200}
clusterNodes
:
${SW_STORAGE_ES_CLUSTER_NODES:localhost:9200}
protocol
:
${SW_STORAGE_ES_HTTP_PROTOCOL:"http"}
protocol
:
${SW_STORAGE_ES_HTTP_PROTOCOL:"http"}
connectTimeout
:
${SW_STORAGE_ES_CONNECT_TIMEOUT:500}
socketTimeout
:
${SW_STORAGE_ES_SOCKET_TIMEOUT:30000}
user
:
${SW_ES_USER:""}
user
:
${SW_ES_USER:""}
password
:
${SW_ES_PASSWORD:""}
password
:
${SW_ES_PASSWORD:""}
trustStorePath
:
${SW_STORAGE_ES_SSL_JKS_PATH:""}
trustStorePath
:
${SW_STORAGE_ES_SSL_JKS_PATH:""}
...
@@ -146,6 +148,8 @@ storage:
...
@@ -146,6 +148,8 @@ storage:
nameSpace
:
${SW_NAMESPACE:""}
nameSpace
:
${SW_NAMESPACE:""}
clusterNodes
:
${SW_STORAGE_ES_CLUSTER_NODES:localhost:9200}
clusterNodes
:
${SW_STORAGE_ES_CLUSTER_NODES:localhost:9200}
protocol
:
${SW_STORAGE_ES_HTTP_PROTOCOL:"http"}
protocol
:
${SW_STORAGE_ES_HTTP_PROTOCOL:"http"}
connectTimeout
:
${SW_STORAGE_ES_CONNECT_TIMEOUT:500}
socketTimeout
:
${SW_STORAGE_ES_SOCKET_TIMEOUT:30000}
trustStorePath
:
${SW_STORAGE_ES_SSL_JKS_PATH:""}
trustStorePath
:
${SW_STORAGE_ES_SSL_JKS_PATH:""}
trustStorePass
:
${SW_STORAGE_ES_SSL_JKS_PASS:""}
trustStorePass
:
${SW_STORAGE_ES_SSL_JKS_PASS:""}
dayStep
:
${SW_STORAGE_DAY_STEP:1}
# Represent the number of days in the one minute/hour/day index.
dayStep
:
${SW_STORAGE_DAY_STEP:1}
# Represent the number of days in the one minute/hour/day index.
...
...
oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/elasticsearch/ElasticSearchClient.java
浏览文件 @
536b7d23
...
@@ -119,6 +119,8 @@ public class ElasticSearchClient implements Client, HealthCheckable {
...
@@ -119,6 +119,8 @@ public class ElasticSearchClient implements Client, HealthCheckable {
protected
volatile
RestHighLevelClient
client
;
protected
volatile
RestHighLevelClient
client
;
protected
DelegatedHealthChecker
healthChecker
=
new
DelegatedHealthChecker
();
protected
DelegatedHealthChecker
healthChecker
=
new
DelegatedHealthChecker
();
protected
final
ReentrantLock
connectLock
=
new
ReentrantLock
();
protected
final
ReentrantLock
connectLock
=
new
ReentrantLock
();
private
final
int
connectTimeout
;
private
final
int
socketTimeout
;
public
ElasticSearchClient
(
String
clusterNodes
,
public
ElasticSearchClient
(
String
clusterNodes
,
String
protocol
,
String
protocol
,
...
@@ -126,7 +128,9 @@ public class ElasticSearchClient implements Client, HealthCheckable {
...
@@ -126,7 +128,9 @@ public class ElasticSearchClient implements Client, HealthCheckable {
String
trustStorePass
,
String
trustStorePass
,
String
user
,
String
user
,
String
password
,
String
password
,
List
<
IndexNameConverter
>
indexNameConverters
)
{
List
<
IndexNameConverter
>
indexNameConverters
,
int
connectTimeout
,
int
socketTimeout
)
{
this
.
clusterNodes
=
clusterNodes
;
this
.
clusterNodes
=
clusterNodes
;
this
.
protocol
=
protocol
;
this
.
protocol
=
protocol
;
this
.
user
=
user
;
this
.
user
=
user
;
...
@@ -134,6 +138,8 @@ public class ElasticSearchClient implements Client, HealthCheckable {
...
@@ -134,6 +138,8 @@ public class ElasticSearchClient implements Client, HealthCheckable {
this
.
indexNameConverters
=
indexNameConverters
;
this
.
indexNameConverters
=
indexNameConverters
;
this
.
trustStorePath
=
trustStorePath
;
this
.
trustStorePath
=
trustStorePath
;
this
.
trustStorePass
=
trustStorePass
;
this
.
trustStorePass
=
trustStorePass
;
this
.
connectTimeout
=
connectTimeout
;
this
.
socketTimeout
=
socketTimeout
;
}
}
@Override
@Override
...
@@ -183,6 +189,11 @@ public class ElasticSearchClient implements Client, HealthCheckable {
...
@@ -183,6 +189,11 @@ public class ElasticSearchClient implements Client, HealthCheckable {
}
else
{
}
else
{
builder
=
RestClient
.
builder
(
pairsList
.
toArray
(
new
HttpHost
[
0
]));
builder
=
RestClient
.
builder
(
pairsList
.
toArray
(
new
HttpHost
[
0
]));
}
}
builder
.
setRequestConfigCallback
(
requestConfigBuilder
->
requestConfigBuilder
.
setConnectTimeout
(
connectTimeout
)
.
setSocketTimeout
(
socketTimeout
)
);
return
new
RestHighLevelClient
(
builder
);
return
new
RestHighLevelClient
(
builder
);
}
}
...
...
oap-server/server-library/library-client/src/test/java/org/apache/skywalking/oap/server/library/client/elasticsearch/ITElasticSearchClient.java
浏览文件 @
536b7d23
...
@@ -69,7 +69,7 @@ public class ITElasticSearchClient {
...
@@ -69,7 +69,7 @@ public class ITElasticSearchClient {
final
String
esAddress
=
System
.
getProperty
(
"elastic.search.address"
);
final
String
esAddress
=
System
.
getProperty
(
"elastic.search.address"
);
final
String
esProtocol
=
System
.
getProperty
(
"elastic.search.protocol"
);
final
String
esProtocol
=
System
.
getProperty
(
"elastic.search.protocol"
);
client
=
new
ElasticSearchClient
(
esAddress
,
esProtocol
,
""
,
""
,
"test"
,
"test"
,
client
=
new
ElasticSearchClient
(
esAddress
,
esProtocol
,
""
,
""
,
"test"
,
"test"
,
indexNameConverters
(
namespace
)
indexNameConverters
(
namespace
)
,
500
,
6000
);
);
client
.
connect
();
client
.
connect
();
}
}
...
...
oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/StorageModuleElasticsearchConfig.java
浏览文件 @
536b7d23
...
@@ -29,6 +29,18 @@ public class StorageModuleElasticsearchConfig extends ModuleConfig {
...
@@ -29,6 +29,18 @@ public class StorageModuleElasticsearchConfig extends ModuleConfig {
private
String
nameSpace
;
private
String
nameSpace
;
private
String
clusterNodes
;
private
String
clusterNodes
;
String
protocol
=
"http"
;
String
protocol
=
"http"
;
/**
* Connect timeout of ElasticSearch client.
*
* @since 8.7.0
*/
private
int
connectTimeout
=
500
;
/**
* Socket timeout of ElasticSearch client.
*
* @since 8.7.0
*/
private
int
socketTimeout
=
30000
;
/**
/**
* Since 6.4.0, the index of metrics and traces data in minute/hour/month precision are organized in days. ES
* Since 6.4.0, the index of metrics and traces data in minute/hour/month precision are organized in days. ES
* storage creates new indexes in every day.
* storage creates new indexes in every day.
...
...
oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/StorageModuleElasticsearchProvider.java
浏览文件 @
536b7d23
...
@@ -163,11 +163,11 @@ public class StorageModuleElasticsearchProvider extends ModuleProvider {
...
@@ -163,11 +163,11 @@ public class StorageModuleElasticsearchProvider extends ModuleProvider {
elasticSearchClient
=
new
ElasticSearchClient
(
elasticSearchClient
=
new
ElasticSearchClient
(
config
.
getClusterNodes
(),
config
.
getProtocol
(),
config
.
getTrustStorePath
(),
config
config
.
getClusterNodes
(),
config
.
getProtocol
(),
config
.
getTrustStorePath
(),
config
.
getTrustStorePass
(),
config
.
getUser
(),
config
.
getPassword
(),
.
getTrustStorePass
(),
config
.
getUser
(),
config
.
getPassword
(),
indexNameConverters
(
config
.
getNameSpace
())
indexNameConverters
(
config
.
getNameSpace
())
,
config
.
getConnectTimeout
(),
config
.
getSocketTimeout
()
);
);
this
.
registerServiceImplementation
(
this
.
registerServiceImplementation
(
IBatchDAO
.
class
,
IBatchDAO
.
class
,
new
BatchProcessEsDAO
(
elasticSearchClient
,
config
.
getBulkActions
(),
config
new
BatchProcessEsDAO
(
elasticSearchClient
,
config
.
getBulkActions
(),
config
.
getFlushInterval
(),
config
.
getConcurrentRequests
())
.
getFlushInterval
(),
config
.
getConcurrentRequests
())
);
);
this
.
registerServiceImplementation
(
StorageDAO
.
class
,
new
StorageEsDAO
(
elasticSearchClient
));
this
.
registerServiceImplementation
(
StorageDAO
.
class
,
new
StorageEsDAO
(
elasticSearchClient
));
...
...
oap-server/server-storage-plugin/storage-elasticsearch7-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch7/StorageModuleElasticsearch7Provider.java
浏览文件 @
536b7d23
...
@@ -161,7 +161,7 @@ public class StorageModuleElasticsearch7Provider extends ModuleProvider {
...
@@ -161,7 +161,7 @@ public class StorageModuleElasticsearch7Provider extends ModuleProvider {
elasticSearch7Client
=
new
ElasticSearch7Client
(
elasticSearch7Client
=
new
ElasticSearch7Client
(
config
.
getClusterNodes
(),
config
.
getProtocol
(),
config
.
getTrustStorePath
(),
config
config
.
getClusterNodes
(),
config
.
getProtocol
(),
config
.
getTrustStorePath
(),
config
.
getTrustStorePass
(),
config
.
getUser
(),
config
.
getPassword
(),
.
getTrustStorePass
(),
config
.
getUser
(),
config
.
getPassword
(),
indexNameConverters
(
config
.
getNameSpace
())
indexNameConverters
(
config
.
getNameSpace
())
,
config
.
getConnectTimeout
(),
config
.
getSocketTimeout
()
);
);
this
.
registerServiceImplementation
(
this
.
registerServiceImplementation
(
IBatchDAO
.
class
,
IBatchDAO
.
class
,
...
...
oap-server/server-storage-plugin/storage-elasticsearch7-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch7/client/ElasticSearch7Client.java
浏览文件 @
536b7d23
...
@@ -78,9 +78,6 @@ import org.elasticsearch.index.reindex.BulkByScrollResponse;
...
@@ -78,9 +78,6 @@ import org.elasticsearch.index.reindex.BulkByScrollResponse;
import
org.elasticsearch.index.reindex.DeleteByQueryRequest
;
import
org.elasticsearch.index.reindex.DeleteByQueryRequest
;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
/**
*
*/
@Slf4j
@Slf4j
public
class
ElasticSearch7Client
extends
ElasticSearchClient
{
public
class
ElasticSearch7Client
extends
ElasticSearchClient
{
public
ElasticSearch7Client
(
final
String
clusterNodes
,
public
ElasticSearch7Client
(
final
String
clusterNodes
,
...
@@ -89,10 +86,12 @@ public class ElasticSearch7Client extends ElasticSearchClient {
...
@@ -89,10 +86,12 @@ public class ElasticSearch7Client extends ElasticSearchClient {
final
String
trustStorePass
,
final
String
trustStorePass
,
final
String
user
,
final
String
user
,
final
String
password
,
final
String
password
,
List
<
IndexNameConverter
>
indexNameConverters
)
{
List
<
IndexNameConverter
>
indexNameConverters
,
int
connectTimeout
,
int
socketTimeout
)
{
super
(
super
(
clusterNodes
,
protocol
,
trustStorePath
,
trustStorePass
,
user
,
password
,
clusterNodes
,
protocol
,
trustStorePath
,
trustStorePass
,
user
,
password
,
indexNameConverters
indexNameConverters
,
connectTimeout
,
socketTimeout
);
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录