开源大数据集群部署(十三)Ranger 集成Trino

news/2024/7/10 20:04:48 标签: 开源, 大数据

作者:櫰木

1、安装ranger trino插件

在trino的coordinator节点部署

  • 解压ranger-2.3.0-trino-plugin.tar.gz
[root@hd2.dtstack.com ]#tar -zxvf ranger-2.3.0-trino-plugin.tar.gz -C /opt
  • 配置ranger trino插件文件install.properties,内容如下 :
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
 
#
# Location of Policy Manager URL
#
# Example:
# POLICY_MGR_URL=http://policymanager.xasecure.net:6080
#
POLICY_MGR_URL=http://hd1.dtstack.com:6080/
 
#
# This is the repository name created within policy manager
#
# Example:
# REPOSITORY_NAME=trinodev
#
REPOSITORY_NAME=trinodev
 
# Configure INSTALL_ENV=docker if running trino in docker environment
#INSTALL_ENV=docker
#
# Name of the directory where the component's lib and conf directory exist.
# This location should be relative to the parent of the directory containing
# the plugin installation files.
#
COMPONENT_INSTALL_DIR_NAME=/opt/trino
 
# Enable audit logs to Solr
XAAUDIT.SUMMARY.ENABLE=false
#Example
#XAAUDIT.SOLR.ENABLE=true
#XAAUDIT.SOLR.URL=http://localhost:6083/solr/ranger_audits
#XAAUDIT.SOLR.ZOOKEEPER=
#XAAUDIT.SOLR.FILE_SPOOL_DIR=/var/log/trino/audit/solr/spool
 
XAAUDIT.SOLR.ENABLE=false
XAAUDIT.SOLR.URL=http://hd1.dtstack.com:8983/solr/ranger_audits
XAAUDIT.SOLR.USER=NONE
XAAUDIT.SOLR.PASSWORD=NONE
XAAUDIT.SOLR.ZOOKEEPER=hd1:2181,hd2:2181,hd3:2181/ranger_audits
XAAUDIT.SOLR.FILE_SPOOL_DIR=/var/log/trino/audit/solr/spool
 
# Enable audit logs to ElasticSearch
#Example
#XAAUDIT.ELASTICSEARCH.ENABLE=true
#XAAUDIT.ELASTICSEARCH.URL=localhost
#XAAUDIT.ELASTICSEARCH.INDEX=audit
 
XAAUDIT.ELASTICSEARCH.ENABLE=false
XAAUDIT.ELASTICSEARCH.URL=NONE
XAAUDIT.ELASTICSEARCH.USER=NONE
XAAUDIT.ELASTICSEARCH.PASSWORD=NONE
XAAUDIT.ELASTICSEARCH.INDEX=NONE
XAAUDIT.ELASTICSEARCH.PORT=NONE
XAAUDIT.ELASTICSEARCH.PROTOCOL=NONE
 
# Enable audit logs to HDFS
#Example
#XAAUDIT.HDFS.ENABLE=true
#XAAUDIT.HDFS.HDFS_DIR=hdfs://node-1.example.com:8020/ranger/audit
#  If using Azure Blob Storage
#XAAUDIT.HDFS.HDFS_DIR=wasb[s]://<containername>@<accountname>.blob.core.windows.net/<path>
#XAAUDIT.HDFS.HDFS_DIR=wasb://ranger_audit_container@my-azure-account.blob.core.windows.net/ranger/audit
#XAAUDIT.HDFS.FILE_SPOOL_DIR=/var/log/trino/audit/hdfs/spool
 
XAAUDIT.HDFS.ENABLE=false
XAAUDIT.HDFS.HDFS_DIR=hdfs://__REPLACE__NAME_NODE_HOST:8020/ranger/audit
XAAUDIT.HDFS.FILE_SPOOL_DIR=/var/log/trino/audit/hdfs/spool
 
