Comment on page
Clustering
Adds a route/routes to either the hub or leaf server cluster configuration.
Operation is restricted to super_user roles only
- operation (required) - must always be
cluster_set_routes
- server (required) - must always be
hub
orleaf
, in most cases you should usehub
here - routes (required) - must always be an objects array with a host and port:
- host - the host of the remote instance you are clustering to
- port - the clustering port of the remote instance you are clustering to, in most cases this is the value in
clustering.hubServer.cluster.network.port
on the remote instanceharperdb-config.yaml
{
"operation": "cluster_set_routes",
"server": "hub",
"routes": [
{
"host": "3.22.181.22",
"port": 12345
},
{
"host": "3.137.184.8",
"port": 12345
},
{
"host": "18.223.239.195",
"port": 12345
},
{
"host": "18.116.24.71",
"port": 12345
}
]
}
{
"message": "cluster routes successfully set",
"set": [
{
"host": "3.22.181.22",
"port": 12345
},
{
"host": "3.137.184.8",
"port": 12345
},
{
"host": "18.223.239.195",
"port": 12345
},
{
"host": "18.116.24.71",
"port": 12345
}
],
"skipped": []
}
Gets all the hub and leaf server routes from the config file.
Operation is restricted to super_user roles only
- operation (required) - must always be
cluster_get_routes
{
"operation": "cluster_get_routes"
}
{
"hub": [
{
"host": "3.22.181.22",
"port": 12345
},
{
"host": "3.137.184.8",
"port": 12345
},
{
"host": "18.223.239.195",
"port": 12345
},
{
"host": "18.116.24.71",
"port": 12345
}
],
"leaf": []
}
Removes route(s) from hub and/or leaf server routes array in config file. Returns a deletion success message and arrays of deleted and skipped records.
Operation is restricted to super_user roles only
- operation (required) - must always be
cluster_delete_routes
- routes required - Must be an array of route object(s)
{
"operation": "cluster_delete_routes",
"routes": [
{
"host": "18.116.24.71",
"port": 12345
}
]
}
{
"message": "cluster routes successfully deleted",
"deleted": [
{
"host": "18.116.24.71",
"port": 12345
}
],
"skipped": []
}
Registers an additional HarperDB instance with associated subscriptions. Learn more about HarperDB clustering here: https://harperdb.io/docs/clustering/.
Operation is restricted to super_user roles only
- operation (required) - must always be
add_node
- node_name (required) - the node name of the remote node
- subscriptions (required) - The relationship created between nodes. Must be an object array and include
schema
,table
,subscribe
andpublish
:- schema - the schema to replicate from
- table - the table to replicate from
- subscribe - a boolean which determines if transactions on the remote table should be replicated on the local table
- publish - a boolean which determines if transactions on the local table should be replicated on the remote table
- start_time (optional) - How far back to go to get transactions from node being added. Must be in UTC YYYY-MM-DDTHH:mm:ss.sssZ format
{
"operation": "add_node",
"node_name": "ec2-3-22-181-22",
"subscriptions": [
{
"schema": "dev",
"table": "dog",
"subscribe": false,
"publish": true,
"start_time": "2022-09-02T20:06:35.993Z"
}
]
}
{
"message": "Successfully added 'ec2-3-22-181-22' to manifest"
}
Modifies an existing HarperDB instance registration and associated subscriptions. Learn more about HarperDB clustering here: https://harperdb.io/docs/clustering/.
Operation is restricted to super_user roles only
- operation (required) - must always be
update_node
- node_name (required) - the node name of the remote node you are updating
- subscriptions (required) - The relationship created between nodes. Must be an object array and include
schema
,table
,subscribe
andpublish
:- schema - the schema to replicate from
- table - the table to replicate from
- subscribe - a boolean which determines if transactions on the remote table should be replicated on the local table
- publish - a boolean which determines if transactions on the local table should be replicated on the remote table
{
"operation": "update_node",
"node_name": "ec2-18-223-239-195",
"subscriptions": [
{
"schema": "dev",
"table": "dog",
"subscribe": true,
"publish": false
}
]
}
{
"message": "Successfully updated 'ec2-3-22-181-22'"
}
Returns an array of status objects from a cluster. A status object will contain the clustering node name, whether or not clustering is enabled, and a list of possible connections. Learn more about HarperDB clustering here: https://harperdb.io/docs/clustering/.
Operation is restricted to super_user roles only
- operation (required) - must always be
cluster_status
{
"operation": "cluster_status"
}
{
"node_name": "ec2-18-221-143-69",
"is_enabled": true,
"connections": [
{
"node_name": "ec2-3-22-181-22",
"status": "open",
"ports": {
"clustering": 12345,
"operations_api": 9925
},
"latency_ms": 13,
"uptime": "30d 1h 18m 8s",
"subscriptions": [
{
"schema": "dev",
"table": "dog",
"publish": true,
"subscribe": true
}
]
}
]
}
Returns an object array of enmeshed nodes. Each node object will contain the name of the node, the amount of time (in milliseconds) it took for it to respond, the names of the nodes it is enmeshed with and the routes set in its config file. Learn more about HarperDB clustering here: https://harperdb.io/docs/clustering/.
Operation is restricted to super_user roles only
- operation (required)- must always be
cluster_network
- timeout (optional) - the amount of time in milliseconds to wait for a response from the network. Must be a number
- connected_nodes (optional) - omit
connected_nodes
from the response. Must be a boolean. Defaults tofalse
- routes (optional) - omit
routes
from the response. Must be a boolean. Defaults tofalse
{
"operation": "cluster_network"
}
{
"nodes": [
{
"name": "local_node",
"response_time": 4,
"connected_nodes": ["ec2-3-142-255-78"],
"routes": [
{
"host": "3.142.255.78",
"port": 9932
}
]
},
{
"name": "ec2-3-142-255-78",
"response_time": 57,
"connected_nodes": ["ec2-3-12-153-124", "ec2-3-139-236-138", "local_node"],
"routes": []
}
]
}
Removes a HarperDB instance and associated subscriptions from the cluster. Learn more about HarperDB clustering here: https://harperdb.io/docs/clustering/.
Operation is restricted to super_user roles only
- operation (required) - must always be
remove_node
- name (required) - The name of the node you are de-registering
{
"operation": "remove_node",
"node_name": "ec2-3-22-181-22"
}
{
"message": "Successfully removed 'ec2-3-22-181-22' from manifest"
}
Bulk create/remove subscriptions for any number of remote nodes. Resets and replaces any existing clustering setup. Learn more about HarperDB clustering here: https://harperdb.io/docs/clustering/.
Operation is restricted to super_user roles only
- operation (required) - must always be
configure_cluster
- connections (required) - must be an object array with each object containing
node_name
andsubscriptions
for that node
{
"operation": "configure_cluster",
"connections": [
{
"node_name": "ec2-3-137-184-8",
"subscriptions": [
{
"schema": "dev",
"table": "dog",
"subscribe": true,
"publish": false
}
]
},
{
"node_name": "ec2-18-223-239-195",
"subscriptions": [
{
"schema": "dev",
"table": "dog",
"subscribe": true,
"publish": true
}
]
}
]
}
{
"message": "Cluster successfully configured."
}
Last modified 18d ago