Cluster/Server Commands (gx cluster)

Cluster/Server management-related commands.

Get deployment information like:

  • Information about the server

  • CPU information and statistics

  • Disk information

  • And much more

Commands

1. info

Prints a summary of the cluster/server.

$> gx cluster info
{
  "clusterId": "0",
  "leaderNode": "0",
  "nodes": {
    "node": [{
      "nodeConfig": {
        "nodeIp": "10.138.0.42",
        "adminIp": "10.138.0.42",
        "nodeName": "gx0",
        "numCtl": 4,
        "rpcPort": 5055,
        "metaPort": 55502,
        "ctrServerPort": 5155,
        "mxmgrPort": 5054,
        "adminPort": 55503
      },
      "live": true
    }]
  }
}

2. stats storage

Prints storage stats for the cluster/server.

$> gx cluster stats storage
      Node    ID         DAT      Topic
     gxs-0     0      0.000%      0.000%
     gxs-1     1      0.000%      0.000%
     gxs-2     2      0.000%      0.000%

3. backup

Backup cluster state to cloud storage or get the state of an ongoing backup.

Options

  • --backup-id - Backup ID for a previous backup. This can be used to get the status of an existing backup request.

  • --destination - Destination of the backup in the cloud.

  • --passphrase - Passphrase to encrypt data in backup.

  • --gcp-sa-file - Path to the gcp service account json.

    • This option needs to be provided when backing up to gcp.

    • This was added in 2222.

  • --refresh-time - Time, in seconds, to refresh the backup status. Default: 5s.

Examples:

AWS

gx cluster backup --backup-location "s3://grainite.backup.001/backup/cluster_5000/?AWS_ACCESS_KEY_ID=ABCDEFGHIJKL_SECRET_ACCESS_KEY=4MNOPQRSTUVWXYZ" --passphrase=test -H "aaabbbcccdddeeeffggghhhiii.elb.us-east-1.amazonaws.com" 
gx cluster backup --backup-location "s3://grainite.backup.001/backup/cluster_5000/?AWS_ACCESS_KEY_ID=ABCDEFGHIJKL_SECRET_ACCESS_KEY=4MNOPQRSTUVWXYZ" --passphrase=test -H 192.168.10.5 

GCP

gx cluster backup --backup-location "gs://grainite.backup.001/backup/cluster_5000/" --gcp-sa-file ~/sa_auth.json --passphrase=test -H "aaabbbcccdddeeeffggghhhiii.elb.us-east-1.amazonaws.com" 
gx cluster backup --backup-location "gs://grainite.backup.001/backup/cluster_5000/" --gcp-sa-file ~/sa_auth.json --passphrase=test -H 192.168.10.5 

Azure

gx cluster backup --backup-location az://container/location?DefaultEndpointsProtocol=https;AccountName=ABCDEF;AccountKey=123456;EndpointSuffix=core.windows.net --passphrase=abc123 -H "aaabbbcccdddeeeffggghhhiii.elb.us-east-1.amazonaws.com" 
gx cluster backup --backup-location az://container/location?DefaultEndpointsProtocol=https;AccountName=ABCDEF;AccountKey=123456;EndpointSuffix=core.windows.net --passphrase=abc123 -H 192.168.10.5 

4. restore

Restore cluster state from a backup in a cloud storage bucket.

Options

  • --backup-location - Source/Backup location (AWS URI) of the backup in AWS S3.

  • --passphrase - Passphrase used to encrypt data at backup.

  • --gcp-sa-file - Path to the gcp service account json.

    • This option needs to be provided when restoring from gcp.

    • This was added in 2222.

Examples:

AWS

gx cluster restore --backup-location "s3://grainite.backup.001/backup/cluster_5000/?AWS_ACCESS_KEY_ID=ABCDEFGHIJKL_SECRET_ACCESS_KEY=4MNOPQRSTUVWXYZ" --passphrase=test -H "aaabbbcccdddeeeffggghhhiii.elb.us-east-1.amazonaws.com" 
gx cluster restore --backup-location "s3://grainite.backup.001/backup/cluster_5000/?AWS_ACCESS_KEY_ID=ABCDEFGHIJKL_SECRET_ACCESS_KEY=4MNOPQRSTUVWXYZ" --passphrase=test -H 192.168.10.5 

GCP

gx cluster restore --backup-location "gs://grainite.backup.001/backup/cluster_5000/" --gcp-sa-file ~/sa_auth.json --passphrase=test -H "aaabbbcccdddeeeffggghhhiii.elb.us-east-1.amazonaws.com" 
gx cluster restore --backup-location "gs://grainite.backup.001/backup/cluster_5000/" --gcp-sa-file ~/sa_auth.json --passphrase=test -H 192.168.10.5 

Azure

gx cluster restore --backup-location az://container/location?DefaultEndpointsProtocol=https;AccountName=ABCDEF;AccountKey=123456;EndpointSuffix=core.windows.net --passphrase=abc123 -H "aaabbbcccdddeeeffggghhhiii.elb.us-east-1.amazonaws.com" 
gx cluster restore --backup-location az://container/location?DefaultEndpointsProtocol=https;AccountName=ABCDEF;AccountKey=123456;EndpointSuffix=core.windows.net --passphrase=abc123 -H 192.168.10.5 

5. version

Get the cluster version.

Example:

$> gx cluster version
2307

Last updated