Setting Up an External Presto Configuration Folder
Most configuration for Presto and most of the extensions that you add for your organization’s use are stored in the Presto Repository. However, some Presto configuration and extensions are file based.
By default, Presto keeps configuration and extensions in the Presto Server web application in these folders:
presto-install/apache-tomee-jaxrs/presto/WEB-INF/classes for class, configuration and extension files
presto-install/apache-tomee-jaxrs/presto/WEB-INF/lib and
presto-install/apache-tomee-jaxrs/presto/WEB-INF/config for JAR files.
You can move most of these configuration and extension files to folders that are external to the Presto Server.
Important: | Presto documentation refers to all of these folders as presto-config. |
Using external configuration folders for Presto is a best practice as they simplify deployment and upgrades of the Presto Server. They also simplify configuration management for clustered environments. External configuration folders are not required, however.
To create and use an external configuration folder for Presto
1. Create the top-level external folder to use for Presto configuration, such as PrestoConfig. In clustered environments, share or mount this folder across the entire cluster.
You can create subfolders under this external folder to organize configuration and extensions.
2. For clustered environments, create subfolders under the top-level external configuration folder for:
The standard
classes and
lib folders.
Built-in and user-defined functions for use in
RAQL queries for
Presto Analytics.
The external configuration folder tree should now look something like this:
3. If not complete, finish configuration for the
Presto Server and move the configuration and extension files to the external configuration folder or an appropriate subfolder. See the
Presto
File-Based Configuration and Extensions section for the specific configuration steps, files and locations.
4. Add the external Presto configuration folder, and any subfolder that contains extensions or JAR files, to the classpath for the application server(s) hosting the Presto Server.
You may update the classpath in configuration files or in the startup script for the application server.
For Windows environments, for example, you can edit the tomee-install/bin/setenv.bat file and update the classpath environmental variable to be something like this:
set "CLASSPATH=%CLASSPATH%;C:\PrestoConfig;C:\PrestoConfig\classes;C:\PrestoConfig\lib;C:\PrestoConfig\db\jdbc"
On Linux, Mac OS X or UNIX systems, you would update tomee-install/bin/setenv.sh to something like this:
CLASSPATH="$CLASSPATH":/users/PrestoConfig:/users/PrestoConfig/classes:/users/PrestoConfig/lib:users/PrestoConfig/db/jdbc