# Following additional propertis are needed When auditing to Azure Blob Storage via HDFS
# Get these values from your /etc/hadoop/conf/core-site.xml
#XAAUDIT.HDFS.HDFS_DIR=wasb[s]://<containername>@<accountname>.blob.core.windows.net/<path>
XAAUDIT.HDFS.AZURE_ACCOUNTNAME=__REPLACE_AZURE_ACCOUNT_NAME
XAAUDIT.HDFS.AZURE_ACCOUNTKEY=__REPLACE_AZURE_ACCOUNT_KEY
XAAUDIT.HDFS.AZURE_SHELL_KEY_PROVIDER=__REPLACE_AZURE_SHELL_KEY_PROVIDER
XAAUDIT.HDFS.AZURE_ACCOUNTKEY_PROVIDER=__REPLACE_AZURE_ACCOUNT_KEY_PROVIDER
 
#Log4j Audit Provider
XAAUDIT.LOG4J.ENABLE=false
XAAUDIT.LOG4J.IS_ASYNC=false
XAAUDIT.LOG4J.ASYNC.MAX.QUEUE.SIZE=10240
XAAUDIT.LOG4J.ASYNC.MAX.FLUSH.INTERVAL.MS=30000
XAAUDIT.LOG4J.DESTINATION.LOG4J=true
XAAUDIT.LOG4J.DESTINATION.LOG4J.LOGGER=xaaudit
 
# Enable audit logs to Amazon CloudWatch Logs
#Example
#XAAUDIT.AMAZON_CLOUDWATCH.ENABLE=true
#XAAUDIT.AMAZON_CLOUDWATCH.LOG_GROUP=ranger_audits
#XAAUDIT.AMAZON_CLOUDWATCH.LOG_STREAM={instance_id}
#XAAUDIT.AMAZON_CLOUDWATCH.FILE_SPOOL_DIR=/var/log/hive/audit/amazon_cloudwatch/spool
 
XAAUDIT.AMAZON_CLOUDWATCH.ENABLE=false
XAAUDIT.AMAZON_CLOUDWATCH.LOG_GROUP=NONE
XAAUDIT.AMAZON_CLOUDWATCH.LOG_STREAM_PREFIX=NONE
XAAUDIT.AMAZON_CLOUDWATCH.FILE_SPOOL_DIR=NONE
XAAUDIT.AMAZON_CLOUDWATCH.REGION=NONE
 
# End of V3 properties
 
 
#
#  Audit to HDFS Configuration
#
# If XAAUDIT.HDFS.IS_ENABLED is set to true, please replace tokens
# that start with __REPLACE__ with appropriate values
#  XAAUDIT.HDFS.IS_ENABLED=true
#  XAAUDIT.HDFS.DESTINATION_DIRECTORY=hdfs://__REPLACE__NAME_NODE_HOST:8020/ranger/audit/%app-type%/%time:yyyyMMdd%
#  XAAUDIT.HDFS.LOCAL_BUFFER_DIRECTORY=__REPLACE__LOG_DIR/trino/audit
#  XAAUDIT.HDFS.LOCAL_ARCHIVE_DIRECTORY=__REPLACE__LOG_DIR/trino/audit/archive
#
# Example:
#  XAAUDIT.HDFS.IS_ENABLED=true
#  XAAUDIT.HDFS.DESTINATION_DIRECTORY=hdfs://namenode.example.com:8020/ranger/audit/%app-type%/%time:yyyyMMdd%
#  XAAUDIT.HDFS.LOCAL_BUFFER_DIRECTORY=/var/log/trino/audit
#  XAAUDIT.HDFS.LOCAL_ARCHIVE_DIRECTORY=/var/log/trino/audit/archive
#
XAAUDIT.HDFS.IS_ENABLED=false
XAAUDIT.HDFS.DESTINATION_DIRECTORY=hdfs://__REPLACE__NAME_NODE_HOST:8020/ranger/audit/%app-type%/%time:yyyyMMdd%
XAAUDIT.HDFS.LOCAL_BUFFER_DIRECTORY=__REPLACE__LOG_DIR/trino/audit
XAAUDIT.HDFS.LOCAL_ARCHIVE_DIRECTORY=__REPLACE__LOG_DIR/trino/audit/archive
 
