In an E-MapReduce (EMR) cluster, you can run Kudu-related commands to perform operations. This topic describes the common commands of Kudu.
Prerequisites
An EMR cluster is created, and Kudu is selected from the optional services when you create the cluster. For more information, see Create a cluster.
You have logged on to the cluster. For more information, see Log on to a cluster.
Query master nodes
Syntax
kudu master list <Internal IP addresses of master nodes>
NoteIf your cluster contains multiple master nodes, separate the internal IP addresses of the master nodes with commas (,). Example:
192.168.**.**,192.168.**.**,192.168.**.**
.Example: Run the following command to query master nodes:
kudu master list 192.168.**.**,192.168.**.**,192.168.**.**
Information similar to the following output is returned:
uuid | rpc-addresses | role ----------------------------------+----------------------------------+---------- 3ebef6e84e0d45b2b6b5d24a2911**** | master-1-1.cluster-23****:7051 | LEADER a4e0160acd804e8d83b4448183f6**** | master-1-2.cluster-23****:7051 | FOLLOWER 0d9fdf59efce48e58f18cf212c2c**** | master-1-3.cluster-23****:7051 | FOLLOWER
Query tablet servers
Syntax
kudu tserver list <Internal IP addresses of master nodes>
Example: Run the following command to query tablet servers:
kudu tserver list 192.168.**.**,192.168.**.**,192.168.**.**
Information similar to the following output is returned:
uuid | rpc-addresses ----------------------------------+--------------------------------------------------------------- f54035d36a974241b125888f6dd3**** | core-1-1.c-4ac28de1af8c****.cn-hangzhou.emr.aliyuncs.com:7050 5f448cb2ac1f47a0ab97aab066ad**** | core-1-2.c-4ac28de1af8c****.cn-hangzhou.emr.aliyuncs.com:7050
Check the health of a cluster
Syntax
kudu cluster ksck <Internal IP addresses of master nodes>
Example: Run the following command to check the health of your cluster:
kudu cluster ksck 192.168.**.**,192.168.**.**,192.168.**.**
Information similar to the following output is returned:
Master Summary UUID | Address | Status ----------------------------------+---------------+--------- 0d9fdf59efce48e58f18cf212c2c**** | 192.168.**.** | HEALTHY 3ebef6e84e0d45b2b6b5d24a2911**** | 192.168.**.** | HEALTHY a4e0160acd804e8d83b4448183f6**** | 192.168.**.** | HEALTHY Flag | Value | Tags | Master -----------------------------------+--------+--------+------------------------- raft_get_node_instance_timeout_ms | 300000 | hidden | all 3 server(s) checked Tablet Server Summary UUID | Address | Status | Location ----------------------------------+----------------------------------+---------+---------- 2a8257107d0048728707e783035e**** | core-1-1.cluster-234593:7050 | HEALTHY | <none> be173a301ea24997a4a7a0f78815**** | core-1-2.cluster-234593:7050 | HEALTHY | <none> Tablet Server Location Summary Location | Count ----------+--------- <none> | 2 Flag | Value | Tags | Tablet Server -----------------------------------+--------+--------+------------------------- raft_get_node_instance_timeout_ms | 300000 | hidden | all 2 server(s) checked Version Summary Version | Servers ---------+------------------------- 1.10.0 | all 5 server(s) checked The cluster doesn't have any matching tablets The cluster doesn't have any matching tables Tablet Replica Count Summary Statistic | Replica Count ----------------+--------------- Minimum | 0 First Quartile | 0 Median | 0 Third Quartile | 0 Maximum | 0 ================== Warnings: ================== Some masters have unsafe, experimental, or hidden flags set Some tablet servers have unsafe, experimental, or hidden flags set OK
Query all tables
Syntax
kudu table list <Internal IP addresses of master nodes>
Example: Run the following command to query all tables:
kudu table list 192.168.**.**,192.168.**.**,192.168.**.**
Information similar to the following output is returned:
impala::default.my_first_table
Describe a table
Syntax
kudu table describe <Internal IP addresses of master nodes> <your_tablename>
Note<your_tablename>
in the code specifies the name of a table. You can run the kudu table list command to obtain the name of the table whose content you want to describe. Example:impala::default.my_first_table
.Example: Run the following command to describe a table:
kudu table describe 192.168.**.**,192.168.**.**,192.168.**.** impala::default.my_first_table
Information similar to the following output is returned:
ABLE impala::default.my_first_table ( id INT64 NOT NULL, name STRING NULLABLE, PRIMARY KEY (id) ) HASH (id) PARTITIONS 16 REPLICAS 1
Check the metrics of a cluster
Check the metrics of master nodes
kudu-master --dump_metrics_json
Check the metrics of tablet servers
kudu-tserver --dump_metrics_json