trinodb / trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
https://trino.io
Apache License 2.0
10.2k stars 2.94k forks source link

`Access control 'ranger' is not registered` when installing Ranger Trino plugin #18490

Closed floyola closed 1 year ago

floyola commented 1 year ago

I'm trying to install the ranger trino plugin, however I'm getting the following error

2023-08-01T18:35:24.368Z    INFO    main    io.trino.security.AccessControlManager  -- Loading system access control etc/access-control.properties --
2023-08-01T18:35:24.368Z    ERROR   main    io.trino.server.Server  Access control 'ranger' is not registered: /code/var/presto/data/etc/access-control.properties

These are the plugin logs

+ Tue Aug  1 20:13:42 UTC 2023 : trino: lib folder=/code/presto/presto/lib conf folder=/code/presto/presto/etc
+ Tue Aug  1 20:13:42 UTC 2023 : Saving current config file: /code/presto/presto/etc/ranger-policymgr-ssl.xml to /code/presto/presto/etc/.ranger-policymgr-ssl.xml.20230801-201342 ...
+ Tue Aug  1 20:13:42 UTC 2023 : Saving current config file: /code/presto/presto/etc/ranger-trino-audit.xml to /code/presto/presto/etc/.ranger-trino-audit.xml.20230801-201342 ...
+ Tue Aug  1 20:13:43 UTC 2023 : Saving current config file: /code/presto/presto/etc/ranger-trino-security.xml to /code/presto/presto/etc/.ranger-trino-security.xml.20230801-201342 ...
+ Tue Aug  1 20:13:43 UTC 2023 : Saving lib file: /code/presto/presto/lib/guice-5.1.0.jar to /code/presto/presto/lib/.guice-5.1.0.jar.20230801201343 ...
+ Tue Aug  1 20:13:43 UTC 2023 : Saving lib file: /code/presto/presto/lib/javax.annotation-api-1.3.2.jar to /code/presto/presto/lib/.javax.annotation-api-1.3.2.jar.20230801201343 ...
+ Tue Aug  1 20:13:43 UTC 2023 : Saving lib file: /code/presto/presto/lib/javax.inject-1.jar to /code/presto/presto/lib/.javax.inject-1.jar.20230801201343 ...
+ Tue Aug  1 20:13:43 UTC 2023 : Saving lib file: /code/presto/presto/lib/validation-api-2.0.1.Final.jar to /code/presto/presto/lib/.validation-api-2.0.1.Final.jar.20230801201343 ...
Property -Dlogback.configurationFile added successfully with : '/code/presto/presto/etc/trino-ranger-plugin-logback.xml'
backup of /code/presto/presto/etc/access-control.properties to /code/presto/presto/etc/.access-control.properties.20230801201343 ...
Add or Update properties file: [/code/presto/presto/etc/access-control.properties] ...
Property access-control.name updated successfully with : 'ranger'
Linking config files
Ranger Plugin for trino has been enabled.

The installation dir looks like the following

