xuanyu66 opened a new issue #6515:
URL: https://github.com/apache/skywalking/issues/6515
Please answer these questions before submitting your issue.
- Why do you submit this issue?
- [X] Question or discussion
___
### Question
- What do you want to know?
If OapNodeās role is receiver, the OAPNodeChecker'method isHealth() will
return unHealth.
```
public static ClusterHealthStatus isHealth(List<RemoteInstance>
remoteInstances) {
if (CollectionUtils.isEmpty(remoteInstances)) {
return ClusterHealthStatus.unHealth("can't get the instance
list");
}
List<RemoteInstance> selfInstances = remoteInstances.stream().
filter(remoteInstance ->
remoteInstance.getAddress().isSelf()).collect(Collectors.toList());
if (CollectionUtils.isEmpty(selfInstances)) {
return ClusterHealthStatus.unHealth("can't get itself");
}
if (remoteInstances.size() > 1 &&
hasIllegalNodeAddress(remoteInstances)) {
return ClusterHealthStatus.unHealth("find illegal node in
cluster mode such as 127.0.0.1, localhost");
}
return ClusterHealthStatus.HEALTH;
}
```
I think OAPNodeChecker should check its role and then decide whether to get
itself.
But how can I get role?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]