XAAUDIT.HDFS.DESTINTATION_FILE=%hostname%-audit.log
XAAUDIT.HDFS.DESTINTATION_FLUSH_INTERVAL_SECONDS=900
XAAUDIT.HDFS.DESTINTATION_ROLLOVER_INTERVAL_SECONDS=86400
XAAUDIT.HDFS.DESTINTATION_OPEN_RETRY_INTERVAL_SECONDS=60
XAAUDIT.HDFS.LOCAL_BUFFER_FILE=%time:yyyyMMdd-HHmm.ss%.log
XAAUDIT.HDFS.LOCAL_BUFFER_FLUSH_INTERVAL_SECONDS=60
XAAUDIT.HDFS.LOCAL_BUFFER_ROLLOVER_INTERVAL_SECONDS=600
XAAUDIT.HDFS.LOCAL_ARCHIVE_MAX_FILE_COUNT=10
 
#Solr Audit Provider
XAAUDIT.SOLR.IS_ENABLED=false
XAAUDIT.SOLR.MAX_QUEUE_SIZE=1
XAAUDIT.SOLR.MAX_FLUSH_INTERVAL_MS=1000
XAAUDIT.SOLR.SOLR_URL=http://localhost:6083/solr/ranger_audits
 
# End of V2 properties
 
#
# SSL Client Certificate Information
#
# Example:
# SSL_KEYSTORE_FILE_PATH=/etc/hadoop/conf/ranger-plugin-keystore.jks
# SSL_KEYSTORE_PASSWORD=none
# SSL_TRUSTSTORE_FILE_PATH=/etc/hadoop/conf/ranger-plugin-truststore.jks
# SSL_TRUSTSTORE_PASSWORD=none
#
# You do not need use SSL between agent and security admin tool, please leave these sample value as it is.
#
SSL_KEYSTORE_FILE_PATH=/etc/hadoop/conf/ranger-plugin-keystore.jks
SSL_KEYSTORE_PASSWORD=myKeyFilePassword
SSL_TRUSTSTORE_FILE_PATH=/etc/hadoop/conf/ranger-plugin-truststore.jks
SSL_TRUSTSTORE_PASSWORD=changeit
 
#
# Custom component user
# CUSTOM_COMPONENT_USER=<custom-user>
# keep blank if component user is default
CUSTOM_USER=trino
 
 
#
# Custom component group
# CUSTOM_COMPONENT_GROUP=<custom-group>
# keep blank if component group is default
CUSTOM_GROUP=hadoop

2、初始化插件

[root@hd1.dtstack.com ranger-2.3.0-trno-plugin]# ./enable-trnio-plugin.sh

在这里插入图片描述

4、验证插件是否生效

通过查看/opt/trino/etc/access-control.properties。
添加

access-control.name=ranger
ranger.principal=trino/hd1.dtstack.com@DTSTACK.COM
ranger.keytab=/etc/security/keytab/trino.keytab

软链core-site.xml到trino的etc目录下

ln -s /opt/hadoop/etc/hadoop/core-site.xml core-site.xml

在这里插入图片描述

5、Ranger web界面配置trino

访问地址:http://hd2.dtstack.com:6080/

用户密码:admin/rangerAdmin123

在这里插入图片描述
username 对应值:trino
jdbc.driverClassName对应值:io.trino.jdbc.TrinoDriver
jdbc.url对应值:jdbc:trino://hd1.dtstack.com:18080/catalog
tag.download.auth.users:trino
policy.download.auth.users:trino
在这里插入图片描述
点解测试连接
在这里插入图片描述
显示连接成功,配置正确,保存退出。
在这里插入图片描述
点击主页刚添加的trino
在这里插入图片描述
至此,ranger集成trino完成
Trino 用户策略授权。以test用户为例
首先需要添加对应的catalog权限
在这里插入图片描述
在这里插入图片描述
添加tableschema权限
在这里插入图片描述
在这里插入图片描述
添加用户表的权限
在这里插入图片描述
在这里插入图片描述
进行验证
trino-cli --server hd1.dtstack.com:18080 --catalog=hive --schema=test --user test
在这里插入图片描述
在这里插入图片描述
更多技术信息请查看云掣官网https://yunche.pro/?t=yrgw


http://www.niftyadmin.cn/n/5398953.html

相关文章

智能家居的智能升级

智能家居是对传统家居的智能升级&#xff0c;可分为六大类 智能家居的理念是以住宅为平台&#xff0c;综合利用物联网、云计算、人工智能、机器学习等技术将家居生活有关设备升级并集成&#xff0c;使其具有集中管理、远程控制、互联互通、自主学习等功能&#xff0c;为住户创造…

如何学习自然语言处理之语言模型

自然语言处理&#xff08;NLP&#xff09;是一种人工智能技术&#xff0c;它使计算机能够理解和处理人类语言。而语言模型是NLP中的一个重要概念&#xff0c;主要是用来估测一些词的序列的概率&#xff0c;即预测p(w1, w2, w3 … wn)&#xff0c;其中一个应用就是句子的生成。 …

ARM总结and复习

安装交叉编译工具链 a. 为什么安装 因为arm公司的指令集在不断迭代升级&#xff0c;指令集日益增多,而架构是基于指令集研发的&#xff0c;所以架构不一样&#xff0c;指令集也不一样 eg:arm架构使用的是arm指令集 x86架构使用的是x86指令集 而我们日常开发环境中linux的架构…

灰度负载均衡和普通负载均衡有什么区别

灰度负载均衡&#xff08;Gray Load Balancing&#xff09;与普通负载均衡的主要区别在于它们服务发布和流量管理的方式。 灰度负载均衡 目的&#xff1a;主要用于灰度发布&#xff0c;即逐步向用户发布新版本的服务&#xff0c;以减少新版本可能带来的风险。工作方式&#x…

嵌入式驱动学习第一周——定时器与延时函数

前言 这篇博客一起学习定时器&#xff0c;定时器是最常用到的功能之一&#xff0c;其最大的作用之一就是提供了延时函数。 嵌入式驱动学习专栏将详细记录博主学习驱动的详细过程&#xff0c;未来预计四个月将高强度更新本专栏&#xff0c;喜欢的可以关注本博主并订阅本专栏&…

Eigen-矩阵切片和索引

矩阵切片和索引 一、概述二、基本的切片三、编译时间大小和增量四、相反的顺序五、索引数组六、自定义索引列表 一、概述 本页介绍了操作符 () 为索引子集行和列提供的多种可能性。这个API已经在特性3.4中引入。它支持块API提出的所有特性&#xff0c;以及更多。特别是&#x…

gitlab+jenkins 搭建部署

为什么要搭建gitlab和jenkins&#xff1f; 开发人员在每次开发完或修改一个bug后都要手动合并&#xff0c;打包或者连接服务器执行打包部署&#xff0c;每次手动操作&#xff0c;极大的影响了开发人员的效率。 gitlab和jenkins组合起来&#xff0c;开发人员只需要进行推送或合并…

J1—Vivado调试技巧VIO IP

1.简介 VIO&#xff08;Virtual Input/Output&#xff09;IP核是一种用于FPGA设计的IP核&#xff0c;它可以模拟输入/输出设备的功能&#xff0c;如键盘、鼠标、显示器等。VIO IP核可以在FPGA设计中用于调试和验证&#xff0c;帮助工程师快速定位问题并进行调试。如图所示&…