Fast Parallel Async HTTP client as a Service to monitor and manage 10,000 web servers. (Java+Akka)
Overview | New Features | Terminoloy | New APIs | Deployment
HTTP/REST/SOAP client as a service.
All APIs can use both GET and POST. All old version APIs of REST Commander also work for distributed version.
This API is used to process a task with predefined nodegroup and return a job ID. Use this job ID, user can track the progress of the task.
Request:
{
"nodeGroupType": "node_list",
"agentCommandType": "GET_VI",
"localMode": false,
"failOver": true,
"maxConcNum": 500
}
6c4b8302-4370-46c1-a4ab-008c1e1ddddd
{
"jobId": "6c4b8302-4370-46c1-a4ab-008c1e1ddddd"
}
{
"timeStamp": "2014-09-15 02:32:43",
"startTime": 1410748363828,
"finishedNotAggregatedTime": 1410748430246,
"endTime": 1410748434311,
"aggregationTime": 4.065,
"totJobNum": 40000,
"workerRequestCount": {
"akka.tcp://ClusterSystem@slave1*": 10000,
"akka.tcp://ClusterSystem@slave2*": 10000,
"akka.tcp://ClusterSystem@slave3*": 10000,
"akka.tcp://ClusterSystem@slave4*": 10000
},
"workerResponseCount": {
"akka.tcp://ClusterSystem@slave1*": 10000,
"akka.tcp://ClusterSystem@slave2*": 10000,
"akka.tcp://ClusterSystem@slave3*": 10000,
"akka.tcp://ClusterSystem@slave4*": 10000
},
"capacityUsage": {
"akka.tcp://ClusterSystem@slave1:2555": 1,
"akka.tcp://ClusterSystem@slave2:2551": 1,
"akka.tcp://ClusterSystem@slave3:2553": 1,
"akka.tcp://ClusterSystem@slave4:2554": 1
},
"state": "gathered",
"collectedNum": 40000,
"maxConcNum": 2000,
"jobId": "6c4b8302-4370-46c1-a4ab-008c1e1ddddd",
"nodeGroupType": "node_List",
"agentCommandType": "GET_VI"
}
Get the entire job queue. The state of task in the queue can be waiting, processing, finishedNotGathered or gathered.
Response:
[
{
"timeStamp": "2014-09-15 02:32:43",
"startTime": 1410748363828,
"finishedNotAggregatedTime": 1410748430246,
"endTime": 1410748434311,
"aggregationTime": 4.065,
"totJobNum": 40000,
"workerRequestCount": {
"akka.tcp://ClusterSystem@slave1*": 10000,
"akka.tcp://ClusterSystem@slave2*": 10000,
"akka.tcp://ClusterSystem@slave3*": 10000,
"akka.tcp://ClusterSystem@slave4*": 10000
},
"workerResponseCount": {
"akka.tcp://ClusterSystem@slave1*": 10000,
"akka.tcp://ClusterSystem@slave2*": 10000,
"akka.tcp://ClusterSystem@slave3*": 10000,
"akka.tcp://ClusterSystem@slave4*": 10000
},
"capacityUsage": {
"akka.tcp://ClusterSystem@slave1:2555": 1,
"akka.tcp://ClusterSystem@slave2:2551": 1,
"akka.tcp://ClusterSystem@slave3:2553": 1,
"akka.tcp://ClusterSystem@slave4:2554": 1
},
"state": "gathered",
"collectedNum": 40000,
"maxConcNum": 2000,
"jobId": "6c4b8302-4370-46c1-a4ab-008c1e1ddddd",
"nodeGroupType": "NODE_LIST",
"agentCommandType": "GET_VI"
},
{
"timeStamp": "2014-09-15 02:32:43",
"startTime": 1410748363828,
"finishedNotAggregatedTime": 1410748430246,
"endTime": 1410748434311,
"aggregationTime": 4.065,
"totJobNum": 40000,
"workerRequestCount": {
"akka.tcp://ClusterSystem@slave1*": 10000,
"akka.tcp://ClusterSystem@slave2*": 10000,
"akka.tcp://ClusterSystem@slave3*": 10000,
"akka.tcp://ClusterSystem@slave4*": 10000
},
"workerResponseCount": {
"akka.tcp://ClusterSystem@slave1*": 10000,
"akka.tcp://ClusterSystem@slave2*": 10000,
"akka.tcp://ClusterSystem@slave3*": 10000,
"akka.tcp://ClusterSystem@slave4*": 10000
},
"capacityUsage": {
"akka.tcp://ClusterSystem@slave1:2555": 1,
"akka.tcp://ClusterSystem@slave2:2551": 1,
"akka.tcp://ClusterSystem@slave3:2553": 1,
"akka.tcp://ClusterSystem@slave4:2554": 1
},
"state": "gathered",
"collectedNum": 40000,
"maxConcNum": 2000,
"jobId": "59d23705-e420-4f74-8972-ea55955be752",
"nodeGroupType": "NODE_LIST",
"agentCommandType": "GET_VI"
}
]
Search response according to FQDN and job ID.
Request:
{
"jobId": "59d23705-e420-4f74-8972-ea55955be752",
"fqdn": "127.0.0.1",
}
{
"clusterId": "cluster-uuid"
}
200
{
"port": 2551,
"masterUrl": "127.0.0.1:2551",
}
200
{
"url": "127.0.0.1",
"port": 2551,
}
"127.0.0.1:2551 has been enabled."
{
"url": "127.0.0.1",
"port": 2551,
}
"127.0.0.1:2551 has been disabled."
{
"masterUrl": [
"superman2:2552"
],
"enable": [
"true",
"true",
"true",
"true"
],
"state": [
"true",
"true",
"true",
"true"
],
"url": [
"superman1:2551",
"superman5:2555",
"superman4:2554",
"superman3:2553"
]
}
200
To use distributed REST Commander we need to add a config file at “/conf/remoteactorconfig.conf”.
For example:
akka {
version = "2.3.3"
event-handlers = ["akka.event.Logging$DefaultLogger"]
event-handler-startup-timeout = 300s
stdout-loglevel = "DEBUG"
actor {
provider = "akka.cluster.ClusterActorRefProvider"
serializers {
java = "akka.serialization.JavaSerializer"
proto = "akka.remote.serialization.ProtobufSerializer"
}
serialization-bindings {
"java.lang.String" = java
"java.lang.Boolean" = java
"models.asynchttp.response.GenericAgentResponse" = java
}
}
remote {
log-remote-lifecycle-events = off
netty.tcp {
hostname = "127.0.0.1"
}
}
cluster {
seed-nodes = [
"akka.tcp://[email protected]:2551",
"akka.tcp://[email protected]:2552",
"akka.tcp://[email protected]:2553"
]
auto-down-unreachable-after = 60s
}
supermanHTTPPort {
akkaAddress = [
"127.0.0.1:2551",
"127.0.0.1:2552",
"127.0.0.1:2553"
]
httpPort = [
"9000",
"9001",
"9002"
]
}
}
Things need to be modified: