mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'sharding' of https://github.com/triAGENS/ArangoDB into sharding
This commit is contained in:
commit
b79313e697
|
@ -61,14 +61,7 @@
|
||||||
k.runInfo = config.runInfo;
|
k.runInfo = config.runInfo;
|
||||||
return k;
|
return k;
|
||||||
},
|
},
|
||||||
cleanUp = function() {
|
startUp = function(req, res) {
|
||||||
var k = getStarter();
|
|
||||||
if (k) {
|
|
||||||
k.cleanup();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
// only make these functions available in dispatcher mode!
|
|
||||||
controller.post("/plan", function(req, res) {
|
|
||||||
cleanUp();
|
cleanUp();
|
||||||
var config = {},
|
var config = {},
|
||||||
input = req.body(),
|
input = req.body(),
|
||||||
|
@ -108,6 +101,7 @@
|
||||||
config.dispatchers["d" + i] = inf;
|
config.dispatchers["d" + i] = inf;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
require("console").log(JSON.stringify(config));
|
||||||
result.config = config;
|
result.config = config;
|
||||||
planner = new cluster.Planner(config);
|
planner = new cluster.Planner(config);
|
||||||
result.plan = planner.getPlan();
|
result.plan = planner.getPlan();
|
||||||
|
@ -116,7 +110,16 @@
|
||||||
result.runInfo = tmp.runInfo;
|
result.runInfo = tmp.runInfo;
|
||||||
plans.storeConfig(result);
|
plans.storeConfig(result);
|
||||||
res.json(result);
|
res.json(result);
|
||||||
});
|
},
|
||||||
|
cleanUp = function() {
|
||||||
|
var k = getStarter();
|
||||||
|
if (k) {
|
||||||
|
k.cleanup();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// only make these functions available in dispatcher mode!
|
||||||
|
controller.post("/plan", startUp);
|
||||||
|
controller.put("/plan", startUp);
|
||||||
|
|
||||||
controller.get("/plan", function(req, res) {
|
controller.get("/plan", function(req, res) {
|
||||||
res.json(plans.loadConfig());
|
res.json(plans.loadConfig());
|
||||||
|
@ -128,7 +131,13 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
controller.get("/healthcheck", function(req, res) {
|
controller.get("/healthcheck", function(req, res) {
|
||||||
res.json(!getStarter().isHealthy().error);
|
var out = getStarter().isHealthy();
|
||||||
|
var stf = JSON.stringify(out);
|
||||||
|
if (out.error || stf.indexOf("NOT-FOUND") !== -1) {
|
||||||
|
res.json(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
res.json(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
controller.get("/shutdown", function(req, res) {
|
controller.get("/shutdown", function(req, res) {
|
||||||
|
|
|
@ -10,10 +10,7 @@
|
||||||
|
|
||||||
url: "cluster/plan",
|
url: "cluster/plan",
|
||||||
|
|
||||||
isNew : function() {
|
idAttribute: "config",
|
||||||
return true;
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
getCoordinator: function() {
|
getCoordinator: function() {
|
||||||
if (this._coord) {
|
if (this._coord) {
|
||||||
|
@ -53,7 +50,6 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -107,11 +107,10 @@
|
||||||
if (!this.clusterDownView) {
|
if (!this.clusterDownView) {
|
||||||
this.clusterDownView = new window.ClusterDownView();
|
this.clusterDownView = new window.ClusterDownView();
|
||||||
}
|
}
|
||||||
this.clusterDownView.render(content);
|
this.clusterDownView.render();
|
||||||
},
|
},
|
||||||
|
|
||||||
dashboard: function(server) {
|
dashboard: function(server) {
|
||||||
console.log(server);
|
|
||||||
if (this.statisticsDescription === undefined) {
|
if (this.statisticsDescription === undefined) {
|
||||||
this.statisticsDescription = new window.StatisticsDescription();
|
this.statisticsDescription = new window.StatisticsDescription();
|
||||||
this.statisticsDescription.fetch({
|
this.statisticsDescription.fetch({
|
||||||
|
@ -121,9 +120,6 @@
|
||||||
if (this.statistics === undefined) {
|
if (this.statistics === undefined) {
|
||||||
this.statisticsCollection = new window.StatisticsCollection();
|
this.statisticsCollection = new window.StatisticsCollection();
|
||||||
}
|
}
|
||||||
console.log(this.statisticsCollection);
|
|
||||||
console.log(this.statisticsDescription);
|
|
||||||
console.log( window.arangoDocumentsStore);
|
|
||||||
if (this.dashboardView === undefined) {
|
if (this.dashboardView === undefined) {
|
||||||
this.dashboardView = new dashboardView({
|
this.dashboardView = new dashboardView({
|
||||||
collection: this.statisticsCollection,
|
collection: this.statisticsCollection,
|
||||||
|
|
|
@ -7,16 +7,12 @@
|
||||||
window.App = new window.ClusterRouter();
|
window.App = new window.ClusterRouter();
|
||||||
Backbone.history.start();
|
Backbone.history.start();
|
||||||
|
|
||||||
//für zum testen
|
|
||||||
// this.clusterPlan.set({"plan": "blub"});
|
|
||||||
|
|
||||||
if(window.App.clusterPlan.get("plan")) {
|
if(window.App.clusterPlan.get("plan")) {
|
||||||
if(window.App.clusterPlan.isAlive()) {
|
if(window.App.clusterPlan.isAlive()) {
|
||||||
window.App.showCluster();
|
window.App.showCluster();
|
||||||
} else {
|
} else {
|
||||||
window.App.handleClusterDown();
|
window.App.handleClusterDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
window.App.planScenario();
|
window.App.planScenario();
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,34 +24,6 @@
|
||||||
<ul class="thumbnails2">
|
<ul class="thumbnails2">
|
||||||
<div class="headerBar">
|
<div class="headerBar">
|
||||||
<a class="arangoHeader">Cluster Management</a>
|
<a class="arangoHeader">Cluster Management</a>
|
||||||
<div class="headerButtonBar pull-right">
|
|
||||||
<ul class="headerButtonList">
|
|
||||||
<li class="enabled">
|
|
||||||
<a id="importConnectInfo" class="headerButton">
|
|
||||||
<span class="icon_arangodb_youtube" title="Connect to Cluster"></span>
|
|
||||||
</a>
|
|
||||||
<a id="importRunInfo" class="headerButton">
|
|
||||||
<span class="icon_arangodb_export" title="Upload Cluster Information"></span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="runinfoDropdownImport" class="dropdownImport">
|
|
||||||
<div class="queryline">
|
|
||||||
<input id="importRunInfoFile" name="importRunInfo" type="file" accept="application/json" />
|
|
||||||
<button id="confirmRunInfoImport" class="button-success btn-old-padding" style="float:right">
|
|
||||||
<img id="uploadIndicator" style="display: none;" src="img/ajax-loader.gif"/>Import Plan
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="connectDropdownImport" class="dropdownImport">
|
|
||||||
<div class="queryline">
|
|
||||||
<input id="connectInfoFile" name="connectionInfo" type="file" accept="application/json" />
|
|
||||||
<button id="confirmConnectImport" class="button-success btn-old-padding" style="float:right">
|
|
||||||
<img id="connectIndicator" style="display: none;" src="img/ajax-loader.gif"/>Connect to Cluster
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
|
@ -4,60 +4,26 @@
|
||||||
<a class="arangoHeader">Plan a single server test configuration</a>
|
<a class="arangoHeader">Plan a single server test configuration</a>
|
||||||
</div>
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
<%
|
|
||||||
if (config) {
|
|
||||||
dispatcher = config.dispatcher;
|
|
||||||
hostname = dispatcher.split(':')[0];
|
|
||||||
port = dispatcher.split(':')[1];
|
|
||||||
numberDBServers = config.numberDBServers;
|
|
||||||
numberCoordinators = config.numberCoordinators;
|
|
||||||
}
|
|
||||||
%>
|
|
||||||
<form action="javascript:void(0);" autocomplete="on" class="form-horizontal">
|
<form action="javascript:void(0);" autocomplete="on" class="form-horizontal">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label for="host" class="control-label">Server:</label>
|
<label for="host" class="control-label">Server:</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input type="text" id="host" placeholder="Server" class="input-xlarge"
|
<input type="text" id="host" placeholder="Server" class="input-xlarge" value="<%=hostname%>"></input>
|
||||||
<%if (config) {%>
|
|
||||||
value="<%=hostname%>"
|
|
||||||
<%} else {%>
|
|
||||||
value="<%=window.location.hostname%>"
|
|
||||||
<%}%>
|
|
||||||
></input>
|
|
||||||
<span class="searchEqualsLabel">:</span>
|
<span class="searchEqualsLabel">:</span>
|
||||||
<input type="text" maxlength="5" class="input-small" id="port" placeholder="port"
|
<input type="text" maxlength="5" class="input-small" id="port" placeholder="port" value="<%=port%>" ></input>
|
||||||
<%if (config) {%>
|
|
||||||
console.log("blub);
|
|
||||||
value="<%=port%>"
|
|
||||||
<%} else {%>
|
|
||||||
value="<%=window.location.port%>"
|
|
||||||
<%}%>
|
|
||||||
></input>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label for="coordinators" class="control-label">Coordinators:</label>
|
<label for="coordinators" class="control-label">Coordinators:</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input type="text" id="coordinators" placeholder="Number of Coordinators" class="input-xlarge"
|
<input type="text" id="coordinators" placeholder="Number of Coordinators" class="input-xlarge" value="<%=coords%>" ></input>
|
||||||
<%if (config) {%>
|
|
||||||
value="<%=numberCoordinators%>"
|
|
||||||
<%} else {%>
|
|
||||||
value="1"
|
|
||||||
<%}%>
|
|
||||||
></input>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label for="dbs" class="control-label">DB Servers:</label>
|
<label for="dbs" class="control-label">DB Servers:</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input type="text" id="dbs" placeholder="Number of DBServers" class="input-xlarge"
|
<input type="text" id="dbs" placeholder="Number of DBServers" class="input-xlarge" value="<%=dbs%>"></input>
|
||||||
<%if (config) {%>
|
|
||||||
value="<%=numberDBServers%>"
|
|
||||||
<%} else {%>
|
|
||||||
value="2"
|
|
||||||
<%}%>
|
|
||||||
></input>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
|
@ -16,72 +16,37 @@
|
||||||
"click #deletePlan" : "deletePlan"
|
"click #deletePlan" : "deletePlan"
|
||||||
},
|
},
|
||||||
|
|
||||||
initialize : function() {
|
|
||||||
this.dbservers = new window.ClusterServers([], {
|
|
||||||
interval: this.interval
|
|
||||||
});
|
|
||||||
this.dbservers.fetch({
|
|
||||||
async: false
|
|
||||||
});
|
|
||||||
this.dbservers.startUpdating();
|
|
||||||
},
|
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
$(this.el).html(this.template.render({}));
|
$(this.el).html(this.template.render({}));
|
||||||
},
|
},
|
||||||
|
|
||||||
relaunchCluster: function() {
|
relaunchCluster: function() {
|
||||||
console.log("relaunchCluster");
|
|
||||||
var result = false;
|
var result = false;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
cache: false,
|
cache: false,
|
||||||
type: "GET",
|
type: "GET",
|
||||||
async: false, // sequential calls!
|
url: "cluster/relaunch",
|
||||||
url: "/cluster/relaunch",
|
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
result = data;
|
window.App.navigate("showCluster", {trigger: true});
|
||||||
},
|
|
||||||
error: function(data) {
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return result;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
editPlan: function() {
|
editPlan: function() {
|
||||||
console.log("editPlan");
|
var config = window.App.clusterPlan.get("config");
|
||||||
//welches Scenario und entsprechende View rendern
|
if (_.size(config.dispatchers) === 1) {
|
||||||
//siehe showClusterView.js
|
|
||||||
|
|
||||||
|
|
||||||
var byAddress = this.listByAddress();
|
|
||||||
if (Object.keys(byAddress).length === 1) {
|
|
||||||
this.type = "testPlan";
|
|
||||||
} else {
|
|
||||||
this.type = "other";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.type === "testPlan") {
|
|
||||||
window.App.navigate("planTest", {trigger : true});
|
window.App.navigate("planTest", {trigger : true});
|
||||||
} else {
|
return;
|
||||||
|
}
|
||||||
|
//TODO
|
||||||
// window.App.navigate("planSymmetrical", {trigger : true});
|
// window.App.navigate("planSymmetrical", {trigger : true});
|
||||||
window.App.navigate("planAsymmetrical", {trigger : true});
|
window.App.navigate("planAsymmetrical", {trigger : true});
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
deletePlan: function() {
|
deletePlan: function() {
|
||||||
console.log("deletePlan");
|
window.App.clusterPlan.destroy();
|
||||||
//irgendwie löschen
|
window.App.planScenario();
|
||||||
//view planScenario
|
|
||||||
},
|
|
||||||
|
|
||||||
listByAddress: function() {
|
|
||||||
var byAddress = this.dbservers.byAddress();
|
|
||||||
byAddress = this.coordinators.byAddress(byAddress);
|
|
||||||
return byAddress;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
|
@ -13,11 +13,7 @@
|
||||||
events: {
|
events: {
|
||||||
"click #multiServerSymmetrical": "multiServerSymmetrical",
|
"click #multiServerSymmetrical": "multiServerSymmetrical",
|
||||||
"click #multiServerAsymmetrical": "multiServerAsymmetrical",
|
"click #multiServerAsymmetrical": "multiServerAsymmetrical",
|
||||||
"click #singleServer": "singleServer",
|
"click #singleServer": "singleServer"
|
||||||
"click #importRunInfo": "togglePlanImport",
|
|
||||||
"click #confirmRunInfoImport": "uploadPlan",
|
|
||||||
"click #importConnectInfo": "toggleConnectImport",
|
|
||||||
"click #confirmConnectImport": "uploadConnect"
|
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
|
@ -39,24 +35,6 @@
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
togglePlanImport: function() {
|
|
||||||
this.hideConnectImportModal();
|
|
||||||
$('#runinfoDropdownImport').slideToggle(200);
|
|
||||||
},
|
|
||||||
|
|
||||||
hidePlanImportModal: function() {
|
|
||||||
$('#runinfoDropdownImport').hide();
|
|
||||||
},
|
|
||||||
|
|
||||||
toggleConnectImport: function() {
|
|
||||||
this.hidePlanImportModal();
|
|
||||||
$('#connectDropdownImport').slideToggle(200);
|
|
||||||
},
|
|
||||||
|
|
||||||
hideConnectImportModal: function() {
|
|
||||||
$('#connectDropdownImport').hide();
|
|
||||||
},
|
|
||||||
|
|
||||||
readJSON: function(fileInput, callback) {
|
readJSON: function(fileInput, callback) {
|
||||||
var file = fileInput.files[0];
|
var file = fileInput.files[0];
|
||||||
var textType = 'application/json';
|
var textType = 'application/json';
|
||||||
|
@ -65,33 +43,7 @@
|
||||||
reader.onload = callback.bind(reader);
|
reader.onload = callback.bind(reader);
|
||||||
reader.readAsText(file);
|
reader.readAsText(file);
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
uploadConnect: function() {
|
|
||||||
var self = this;
|
|
||||||
this.readJSON(document.getElementById("connectInfoFile"), function() {
|
|
||||||
$.ajax("cluster/healthcheck", {
|
|
||||||
//$.ajax("cluster/relaunch", {
|
|
||||||
type: "POST",
|
|
||||||
contentType: "application/json",
|
|
||||||
data: this.result
|
|
||||||
}).done(function(d) {
|
|
||||||
alert(JSON.stringify(d));
|
|
||||||
self.hideConnectImportModal();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
uploadPlan: function() {
|
|
||||||
alert("Sorry not yet implemented");
|
|
||||||
return;
|
|
||||||
var info = {"config":{"dispatchers":{"d1":{"endpoint":"tcp://localhost:8529"}},"numberOfDBservers":2,"numberOfCoordinators":1},"plan":{"dispatchers":{"d1":{"endpoint":"tcp://localhost:8529","id":"d1","avoidPorts":{"4004":true,"4005":true,"4006":true,"7004":true,"7005":true,"7006":true,"8531":true,"8631":true,"8632":true},"arangodExtraArgs":[],"allowCoordinators":true,"allowDBservers":true}},"commands":[{"action":"startAgent","dispatcher":"d1","extPort":4004,"intPort":7004,"peers":[],"agencyPrefix":"meier","dataPath":"","logPath":"","agentPath":"","onlyLocalhost":true},{"action":"startAgent","dispatcher":"d1","extPort":4005,"intPort":7005,"peers":["tcp://localhost:7004"],"agencyPrefix":"meier","dataPath":"","logPath":"","agentPath":"","onlyLocalhost":true},{"action":"startAgent","dispatcher":"d1","extPort":4006,"intPort":7006,"peers":["tcp://localhost:7004","tcp://localhost:7005"],"agencyPrefix":"meier","dataPath":"","logPath":"","agentPath":"","onlyLocalhost":true},{"action":"sendConfiguration","agency":{"agencyPrefix":"meier","endpoints":["tcp://localhost:4004","tcp://localhost:4005","tcp://localhost:4006"]},"data":{"meier":{"Target":{"Lock":"\"UNLOCKED\"","Version":"\"1\"","DBServers":{"Pavel":"\"none\"","Perry":"\"none\""},"MapLocalToEndpoint":{},"MapIDToEndpoint":{"Pavel":"\"tcp://localhost:8631\"","Perry":"\"tcp://localhost:8632\"","Claus":"\"tcp://localhost:8531\""},"Coordinators":{"Claus":"\"none\""},"Databases":{"_system":"{\"name\":\"_system\"}"},"Collections":{"_system":{}}},"Plan":{"Lock":"\"UNLOCKED\"","Version":"\"1\"","DBServers":{"Pavel":"\"none\"","Perry":"\"none\""},"MapLocalToEndpoint":{},"Coordinators":{"Claus":"\"none\""},"Databases":{"_system":"{\"name\":\"_system\"}"},"Collections":{"_system":{}}},"Current":{"Lock":"\"UNLOCKED\"","Version":"\"1\"","DBservers":{},"Coordinators":{},"Databases":{"_system":{}},"Collections":{"_system":{}},"ServersRegistered":{"Version":"\"1\""},"ShardsCopied":{}},"Sync":{"ServerStates":{},"Problems":{},"LatestID":"\"0\"","Commands":{},"HeartbeatIntervalMs":"1000"},"Launchers":{"d1":"{\"DBservers\":[\"Pavel\",\"Perry\"],\"Coordinators\":[\"Claus\"]}"}}}},{"action":"startServers","dispatcher":"d1","DBservers":["Pavel","Perry"],"Coordinators":["Claus"],"name":"d1","dataPath":"","logPath":"","arangodPath":"","onlyLocalhost":true,"agency":{"agencyPrefix":"meier","endpoints":["tcp://localhost:4004","tcp://localhost:4005","tcp://localhost:4006"]}},{"action":"createSystemColls","url":"http://localhost:8531"},{"action":"initializeFoxx","url":"http://localhost:8531"}]},"runInfo":{"error":false,"errorMessage":"none","runInfo":[{"error":false,"isStartAgent":true,"pid":{"pid":36758},"endpoint":"tcp://localhost:4004"},{"error":false,"isStartAgent":true,"pid":{"pid":36759},"endpoint":"tcp://localhost:4005"},{"error":false,"isStartAgent":true,"pid":{"pid":36760},"endpoint":"tcp://localhost:4006"},{"error":false,"isSendConfiguration":true},{"error":false,"isStartServers":true,"pids":[{"pid":36764},{"pid":36765},{"pid":36766}],"endpoints":["tcp://localhost:8631","tcp://localhost:8632","tcp://localhost:8531"],"roles":["DBserver","DBserver","Coordinator"]},{"code":200,"message":"OK","headers":{"connection":"Keep-Alive","content-length":"26","content-type":"application/json; charset=utf-8","http/1.1":"200 OK","server":"ArangoDB"},"body":"{\"error\":false,\"code\":200}"},{"error":false}]}};
|
|
||||||
$.ajax("cluster/shutdown", {
|
|
||||||
type: "POST",
|
|
||||||
contentType: "application/json",
|
|
||||||
data: JSON.stringify(info)
|
|
||||||
});
|
|
||||||
this.hidePlanImportModal();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}());
|
}());
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
var isDBServer;
|
var isDBServer;
|
||||||
var isCoordinator;
|
var isCoordinator;
|
||||||
var self = this;
|
var self = this;
|
||||||
var data = {dispatcher : []};
|
var data = {dispatchers: []};
|
||||||
var foundCoordinator = false;
|
var foundCoordinator = false;
|
||||||
var foundDBServer = false;
|
var foundDBServer = false;
|
||||||
$(".dispatcher").each(function(i, dispatcher) {
|
$(".dispatcher").each(function(i, dispatcher) {
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
foundCoordinator = foundCoordinator || hostObject.isCoordinator;
|
foundCoordinator = foundCoordinator || hostObject.isCoordinator;
|
||||||
foundDBServer = foundDBServer || hostObject.isDBServer;
|
foundDBServer = foundDBServer || hostObject.isDBServer;
|
||||||
|
|
||||||
data.dispatcher.push(hostObject);
|
data.dispatchers.push(hostObject);
|
||||||
})
|
})
|
||||||
if (!self.isSymmetric) {
|
if (!self.isSymmetric) {
|
||||||
if (!foundDBServer) {
|
if (!foundDBServer) {
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ( data.dispatcher.length === 0) {
|
if ( data.dispatchers.length === 0) {
|
||||||
alert("Please provide at least one Host");
|
alert("Please provide at least one Host");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -56,12 +56,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
data.type = this.isSymmetric ? "symmetricalSetup" : "asymmetricalSetup";
|
data.type = this.isSymmetric ? "symmetricalSetup" : "asymmetricalSetup";
|
||||||
$.ajax("cluster/plan", {
|
this.model.save(
|
||||||
type: "POST",
|
data,
|
||||||
data: JSON.stringify(data)
|
{
|
||||||
}).done(function(info) {
|
success : function(info) {
|
||||||
window.App.showDownload(info);
|
window.App.navigate("showCluster", {trigger: true});
|
||||||
});
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
addEntry: function() {
|
addEntry: function() {
|
||||||
|
|
|
@ -42,17 +42,32 @@
|
||||||
numberDBServers: parseInt(d, 10),
|
numberDBServers: parseInt(d, 10),
|
||||||
numberCoordinators: parseInt(c, 10)
|
numberCoordinators: parseInt(c, 10)
|
||||||
},
|
},
|
||||||
{success : function(info) {
|
{
|
||||||
console.log("planTestView.js");
|
success : function(info) {
|
||||||
window.App.navigate("showCluster", {trigger: true});
|
window.App.navigate("showCluster", {trigger: true});
|
||||||
}}
|
}
|
||||||
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
$(this.el).html(this.template.render({
|
var param = {};
|
||||||
config : this.model.get("config")
|
var config = this.model.get("config");
|
||||||
}));
|
if (config) {
|
||||||
|
param.dbs = config.numberOfDBservers;
|
||||||
|
param.coords = config.numberOfCoordinators;
|
||||||
|
var host = config.dispatchers.d1.endpoint;
|
||||||
|
host = host.split("://")[1];
|
||||||
|
host = host.split(":");
|
||||||
|
param.hostname = host[0];
|
||||||
|
param.port = host[1];
|
||||||
|
} else {
|
||||||
|
param.dbs = 2;
|
||||||
|
param.coords = 1;
|
||||||
|
param.hostname = window.location.hostname;
|
||||||
|
param.port = window.location.port;
|
||||||
|
}
|
||||||
|
$(this.el).html(this.template.render(param));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue