更新时间:2023-09-14 GMT+08:00
分享

在Linux中调测程序

JDBC客户端运行及结果查看

  1. 执行mvn clean compile assembly:single生成jar包,在工程目录target目录下获取,比如:presto-examples-1.0-SNAPSHOT-jar-with-dependencies.jar。
  2. 在运行调测环境上创建一个目录作为运行目录,如或“/opt/presto_examples”(Linux环境),并在该目录下创建子目录“conf”。

    1导出的presto-examples-1.0-SNAPSHOT-jar-with-dependencies.jar拷贝到“/opt/presto_examples”下。

  3. 开启Kerberos认证集群需要将4获取的user.keytab和krb5.conf拷贝到的/opt/presto_examples/conf下,并修改样例代码中conf目录下的presto.preperties。未开启Kerberos认证集群无须执行此步骤。

    表1 presto.preperties参数说明

    参数

    说明

    user

    用于Kerberos认证的用户名,即准备开发用户中创建的开发用户的用户名。

    KerberosPrincipal

    用于认证的名字,即认证准备开发用户中创建的开发用户的用户名。

    KerberosConfigPath

    krb5.conf的路径。

    KerberosKeytabPath

    user.keytab的路径。

    presto.preperties样例

    user = prestouser
    SSL = true
    KerberosRemoteServiceName = HTTP
    KerberosPrincipal = prestouser
    KerberosConfigPath = /opt/presto_examples/conf/krb5.conf
    KerberosKeytabPath = /opt/presto_examples/conf/user.keytab

  4. 在Linux环境下执行运行样例程序。

    chmod +x /opt/presto_examples -R 
    cd /opt/presto_examples
    java -jar presto-examples-1.0-SNAPSHOT-jar-with-dependencies.jar

  5. 在命令行终端查看样例代码所查询出的结果。

    Linux环境运行成功结果会有如下信息:
    NY Metro : 2
    Mid Atlantic : 6
    Mid Atlantic : 6
    North Midwest : 1
    North Midwest : 3
    North Midwest : 7

分享:

    相关文档

    相关产品