trinodb / trino-admin

A tool to install, configure and manage Trino installations
Apache License 2.0
26 stars 18 forks source link

configuration deploy supports deploying other files #25

Open Chaho12 opened 4 years ago

Chaho12 commented 4 years ago

Suggestions

Doc here saids that only the following files will be distributed, but would be great if they support other folder/files !

node.properties
config.properties
jvm.config
log.properties (if it exists)

https://prestosql.github.io/presto-admin/docs/current/presto-admin-commands.html?highlight=properties#configuration-deploy

Reasons

In order to use hive catalog, i need to set up hive config files such as core-site.xml and hdfs-site.xml, and it would be great if I could put the files at coordinator/worker directory and gets distributed across the cluster via presto-admin. Maybe, we could put all other folders at other folder under coordinator/worker directory :)

Chaho12 commented 4 years ago

Also, i was setting presto to secure (using kerberos), so I added access-control.properties file to the coordinator directory but this also did not get sent when using presto-admin configuration deploy command.

petroav commented 4 years ago

@Chaho12 you can actually hack around this by using the plugin add_jar command. See https://prestosql.github.io/presto-admin/docs/current/presto-admin-commands.html?highlight=properties#plugin-add-jar.

For example if you want to deploy a local file called my-file.txt then you can run presto-admin plugin add_jar my-file.txt dir1 /opt/dir2. This will place my-file.txt in /opt/dir2/dir1/my-file.txt. I'm not sure if this happens on all nodes but I think it does, double check.

tnatssb commented 4 years ago

As a work around, you can use presto-admin to copy files to all nodes: ./presto-admin file copy /tmp/somefile /etc/presto

This will copy "somefile" to each node's /etc/presto directory.

Chaho12 commented 4 years ago

Thx for quick replies :)

I guess this is workaround but would be great if I can differentiate for the files that I distribute either to worker or coordinator. Because there are files for Secure(Kerberos) that only matters for coordinator.

/presto-admin file copy /tmp/somefile /etc/presto

I tried this method, and it works for files and folders!.

./presto-admin plugin add_jar my-file.txt dir1 /opt/dir2

./presto-admin plugin add_jar testFile.txt home1/irteamsu/prestoadmin/testFolder/ /etc/presto

I think there's a bug with using add_jar. For some reason, it fails to find the path (using presto admin 2.10) image image

trying to give directory with full path did not work either.

but the folder is created and distributed among the nodes. (empty folder) image

only ../presto-admin plugin add_jar testFile.txt ./ /etc/presto works for some reason. Did i miss something?

file permission differs

But interestingly, the file owner/group is not presto, but rather the account that I am in when distributing files. On the other hand, folder/file owner/group is root for distributing folder using