Information about Greenplum® cluster hosts
You can get a list of hosts (masters and segments) in a Managed Service for Greenplum® cluster. To do this:
- Go to the folder page
and select Managed Service for Greenplum. - Click the cluster name and select the
Hosts tab.
In the list of hosts, the Role column shows the role of each host:
MASTER
: Primary master host to receive user connections.REPLICA
: Standby master host to replicate data of the primary master host.SEGMENT
: Segment host to store part of the cluster data.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To get a list of cluster master hosts, run the command:
yc managed-greenplum hosts list master \
--cluster-name=<cluster_name>
To get a list of cluster segment hosts, run the command:
yc managed-greenplum hosts list segment \
--cluster-name=<cluster_name>
You can request the cluster name with a list of clusters in the folder.
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
To get a list of cluster master hosts:
-
Use the Cluster.ListMasterHosts method and make a request, e.g., via cURL
:curl \ --request GET \ --header "Authorization: Bearer $IAM_TOKEN" \ --url 'https://mdb.api.cloud.yandex.net/managed-greenplum/v1/clusters/<cluster_ID>/master-hosts'
You can get the cluster ID with a list of clusters in the folder.
-
View the server response to make sure the request was successful.
-
-
To get a list of cluster segment hosts:
-
Use the Cluster.ListSegmentHosts method and make a request, e.g., via cURL
:curl \ --request GET \ --header "Authorization: Bearer $IAM_TOKEN" \ --url 'https://mdb.api.cloud.yandex.net/managed-greenplum/v1/clusters/<cluster_ID>/segment-hosts'
You can get the cluster ID with a list of clusters in the folder.
-
View the server response to make sure the request was successful.
-
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
Below, we assume the repository contents are stored in the
~/cloudapi/
directory. -
To get a list of cluster master hosts:
-
Use the ClusterService.ListMasterHosts call and make a request, e.g., via gRPCurl
:grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/greenplum/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d '{ "cluster_id": "<cluster_ID>" }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.greenplum.v1.ClusterService.ListMasterHosts
You can get the cluster ID with a list of clusters in the folder.
-
View the server response to make sure the request was successful.
-
-
To get a list of cluster segment hosts:
-
Use the ClusterService.ListSegmentHosts call and make a request, e.g., via gRPCurl
:grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/greenplum/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d '{ "cluster_id": "<cluster_ID>" }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.greenplum.v1.ClusterService.ListSegmentHosts
You can get the cluster ID with a list of clusters in the folder.
-
View the server response to make sure the request was successful.
-
Greenplum® and Greenplum Database® are registered trademarks or trademarks of VMware, Inc. in the United States and/or other countries.