trino组件对接ldap(二)
1、coordinater设置证书
keytool -genkeypair -validity 36500 -ext SAN=IP:172.16.121.0,DNS:hadoop001 -alias trino -keypass admin@123 -storepass admin@123 -keyalg RSA -dname CN=hadoop001,OU=,O=,L=,ST=,C= -keystore trino.jks keytool -export -rfc -keystore trino.jks --alias trino -file trino.pem
2、在所有trino节点增加password-authenticator.properties配置文件
password-authenticator.name=ldap ldap.url=ldap://172.16.121.210:30389 ldap.user-base-dn=ou=People,dc=dtstack,dc=com ldap.user-bind-pattern=uid=${USER},ou=People,dc=dtstack,dc=com ldap.allow-insecure=true
3、所有trino节点增加config.properties的配置
http-server.https.enabled=true http-server.https.port=8443 http-server.https.keystore.key=admin@123 http-server.https.keystore.path=/opt/trino/etc/trino.jks internal-communication.shared-secret=abc123 internal-communication.https.required=true http-server.https.secure-random-algorithm=SHA1PRNG http-server.authentication.allow-insecure-over-http=true http-server.authentication.type=PASSWORD
4、所有节点hive.properties中增加配置
hive.metastore.thrift.impersonation.enabled=true
5、重启trino
#进入trino部署路径下 cd /opt/trino/bin ./launcher stop ./launcher start
6、查看webui
帐号密码填入ldap的帐号密码
冒烟测试
1、使用test用户对test库下面的数据进行处理
#需要输入ldap中test的用户密码 /opt/trino/trino-cli --server https://172.16.121.0:8443 --keystore-path /opt/trino/etc/trino.jks --keystore-password admin@123 --catalog hive --user test --password --debug password: trino> use test; USE trino:test> show tables; Table -------------------- alluxio_user2 alluxio_user3 alluxio_user4 alluxio_user5 alluxiotest hive_student hive_student1 student test test_hive_hdfs test_spark_alluxio test_spark_hdfs testcc u_user u_user2 (15 rows) Query 20231122_092602_00075_qew3a, FINISHED, 3 nodes https://172.16.121.0:8443/ui/query.html?20231122_092602_00075_qew3a Splits: 53 total, 53 done (100.00%) CPU Time: 0.0s total, 576 rows/s, 14.1KB/s, 14% active Per Node: 0.0 parallelism, 15 rows/s, 397B/s Parallelism: 0.1 Peak Memory: 1.62KB 0.32 [15 rows, 375B] [47 rows/s, 1.16KB/s] trino:test> select * from student; id | name | age | gender | grade -----+--------+-----+--------+---------- 108 | 曾华 | 22 | male | 95033 108 | 曾华 | 22 | male | 95033 1 | Alice | 18 | Female | Grade 12 trino:test> insert into hive.test.student values(109,'曾华',22,'male','95033'); INSERT: 1 row Query 20231122_092840_00077_qew3a, FINISHED, 2 nodes https://172.16.121.0:8443/ui/query.html?20231122_092840_00077_qew3a Splits: 50 total, 50 done (100.00%) CPU Time: 0.1s total, 0 rows/s, 0B/s, 30% active Per Node: 0.0 parallelism, 0 rows/s, 0B/s Parallelism: 0.1 Peak Memory: 28.9KB 0.83 [0 rows, 0B] [0 rows/s, 0B/s] trino:test> select * from student; id | name | age | gender | grade -----+--------+-----+--------+---------- 108 | 曾华 | 22 | male | 95033 109 | 曾华 | 22 | male | 95033 1 | Alice | 18 | Female | Grade 12 108 | 曾华 | 22 | male | 95033 trino:test> select count(*) from student; _col0 ------- 4 (1 row)