forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Yang, Tong <yangtong2@huawei.com> Co-committed-by: Yang, Tong <yangtong2@huawei.com>
7.1 KiB
7.1 KiB
How Do I Access Presto in a Cluster with Kerberos Authentication Enabled?
- Log in to the Master node in the cluster as user root.
- Run the following command to configure environment variables:
- Access Presto in a cluster with Kerberos authentication enabled.
- Log in to MRS Manager and create a role with the Hive Admin Privilege permission, for example, prestorerole.
- Create a user, for example, presto001, who belongs to the Presto and Hive groups, and bind the user to the role created in 3.a.
- Authenticate user presto001.
kinit presto001
- Download the user authentication credential.
- Operations on MRS Manager: Log in to MRS Manager and choose System > Manage User. Locate the row containing the new user, click More, and select Download authentication credential.
- Operations on MRS Manager:
Log in to MRS Manager, choose System > Permission > User. On the displayed page, locate the row that contains the user, choose More > Download Authentication Credential.
- Decompress the downloaded user credential file, and save the obtained krb5.conf and user.keytab files to the client directory, for example, /opt/client/Presto/.
- Run the following command to obtain the user principal:
- Run the following command to connect to the Presto Server of the cluster:
presto_cli.sh --krb5-config-path {krb5.conf file path} --krb5-principal {User's principal} --krb5-keytab-path {user.keytab file path} --user {presto username}
- On the Presto client, run the following statement to create a schema:
CREATE SCHEMA hive.demo01 WITH (location = 'obs://presto-demo002/');
- Create a table in the schema. The table data is stored in the OBS bucket, as shown in the following example:
CREATE TABLE hive.demo01.demo_table WITH (format = 'ORC') AS SELECT * FROM tpch.sf1.customer;
- Run exit to exit the client.
Parent topic: Kerberos Usage