mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'sharding' of https://github.com/triAGENS/ArangoDB into sharding
This commit is contained in:
commit
c5eb7376e8
|
@ -338,7 +338,6 @@ actions.defineHttp({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var input;
|
var input;
|
||||||
print(req.requestBody);
|
|
||||||
try {
|
try {
|
||||||
input = JSON.parse(req.requestBody);
|
input = JSON.parse(req.requestBody);
|
||||||
}
|
}
|
||||||
|
@ -347,7 +346,6 @@ actions.defineHttp({
|
||||||
"Posted body was not valid JSON.");
|
"Posted body was not valid JSON.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
print(input);
|
|
||||||
if (!input.hasOwnProperty("clusterPlan")) {
|
if (!input.hasOwnProperty("clusterPlan")) {
|
||||||
actions.resultError(req, res, actions.HTTP_BAD,
|
actions.resultError(req, res, actions.HTTP_BAD,
|
||||||
'Posted body needs a "clusterPlan" property.');
|
'Posted body needs a "clusterPlan" property.');
|
||||||
|
@ -394,10 +392,8 @@ actions.defineHttp({
|
||||||
}
|
}
|
||||||
Kickstarter = require("org/arangodb/cluster/kickstarter").Kickstarter;
|
Kickstarter = require("org/arangodb/cluster/kickstarter").Kickstarter;
|
||||||
try {
|
try {
|
||||||
print("hallo");
|
|
||||||
k = new Kickstarter(input.clusterPlan, input.myname);
|
k = new Kickstarter(input.clusterPlan, input.myname);
|
||||||
k.runInfo = input.runInfo;
|
k.runInfo = input.runInfo;
|
||||||
print(input.runInfo);
|
|
||||||
r = k.shutdown();
|
r = k.shutdown();
|
||||||
res.responseCode = actions.HTTP_OK;
|
res.responseCode = actions.HTTP_OK;
|
||||||
res.contentType = "application/json; charset=utf-8";
|
res.contentType = "application/json; charset=utf-8";
|
||||||
|
|
|
@ -96,11 +96,9 @@ function sendToAgency (agencyURL, path, obj) {
|
||||||
var count = 0;
|
var count = 0;
|
||||||
while (count++ <= 2) {
|
while (count++ <= 2) {
|
||||||
body = "value="+encodeURIComponent(obj);
|
body = "value="+encodeURIComponent(obj);
|
||||||
//print("sending:",agencyURL+path,"\nwith body",body);
|
|
||||||
res = download(agencyURL+path,body,
|
res = download(agencyURL+path,body,
|
||||||
{"method":"PUT", "followRedirects": true,
|
{"method":"PUT", "followRedirects": true,
|
||||||
"headers": { "Content-Type": "application/x-www-form-urlencoded"}});
|
"headers": { "Content-Type": "application/x-www-form-urlencoded"}});
|
||||||
//print("Code ", res.code);
|
|
||||||
if (res.code === 201) {
|
if (res.code === 201) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -178,6 +176,8 @@ launchActions.startAgent = function (dispatchers, cmd, isRelaunch) {
|
||||||
launchActions.sendConfiguration = function (dispatchers, cmd, isRelaunch) {
|
launchActions.sendConfiguration = function (dispatchers, cmd, isRelaunch) {
|
||||||
if (isRelaunch) {
|
if (isRelaunch) {
|
||||||
// nothing to do here
|
// nothing to do here
|
||||||
|
print("Waiting 10 seconds for agency to come alive...");
|
||||||
|
wait(10);
|
||||||
return {"error":false, "isSendConfiguration": true};
|
return {"error":false, "isSendConfiguration": true};
|
||||||
}
|
}
|
||||||
var url = "http://"+getAddrPort(cmd.agency.endpoints[0])+"/v2/keys";
|
var url = "http://"+getAddrPort(cmd.agency.endpoints[0])+"/v2/keys";
|
||||||
|
@ -203,7 +203,6 @@ launchActions.startServers = function (dispatchers, cmd, isRelaunch) {
|
||||||
|
|
||||||
print("Starting servers...");
|
print("Starting servers...");
|
||||||
var i;
|
var i;
|
||||||
print(info);
|
|
||||||
var servers = info.DBservers.concat(info.Coordinators);
|
var servers = info.DBservers.concat(info.Coordinators);
|
||||||
pids = [];
|
pids = [];
|
||||||
for (i = 0; i < servers.length; i++) {
|
for (i = 0; i < servers.length; i++) {
|
||||||
|
|
Loading…
Reference in New Issue