Configure BigMemory Servers for Presto Caching and In-Memory Stores
You can configure
Presto to work with one or an array of
BigMemory Servers to provide additional memory, provide reliability and support specific other features. See
BigMemory for
Caching, Connections and
Presto Analytics for more information on features that require
BigMemory servers.
To configure BigMemory Servers for Presto
1. Copy your license for BigMemory to Presto and update Presto startup scripts:
a. Copy the license file terracotta.key to the presto-install/apache-tomee-jaxrs/conf folder.
Note: | If Presto is deployed in a cluster, you must copy this file to every cluster member. |
b. Add this Java system property to the Presto startup script :
-Dcom.tc.productkey.path=presto-install/apache-tomee-jaxrs/conf/terracotta.key
Add this property to either:
presto-install/apache-tomee-jaxrs/bin/setenv.bat file for Windows systems, or
presto-install/apache-tomee-jaxrs/bin/setenv.sh file for Linux, OS/X or UNIX systems.
Note: | If Presto is deployed in a cluster, you must update the startup scripts for every cluster member. |
2. Edit the ehcache.xml file for Presto in a text editor of your choice. The location depends on your deployed environment:
Only One Presto Server | presto-install/apache-tomee-jaxrs/webapps/presto/WEB-INF/classes/ehcache.xml |
A Presto Cluster and Shared External Configuration Folder | presto-config/ehcache.xml |
A Presto Cluster With No Shared Configuration | You must update presto-install/apache-tomee-jaxrs/webapps/presto/WEB-INF/classes/ehcache.xml for each cluster member. |
3. Find the line in ehcache.xml with <terracottaConfig> that is commented out like this:
<!-- <terracottaConfig url="localhost:9510" /> -->
Remove the comment markers and change the url attribute to the host (or IP address) and port for the BigMemory server(s) you installed. For example:
<terracottaConfig url="tcHost1:9510" />
Note: | There are several ways to identify one or more BigMemory servers for Presto. See BigMemory documentation for more information. |
4. Find the line in ehcache.xml with <terracotta> that is commented out and uncomment this line for each of the following named <cache> elements:
RAQL_DATA_CACHE = the
Presto Analytics In-Memory Stores SEARCH_RESULTS_CACHE = one part of the
Presto Artifact cache.
SERVICES_BY_ID_CACHE = = one part of the
Presto Artifact cache.
SERVICE_RESPONSE_CACHE = the
Presto Response cache for mashables and mashups. This is optional. Update this cache
only if you want it to be distributed.
This <terracotta> element allows the In-Memory Store and Presto caches to use heap and off-heap memory in both the local host and BigMemory hosts. This combined memory is managed by BigMemory.
For more information on the
<terracotta> element, see
Distributed Configuration topics in
BigMemory documentation.
5. Save these changes to ehcache.xml.
Important: | For clusters where this configuration file is not stored in a shared external folder, copy this file to the same location for each Presto cluster member. |
6. Optionally, update configuration for dynamic In-Memory Stores that Presto Analytics creates to work with BigMemory servers:
a. Edit the dynamiccache.xml file in these locations (based on your deployed environment):
Only One Presto Server | presto-install/apache-tomee-jaxrs/webapps/presto/WEB-INF/classes/dynamiccache.xml |
A Presto Cluster and Shared External Configuration Folder | presto-config/dynamiccache.xml |
A Presto Cluster With No Shared Configuration | You must update presto-install/apache-tomee-jaxrs/webapps/presto/WEB-INF/classes/dynamiccache.xml for each cluster member. |
b. Add a <terracotta> element inside the <cache> element.
c. Provide URLs or other connection information as needed.
d. Save your changes.
7. Optionally, update configuration for any declared In-Memory Stores to work with these BigMemory server(s):
a. In the configuration files for your declared In-Memory Stores, add a <terracotta> element inside the corresponding <cache> element.
b. Provide URLs or other connection information as needed.
c. Save changes to these files.
8. Start BigMemory Server(s).