Use zkCli.sh to connect to ZooKeeper on your E-MapReduce (EMR) cluster and run data operations from the command line.
Prerequisites
Before you begin, ensure that you have:
An EMR cluster with ZooKeeper selected as an optional service during cluster creation. For more information, see Create a cluster.
SSH access to the cluster. For more information, see Log on to a cluster.
Connect to ZooKeeper
Log on to the cluster in SSH mode.
Run the following command to connect to ZooKeeper:
zkCli.sh -server master-1-1:2181After you connect to ZooKeeper, run
helpto display all commands supported by ZooKeeper.
Related resources
For more information about ZooKeeper, see the ZooKeeper Getting Started Guide.
FAQ
Q: What do I do if Cloud Monitor reports connection exceptions or shows an unhealthy status when it collects ZooKeeper metrics?
A: Troubleshoot the issue as follows:
Verify the ZooKeeper listening ports: Log on to the ZooKeeper node and run the following command to check the actual listening ports, including the client port 2181, the cluster communication ports 2888 and 3888, and the JMX monitoring ports 9010 and 9999:
ss -lntp | egrep '2181|2888|3888|jmx|9010|9999'Check the security group rules: If business access to ZooKeeper works as expected but Cloud Monitor still reports errors, check whether the security group allows the Cloud Monitor probe IP addresses to access the preceding ZooKeeper listening ports.