Skip to content

Commit

Permalink
use of Replicas
Browse files Browse the repository at this point in the history
  • Loading branch information
shlomi-noach committed Jun 9, 2020
1 parent 9a215e5 commit 322e567
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions docs/script-samples.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ $ orchestrator-client -c api -path instance/$master_host/3306 | jq .
"Int64": 0,
"Valid": true
},
"SlaveHosts": [
"Replicas": [
{
"Hostname": "mysql-2222.dc1.domain.net",
"Port": 3306
Expand Down Expand Up @@ -286,14 +286,14 @@ mysql-00ff.dc1.domain.net
#### How many replicas to a specific instance?

```shell
$ orchestrator-client -c api -path instance/$master_host/3306 | jq '.SlaveHosts | length'
$ orchestrator-client -c api -path instance/$master_host/3306 | jq '.Replicas | length'
3
```

#### How many replicas to each of a cluster's members?

```shell
$ orchestrator-client -c api -path cluster/alias/mycluster | jq '.[].SlaveHosts | length'
$ orchestrator-client -c api -path cluster/alias/mycluster | jq '.[].Replicas | length'
3
0
2
Expand Down
6 changes: 3 additions & 3 deletions docs/using-the-web-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ This sample is followed by a field breakdown:
"Int64": 0,
"Valid": true
},
"SlaveHosts": [ ],
"Replicas": [ ],
"ClusterName": "mysql.01.instance.com:3306",
"DataCenter": "",
"PhysicalEnvironment": "",
Expand Down Expand Up @@ -137,7 +137,7 @@ The structure of an Instance evolves and documentation will always fall behind.
* `SQLDelay`: the configured `MASTER_DELAY`
* `ExecutedGtidSet`: if using Oracle GTID, the executed GTID set
* `ReplicationLagSeconds`: when `ReplicationLagQuery` provided, the computed replica lag; otherwise same as `SecondsBehindMaster`
* `SlaveHosts`: list of MySQL replicas _hostname & port_)
* `Replicas`: list of MySQL replicas _hostname & port_)
* `ClusterName`: name of cluster this instance is associated with; uniquely identifies cluster
* `DataCenter`: (metadata) name of data center, infered by `DataCenterPattern` config variable
* `PhysicalEnvironment`: (metadata) name of environment, infered by `PhysicalEnvironmentPattern` config variable
Expand Down Expand Up @@ -191,5 +191,5 @@ curl -s "http://my.orchestrator.service.com/api/instance-replicas/${master}" | j
- Find all intermediate masters in `my_cluster`:

```
curl -s "http://my.orchestrator.service.com/api/cluster/alias/my_cluster" | jq '.[] | select(.MasterKey.Hostname!="") | select(.SlaveHosts!=[]) .Key.Hostname'
curl -s "http://my.orchestrator.service.com/api/cluster/alias/my_cluster" | jq '.[] | select(.MasterKey.Hostname!="") | select(.Replicas!=[]) .Key.Hostname'
```
4 changes: 2 additions & 2 deletions resources/public/js/audit-failure-detection.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ $(document).ready(function() {

var moreInfo = "";
moreInfo += '<div>Detected: ' + audit.RecoveryStartTimestamp + '</div>';
if (audit.AnalysisEntry.SlaveHosts.length > 0) {
if (audit.AnalysisEntry.Replicas.length > 0) {
moreInfo += '<div>' + audit.AnalysisEntry.CountReplicas + ' replicating hosts :<ul>';
audit.AnalysisEntry.SlaveHosts.forEach(function(instanceKey) {
audit.AnalysisEntry.Replicas.forEach(function(instanceKey) {
moreInfo += "<li><code>" + getInstanceTitle(instanceKey.Hostname, instanceKey.Port) + "</code></li>";
});
moreInfo += "</ul></div>";
Expand Down
4 changes: 2 additions & 2 deletions resources/public/js/audit-recovery.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ $(document).ready(function() {
});
moreInfo += "</ul></div>";
}
if (audit.AnalysisEntry.SlaveHosts.length > 0) {
if (audit.AnalysisEntry.Replicas.length > 0) {
moreInfo += '<div>' + audit.AnalysisEntry.CountReplicas + ' replicating hosts :<ul>';
audit.AnalysisEntry.SlaveHosts.forEach(function(instanceKey) {
audit.AnalysisEntry.Replicas.forEach(function(instanceKey) {
moreInfo += "<li><code>" + getInstanceTitle(instanceKey.Hostname, instanceKey.Port) + "</code></li>";
});
moreInfo += "</ul></div>";
Expand Down
4 changes: 2 additions & 2 deletions resources/public/js/orchestrator.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ function openNodeModal(node) {
if (node.LogBinEnabled) {
addNodeModalDataAttribute("Self coordinates", node.SelfBinlogCoordinates.LogFile + ":" + node.SelfBinlogCoordinates.LogPos);
}
var td = addNodeModalDataAttribute("Num replicas", node.SlaveHosts.length);
var td = addNodeModalDataAttribute("Num replicas", node.Replicas.length);
$('#node_modal button[data-btn=regroup-replicas]').appendTo(td.find("div"))
addNodeModalDataAttribute("Server ID", node.ServerID);
if (node.ServerUUID) {
Expand Down Expand Up @@ -536,7 +536,7 @@ function openNodeModal(node) {
}

$('#node_modal button[data-btn=regroup-replicas]').hide();
if (node.SlaveHosts.length > 1) {
if (node.Replicas.length > 1) {
$('#node_modal button[data-btn=regroup-replicas]').show();
}
$('#node_modal button[data-btn=regroup-replicas]').click(function() {
Expand Down

0 comments on commit 322e567

Please sign in to comment.