|____bin
| |____launcher
| |____launcher.properties
| |____launcher.py
| |____procname
| | |____Linux-aarch64
| | | |____libprocname.so
| | |____Linux-ppc64le
| | | |____libprocname.so
| | |____Linux-x86_64
| | | |____libprocname.so
|____lib
| |____ ...
|____ranger-trino-plugin
| |____disable-trino-plugin.sh
| |____enable-trino-plugin.sh
| |____install
| | |____conf.templates
| | | |____enable
| | | | |____ranger-policymgr-ssl-changes.cfg
| | | | |____ranger-policymgr-ssl.xml
| | | | |____ranger-trino-audit-changes.cfg
| | | | |____ranger-trino-audit.xml
| | | | |____ranger-trino-security-changes.cfg
| | | | |____ranger-trino-security.xml
| | |____lib
| | | |____commons-cli-1.2.jar
| | | |____commons-collections-3.2.2.jar
| | | |____commons-compress-1.8.1.jar
| | | |____commons-configuration2-2.8.0.jar
| | | |____commons-io-2.5.jar
| | | |____commons-lang-2.6.jar
| | | |____commons-lang3-3.3.2.jar
| | | |____commons-logging-1.2.jar
| | | |____credentialbuilder-2.4.9.jar
| | | |____guava-27.0-jre.jar
| | | |____hadoop-auth-3.3.0.jar
| | | |____hadoop-common-3.3.0.jar
| | | |____htrace-core4-4.1.0-incubating.jar
| | | |____ranger-plugins-installer-2.4.9.jar
| | | |____slf4j-api-1.7.32.jar
| | | |____stax2-api-3.1.4.jar
| | | |____woodstox-core-5.0.3.jar
| |____install.properties
| |____lib
| | |____bootstrap-0.192.jar
| | |____bval-jsr-2.0.0.jar
| | |____configuration-0.192.jar
| | |____guava-26.0-jre.jar
| | |____guice-5.1.0.jar
| | |____jackson-core-2.11.3.jar
| | |____javax.annotation-api-1.3.2.jar
| | |____javax.inject-1.jar
| | |____log-0.192.jar
| | |____log-manager-0.192.jar
| | |____ranger-plugin-classloader-2.4.9.jar
| | |____ranger-trino-plugin-impl
| | | |____...
| | |____ranger-trino-plugin-shim-2.4.9.jar
| | |____slf4j-api-1.7.32.jar
| | |____slf4j-simple-1.7.32.jar
| | |____validation-api-2.0.1.Final.jar
| |____ranger_credential_helper.py
| |____trino-ranger-plugin-logback.xml
|____etc
| |____access-control.properties
| |____.access-control.properties.20230801201343
| |____trino-ranger-plugin-logback.xml
| |____.ranger-trino-security.xml-new.20230801-201342
| |____.ranger-trino-security.xml.20230801-201342
| |____.ranger-trino-audit.xml-new.20230801-201342
| |____.ranger-trino-audit.xml.20230801-201342
| |____.ranger-policymgr-ssl.xml-new.20230801-201342
| |____.ranger-policymgr-ssl.xml.20230801-201342
| |____ranger-trino-security.xml
| |____ranger-trino-audit.xml
| |____ranger-policymgr-ssl.xml
| |____ranger-security.xml
| |____catalog
| | |____...
| |____rules.json
| |____resource-groups.properties
| |____node.properties
| |____mapping.json
| |____log.properties
| |____jvm.config
| |____jmxtrans-agent.xml
| |____java.security
| |____event-listener.properties
| |____config.properties

And the access-control.properties only contains access-control.name=ranger

I hope you can help me to find out if I'm missing something

Ranger version: 2.4.0

Trino version: 405

ebyhr commented 1 year ago

The plugin isn't managed in this repository. I would recommend asking the owner of the project.

A-little-bit-of-data commented 1 year ago

Hello, I would like to ask you how to adapt and compile your ranger and trino versions. I tried ranger 2.4.0 and trino 424 for adaptation, but no matter how I compile, I get an error [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project ranger-trino-plugin: Compilation failure: Compilation failure: [ERROR] Picked up JAVA_TOOL_OPTIONS: -Xmx3489m [ERROR] /workspace/ranger/plugin-trino/src/main/java/org/apache/ranger/authorization/trino/authorizer/RangerSystemAccessControl.java:[21,29] error: cannot access CatalogSchemaName [ERROR] bad class file: /workspace/m2-repository/io/trino/trino-spi/424/trino-spi-424.jar(/io/trino/spi/connector/CatalogSchemaName.class) [ERROR] class file has wrong version 61.0, should be 55.0

Finally switched the jdk version or reported an error。

dshershov commented 1 year ago

@A-little-bit-of-data Hi, Could you help me with that? which version of JDK working with ranger 2.4.0?

A-little-bit-of-data commented 11 months ago

@A-little-bit-of-data Hi, Could you help me with that? which version of JDK working with ranger 2.4.0?

it is 17

2416210017 commented 10 months ago

@A-little-bit-of-data Hi, Could you help me with that? which version of JDK working with ranger 2.4.0?

it is 17

Can Ranger 2.4.0 be used in conjunction with the new version of trino server-426?