Updated on 2023-04-12 GMT+08:00

Commissioning Applications on Windows

  1. Apply for a Windows ECS to access the MRS cluster to operate Presto. To apply for ECS to access the MRS cluster, perform the following steps:

    1. On the Active Clusters page, click the name of an existing cluster.

      On the cluster details page, record the AZ, VPC, and Default Security Group of the Master node.

    2. On the ECS management console, create a ECS.

      The AZ, VPC, and security group of ECS must be the same as those of the cluster to be accessed.

      Select a Windows public image.

      For details about other configuration parameters, see Elastic Cloud Server > Quick Start > Purchasing and Logging In to a Windows ECS.

  2. To enable Kerberos authentication for a cluster, you need to configure the mappings between cluster IP addresses and host names on Windows. Log in to the cluster background, run the cat /etc/hosts command, and copy the mapping between IP addresses and host names in the hosts file to C:\Windows\System32\drivers\etc\hosts of the ECS. Skip this step for a cluster with Kerberos authentication disabled.
  3. To operate Presto clusters on Windows, the JDK version must be jdk1.8.0_60 or later. To enable Kerberos authentication for a cluster, you need to copy /opt/Bigdata/om-0.0.1/packaged-distributables/client_packet/ca.crt of the active node of the MRS cluster to the Windows ECS, open the CLI in the jdk/bin directory, run the following command, and modify the configuration of the presto.properties file in the conf directory in the sample code.

    For jdk1.8.0_242 or later, delete renew_lifetime = 0m from [libdefaults] in krb5.conf.

    Skip this step for a cluster with Kerberos authentication disabled.

    keytool -import -v -trustcacerts -alias presto_trust -file <ca.crt_path> -keystore <keystore_path>/truststore.jks –keypass <password>

    In the preceding command, <ca.crt_path> indicates the path of the copied ca.crt file, <keystore_path> indicates the path where the truststore.jks file is generated, and <password> indicates the truststore password. You can specify the password as needed.

    Table 1 Parameters in presto.properties

    Parameter

    Description

    user

    Username used for Kerberos authentication, that is, the username of the development user created in Preparing a Development User.

    KerberosPrincipal

    Name used for authentication, that is, the name of the development user created in Preparing a Development User.

    KerberosConfigPath

    Path where krb5.conf is stored

    Pay attention to escape character (\).

    KerberosKeytabPath

    Path where user.keytab is stored

    Pay attention to escape character (\).

    SSLTrustStorePath

    Path where truststore.jks is stored

    Pay attention to escape character (\).

    SSLTrustStorePassword

    Truststore password

  4. Modify and run the sample.

    1. In the development environment (for example, Eclipse), modify the example_ip, port number, and krbsEnabled configurations in the sample code.
    2. Right-click PrestoJDBCExample.java.
    3. Click Run as > Java Application to run the corresponding application project.

  5. View the execution result. The following information is displayed if the execution is successful:

    NY Metro : 2
    Mid Atlantic : 6
    Mid Atlantic : 6
    North Midwest : 1
    North Midwest : 3
    North Midwest : 7