Manager node is responsible to orchestrate Kertish-dos farm.
Default bind endpoint port is :9400
Manager node keep the index of files in Redis dss and cluster information in mongo db. Locking-center will use to keep index and cluster stability.
Should be started with parameters that are set as environment variables
BIND_ADDRESS
(optional) : Service binding address. Ex:127.0.0.1:9400
Default::9400
Head node will access the service using http://127.0.0.1:9400/client/manager
and
Data nodes will access the service using http://127.0.0.1:9400/client/node
MONGO_CONN
(mandatory) : Mongo DB endpoint. Ex:mongodb://admin:[email protected]:27017
Cluster and Data node setup and information will be kept in Mongo DB.
-
MONGO_DATABASE
(optional) : Mongo DB name. Default:kertish-dos
-
MONGO_TRANSACTION
(optional) : Settrue
if you have a Mongo DB Cluster setup -
REDIS_CONN
(mandatory) : Redis dss. Ex:127.0.0.1:6379
Will be used to index file information.
-
REDIS_PASSWORD
(optional) : Redis password for secure redis dss -
REDIS_CLUSTER_MODE
(optional) : Redis cluster mode activation Ex:true
-
LOCKING_CENTER
(mandatory) : Locking-Center Server. Ex:127.0.0.1:22119
Will be used to synchronize accesses between services
HEALTH_CHECK_INTERVAL
(optional) : Frequency of checking data-node(s) accessibility. default value is 10 seconds.
GET
is used to sync cluster/clusters, list cluster/clusters and nodes and find the cluster information for file.
X-Action
defines the behaviour of get request. Values:sync
orrepair
orhealth
ormove
orbalance
orclusters
orfind
422
: Required Request Headers are not valid or absent
Sync action is to trigger the sync operation on cluster/clusters.
X-Options
header is used to point the cluster or omit it to run the sync operation in all clusters.
404
: Not found500
: Operational failures202
: Accepted to finish in future
All failed responses comes with error json. Ex:
{
"code": 100,
"message": "clusters are not available for sync"
}
Repair action is to trigger the consistency and integrity repair operation on cluster/clusters.
X-Options
header is used to point the repair type. Omit for full repair,structure
for only metadata structure repair orintegrity
for only data-node and metadata integrity repair.
404
: Not found423
: Locked for another repair operation500
: Operational failures202
: Accepted to finish in future
All failed responses comes with error json. Ex:
{
"code": 105,
"message": "clusters are not available for repair"
}
Health action is to get the data-node accessibility report.
500
: Operational failures200
: Successful
All failed responses comes with error json. Ex:
{
"code": 140,
"message": "clusters are not available for repair"
}
Sample report output:
{
"[clusterId]": [
{
"nodeId": "2f194705b3b6292e84dc71dbb0185a9c",
"address": "172.20.1.40:9430",
"master": true,
"quality": 0
}
]
}
Possible quality values:
- -2 DNS Error, unable to resolve
- -1 Paralysed or Readonly Data-Node/Cluster
- 0 or higher Response Time in ms
Move action is to move one cluster content to other one. Target cluster should have enough space for move operation.
X-Options
header is used to point the source and target clusters for move operation.sourceClusterId,targetClusterId
404
: Not found422
: Invalid Headers for operation500
: Operational failures503
: Service Unavailable507
: Insufficient Space200
: Successful
All failed responses comes with error json. Ex:
{
"code": 130,
"message": "cluster is not available for cluster wide actions"
}
Balance action is to balance data weight between clusters.
X-Options
header is used to point specific clusters to balance between.clusterId,clusterId,...
404
: Not found422
: Invalid Headers for operation500
: Operational failures503
: Service Unavailable200
: Successful
All failed responses comes with error json. Ex:
{
"code": 135,
"message": "cluster is not available for cluster wide actions"
}
Clusters action is to get the information about the cluster/clusters and related data nodes.
X-Options
header is used to point the cluster or omit it to get al clusters information.
404
: Not found500
: Operational failures200
: Successful
All failed responses comes with error json. Ex:
{
"code": 110,
"message": "cluster is already exists"
}
Find action is to get the clusterId and data node of a file.
-
X-Options
header is used to point the fileId. FileId is a sha512 encoded hex string. Ex:e5c0adae0f05cf60f7e34b45bd44249f42627b1f3b1b453ae45e106adbfdfbdb
-
Successful response contains
X-Cluster-Id
andX-Address
for search result.
404
: Not found500
: Operational failures503
: Not available to complete the operation (Readonly, Offline or Paralysed cluster/node)200
: Successful
All failed responses comes with error json. Ex:
{
"code": 120,
"message": "cluster is already exists"
}
POST
is used to create cluster, register node, take snapshot, make reservation, create read and delete maps.
X-Action
defines the behaviour of post request. Values:register
orsnapshot
orreserve
orreadMap
orcreateMap
ordeleteMap
422
: Required Request Headers are not valid or absent
Register action will create cluster and/or register node.
X-Options
header contains the registration or addition details. Format isclusterId=[DataNodeBındingAddress]:[DataNodeBındingPort],[DataNodeBındingAddress]:[DataNodeBındingPort],...
if you omit the clusterId, request will be accepted as to create new cluster with the given data nodes.
to create new cluster:
Ex: 127.0.0.1:9430,127.0.0.1:9431
to add new data nodes to the existence cluster:
Ex: 8f0e2bc02811f346d6cbb542c92d118d=127.0.0.1:9430,127.0.0.1:9431
400
: Operational failure409
: Cluster is already created/Data Node is already registered422
: Required Request Headers are not valid or absent200
: Successful
All failed responses comes with error json. Ex:
{
"code": 200,
"message": "cluster is already exists"
}
Successful request response sample
{
"clusterId": "8f0e2bc02811f346d6cbb542c92d118d",
"size": 1073741824,
"used": 0,
"nodes": [
{
"nodeId": "7a758a149e4453b20a40b35f83f3a0e4",
"address": "127.0.0.1:9430",
"master": true,
"quality": 0
}
],
"reservations": []
}
Snapshot action will create a snapshot state for the cluster.
X-Options
header is used to send the cluster id to take the snapshot for.
400
: Operational failure200
: Successful
All failed responses comes with error json. Ex:
{
"code": 205,
"message": "cluster is already exists"
}
Reserve action is to reserve data space on data nodes to guaranteed that files can be stored.
X-Size
header uint64 value for the required space size.
400
: Operational failures422
: Required Request Headers are not valid or absent503
: Not available for reservation (Readonly, Offline or Paralysed cluster/node)507
: Insufficient space200
: Successful
All failed responses comes with error json. Ex:
{
"code": 210,
"message": "cluster is already exists"
}
Successful request response sample
{
"reservationId": "e813bfe9-50fd-4a13-992d-10995326210f",
"clusters": [
{
"clusterId": "8f0e2bc02811f346d6cbb542c92d118d",
"address": "127.0.0.1:9430",
"chunk": {
"sequence": 1,
"index": 0,
"size": 10247680
}
}
]
}
Creates the cluster access map for the specified files.
X-Options
header holds the file hex id list with,
separated. Ex:e5c0adae0f05cf60f7e34b45bd44249f42627b1f3b1b453ae45e106adbfdfbdb,45bd44249f42627b1f3b1b453ae45e106adbfdfbdba5c0adae0f05cf60f7e34b
400
: Operational failures422
: Required Request Headers are not valid or absent503
: Not available for reservation (Readonly, Offline or Paralysed cluster/node)200
: Successful
All failed responses comes with error json. Ex:
{
"code": 220,
"message": "cluster is already exists"
}
Successful request response sample
{
"e5c0adae0f05cf60f7e34b45bd44249f42627b1f3b1b453ae45e106adbfdfbdb": "127.0.0.1:9430",
"45bd44249f42627b1f3b1b453ae45e106adbfdfbdba5c0adae0f05cf60f7e34b": "127.0.0.1:9431"
}
DELETE
is used to delete cluster, unregister node, delete snapshot, discard or commit reservation.
X-Action
defines the behaviour of delete request. Values:unregister
orsnapshot
orcommit
ordiscard
422
: Required Request Headers are not valid or absent
Unregister action will delete cluster and/or unregister node.
X-Options
header contains the unregistering or deletion details. Format is[type],[clusterId/nodeId]
type values are c
for cluster and n
for node. You should push the related id for the operation
Ex: c,8f0e2bc02811f346d6cbb542c92d118d
404
: Cluster/Node not found422
: Required Request Headers are not valid or absent423
: (only node deletion) Last node cannot be deleted500
: Operational failure200
: Successful
All failed responses comes with error json. code can be 300
for cluster or 350
for node operation Ex:
{
"code": 300,
"message": "cluster is already exists"
}
Change state action will change the cluster current state between 3 states (Online, Readonly, Offline).
X-Options
header contains the action delegation for each or all clusters. Format is[clusterId]=[state],[clusterId]=[state],...
states are:
- 0: Online
- 1: Readonly
- -1: Offline
404
: Cluster/Node not found422
: Required Request Headers are not valid or absent500
: Operational failure200
: Successful
All failed responses comes with error json. code can be 300
Ex:
{
"code": 300,
"message": "clusters state change options are insufficient"
}
Snapshot action will delete the snapshot for the cluster pointed with snapshot index.
X-Options
header contains the clusterId and snapshot index with=
separator. Ex:clusterId=snapshotIndex
422
: Required Request Headers are not valid or absent500
: Operational failure200
: Successful
All failed responses comes with error json. Ex:
{
"code": 380,
"message": "cluster is already exists"
}
Commit action is to commit the reserved disk space for the further process.
X-Reservation-Id
header for registration id.X-Options
for committing details. It has a special formatclusterId=size,clusterId=size,...
clusterId can repeat and the size will grow base on clusterId matching. size must be uint64.
when reservation is committed once with the clusterId-size map, unused space will be added to the cluster total space.
422
: Required Request Headers are not valid or absent500
: Operational failures200
: Successful
All failed responses comes with error json. Ex:
{
"code": 360,
"message": "cluster is already exists"
}
Discard action is to discard the reserved disk space in all related clusters.
X-Reservation-Id
header for registration id.
when reservation is discarded once, unused space will be added to the cluster total space.
400
: Operational failures422
: Required Request Headers are not valid or absent200
: Successful
All failed responses comes with error json. Ex:
{
"code": 370,
"message": "cluster is already exists"
}