Parameter Configuration

  1. Before executing sample code, configure the correct ZooKeeper cluster address in the hbase-site.xml configuration file.

    The configuration items are as follows:

    <property>
    <name>hbase.zookeeper.quorum</name>
    <value>xxx-zk1.cloudtable.com,xxx-zk2.cloudtable.com,xxx-zk3.cloudtable.com</value>
    </property>

    value is the domain name of the ZooKeeper cluster. Log in to the CloudTable management console and choose Cluster Mode. In the cluster list, locate the required cluster and obtain its ZK link in the ZK Link column.

  2. Modify the parameters related to IAM authentication in the sample code project.

    • If IAM authentication is enabled for the CloudTable cluster:

      In the sample code project, IAM_AUTH_MODE in the com.huawei.cloudtable.hbase.examples.TestMain class must be set to true and the user, ak, and sk parameters need to be configured.

      The code is as follows:

      private static boolean IAM_AUTH_MODE = true;
      private static String user = "XXXXXX";
      private static String ak = "XXXXXX";
      private static String sk = "XXXXXX";
      • user: username If the cluster is created by a user's sub-user, user must be set to Sub-user.End user when the sub-user accesses the cluster, and set to the user name when the end user accesses the cluster.
      • ak and sk: Access Key ID (AK) and Secret Access Key (SK). Set them to the AK plaintext and SK plaintext, respectively. You can move your cursor over your account in the upper right corner of the management console and choose My Credential. Click Access Keys tab. On the Access Keys tab page, you can view the existing access keys or click Add Access Key to add an access key.

      The IAM authentication mode provides better security than the normal mode. Therefore, you are advised to enable IAM authentication for the CloudTable cluster and use IAM authentication in client or application code to connect to the cluster.

    • If IAM authentication is disabled for the CloudTable cluster:

      IAM_AUTH_MODE in the com.huawei.cloudtable.hbase.examples.TestMain class must be set to false.