Manage Nodes in a Cluster
Add a Node
See Adding a Node for information on adding nodes.
Show Information about a Node in a Cluster
You can fetch/re-post the object representing the node in the cluster
using GET
/PUT
requests. $NODE_ID
is the integer ID of the new node.
Description | Shows a node in the cluster | ||
Method | GET /api/v1/clusterconfig/members/ | ||
Response Data | node | ||
Authentication Required | yes | ||
Path Arguments | Description | Data type | Required? |
id | ID of the bucket storage configuration | string | required |
Return Codes | |||
200 | Request complete | ||
400 | Bad authentication | ||
500 | Request failed |
To redirect the output to a JSON file, run the script like this:
$ script>$YOUR_FILE_NAME.json
You can then use this as the payload in further requests when updating the information.
GET /api/v1/clusterconfig/members/$NODE_ID
curl -v -X GET $YOUR_LOGSCALE_URL/api/v1/clusterconfig/members/$NODE_ID \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"
curl -v -X GET $YOUR_LOGSCALE_URL/api/v1/clusterconfig/members/$NODE_ID \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"
curl -v -X GET $YOUR_LOGSCALE_URL/api/v1/clusterconfig/members/$NODE_ID ^
-H "Authorization: Bearer $TOKEN" ^
-H "Content-Type: application/json"
curl.exe -X GET
-H "Authorization: Bearer $TOKEN"
-H "Content-Type: application/json"
"$YOUR_LOGSCALE_URL/api/v1/clusterconfig/members/$NODE_ID"
#!/usr/bin/perl
use HTTP::Request;
use LWP;
my $INGEST_TOKEN = "TOKEN";
my $uri = '$YOUR_LOGSCALE_URL/api/v1/clusterconfig/members/$NODE_ID';
my $req = HTTP::Request->new("GET", $uri );
$req->header("Authorization" => "Bearer $TOKEN");
$req->header("Content-Type" => "application/json");
my $lwp = LWP::UserAgent->new;
my $result = $lwp->request( $req );
print $result->{"_content"},"\n";
#! /usr/local/bin/python3
import requests
url = '$YOUR_LOGSCALE_URL/api/v1/clusterconfig/members/$NODE_ID'
resp = requests.get(url,
headers = {
"Authorization" : "Bearer $TOKEN",
"Content-Type" : "application/json"
}
)
print(resp.text)
const https = require('https');
let request = https.get('$YOUR_LOGSCALE_URL/api/v1/clusterconfig/members/$NODE_ID', (res) => {
if (res.statusCode !== 200) {
console.error(`Error from server. Code: ${res.statusCode}`);
res.resume();
return;
}
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('close', () => {
console.log('Response:');
console.log(JSON.parse(data));
});
});
return(undef,undef);
}
[
{
"vhost": 1,
"uuid": "7q2LwHv6q3C5jmdGj3EYL1n56olAYcQy",
"internalHostUri": "$YOUR_LOGSCALE_URL",
"displayName": "host-1"
}
]
The returned JSON has the following structure:
Table: Response Structure
Field | Type | Description |
---|---|---|
displayName | string | User configurable name for this host |
internalHostUri | uri | Internal URI for this node |
uuid | string | Universally unique ID for this node; not user configurable |
vhost | integer | Node ID; not user configurable |
Modify information about a node in a cluster
Description | Update the configuration of a node in the cluster. | ||
Method | PUT /api/v1/clusterconfig/members/ | ||
Request Data | node | ||
Response Data | node | ||
Authentication Required | yes | ||
Path Arguments | Description | Data type | Required? |
id | ID of the bucket storage configuration | string | required |
Return Codes | |||
200 | Request complete | ||
400 | Bad authentication | ||
500 | Request failed |
PUT /api/v1/clusterconfig/members/$NODE_ID
curl -v -X PUT $YOUR_LOGSCALE_URL/api/v1/clusterconfig/members/$NODE_ID \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"
curl -v -X PUT $YOUR_LOGSCALE_URL/api/v1/clusterconfig/members/$NODE_ID \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"
curl -v -X PUT $YOUR_LOGSCALE_URL/api/v1/clusterconfig/members/$NODE_ID ^
-H "Authorization: Bearer $TOKEN" ^
-H "Content-Type: application/json"
curl.exe -X PUT
-H "Authorization: Bearer $TOKEN"
-H "Content-Type: application/json"
"$YOUR_LOGSCALE_URL/api/v1/clusterconfig/members/$NODE_ID"
#!/usr/bin/perl
use HTTP::Request;
use LWP;
my $INGEST_TOKEN = "TOKEN";
my $uri = '$YOUR_LOGSCALE_URL/api/v1/clusterconfig/members/$NODE_ID';
my $req = HTTP::Request->new("PUT", $uri );
$req->header("Authorization" => "Bearer $TOKEN");
$req->header("Content-Type" => "application/json");
my $lwp = LWP::UserAgent->new;
my $result = $lwp->request( $req );
print $result->{"_content"},"\n";
#! /usr/local/bin/python3
import requests
url = '$YOUR_LOGSCALE_URL/api/v1/clusterconfig/members/$NODE_ID'
resp = requests.put(url,
headers = {
"Authorization" : "Bearer $TOKEN",
"Content-Type" : "application/json"
}
)
print(resp.text)
const https = require('https');
let request = https.put('$YOUR_LOGSCALE_URL/api/v1/clusterconfig/members/$NODE_ID', (res) => {
if (res.statusCode !== 200) {
console.error(`Error from server. Code: ${res.statusCode}`);
res.resume();
return;
}
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('close', () => {
console.log('Response:');
console.log(JSON.parse(data));
});
});
return(undef,undef);
}
[
{
"vhost": 1,
"uuid": "7q2LwHv6q3C5jmdGj3EYL1n56olAYcQy",
"internalHostUri": "$YOUR_LOGSCALE_URL",
"displayName": "host-1"
}
]
The returned JSON has the following structure:
Table: Response Structure
Field | Type | Description |
---|---|---|
displayName | string | User configurable name for this host |
internalHostUri | uri | Internal URI for this node |
uuid | string | Universally unique ID for this node; not user configurable |
vhost | integer | Node ID; not user configurable |
You can edit the fields
internalHostUri
and displayName
in
this structure and POST
the resulting changes
back to the server, preserving the vhost and uuid fields.
Delete a Node from a Cluster
See Removing a Node documentation on removing a node from a cluster.
Description | Delete the configuration of a node in the cluster. | ||
Method | DELETE /api/v1/clusterconfig/members/ | ||
Authentication Required | yes | ||
Path Arguments | Description | Data type | Required? |
id | ID of the bucket storage configuration | string | required |
Query Arguments | Description | Data type | Required? |
accept-data-loss | Force deletion of the node configuration | boolean | optional |
Supported Values | |||
false | Deletes only if no data or partitions are assigned | ||
true | Force deletion even if it has data and assigned partitions | ||
Return Codes | |||
200 | Request complete | ||
400 | Bad authentication | ||
500 | Request failed |
If the host does not have any segment files, and no assigned partitions, there is no data loss when deleting a node.
DELETE /api/v1/clusterconfig/members/$NODE_ID
curl -v -X DELETE $YOUR_LOGSCALE_URL/api/v1/clusterconfig/members/$NODE_ID \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"
curl -v -X DELETE $YOUR_LOGSCALE_URL/api/v1/clusterconfig/members/$NODE_ID \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"
curl -v -X DELETE $YOUR_LOGSCALE_URL/api/v1/clusterconfig/members/$NODE_ID ^
-H "Authorization: Bearer $TOKEN" ^
-H "Content-Type: application/json"
curl.exe -X DELETE
-H "Authorization: Bearer $TOKEN"
-H "Content-Type: application/json"
"$YOUR_LOGSCALE_URL/api/v1/clusterconfig/members/$NODE_ID"
#!/usr/bin/perl
use HTTP::Request;
use LWP;
my $INGEST_TOKEN = "TOKEN";
my $uri = '$YOUR_LOGSCALE_URL/api/v1/clusterconfig/members/$NODE_ID';
my $req = HTTP::Request->new("DELETE", $uri );
$req->header("Authorization" => "Bearer $TOKEN");
$req->header("Content-Type" => "application/json");
my $lwp = LWP::UserAgent->new;
my $result = $lwp->request( $req );
print $result->{"_content"},"\n";
#! /usr/local/bin/python3
import requests
url = '$YOUR_LOGSCALE_URL/api/v1/clusterconfig/members/$NODE_ID'
resp = requests.delete(url,
headers = {
"Authorization" : "Bearer $TOKEN",
"Content-Type" : "application/json"
}
)
print(resp.text)
const https = require('https');
let request = https.delete('$YOUR_LOGSCALE_URL/api/v1/clusterconfig/members/$NODE_ID', (res) => {
if (res.statusCode !== 200) {
console.error(`Error from server. Code: ${res.statusCode}`);
res.resume();
return;
}
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('close', () => {
console.log('Response:');
console.log(JSON.parse(data));
});
});
return(undef,undef);
}
It is possible to drop a host, even if it has data and assigned
partitions, by adding the query parameter
accept-data-loss
with the value
true
.
Warning
This procedure silently drops your data.