Installing Java on Vertica Hosts
You must install a Java Virtual Machine (JVM) on every host in your Vertica cluster in order to run Pulse. Pulse requires a 64-bit Java Standard Edition 6, 7, or 8 (Java version 1.6, 1.7, 1.8) runtime. Both the Oracle JDK and openjdk are supported. You can choose to install either the Java Runtime Environment (JRE) or Java Development Kit (JDK), since the JDK also includes the JRE. See the Java Standard Edition (SE) Download Page to download an Oracle installation package for your Linux platform, or use your platforms packaging tool (such as yum or apt-get) to get a Java 1.6, 1.7, or 1.8 compatible version of open-jdk.
Once you have installed a JVM on each host, ensure that the java
command is in the search path and calls the correct JVM by running the command:
java -version
This command should print something similar to:
java version "1.6.0_37" Java(TM) SE Runtime Environment (build 1.6.0_37-b06) Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)
Setting the JavaBinaryForUDx Configuration Parameter
The JavaBinaryForUDx configuration parameter tells Vertica where to look for the JRE to execute Java UDFs. After you have installed the JRE on all of the nodes in your cluster, you need to set this parameter to the absolute path of the Java executable. You can use the symbolic link that some Java installers create (for example /usr/bin/java). If the Java executable is in your shell search path, you can get the path of the Java executable by running the following command from the Linux command line shell:
$ which java /usr/bin/java
If the java
command is not in the shell search path, use the path to the Java executable in the directory where you installed the JRE. For example, if you installed the JRE in /usr/java/default
(which is where the installation package supplied by Oracle installs the Java 1.6 JRE), the Java executable is /usr/java/default/bin/java
.
You set the configuration parameter by executing the following statement as a database superuser:
=> ALTER DATABASE mydb SET JavaBinaryForUDx = '/usr/bin/java';
See ALTER DATABASE for more information on setting configuration parameters.
To view the current setting of the configuration parameter, query the CONFIGURATION_PARAMETERS system table:
=> \x Expanded display is on. => SELECT * FROM CONFIGURATION_PARAMETERS WHERE parameter_name =
'JavaBinaryForUDx'; -[ RECORD 1 ]-----------------+---------------------------------------------- node_name | ALL parameter_name | JavaBinaryForUDx current_value | /usr/bin/java default_value | change_under_support_guidance | f change_requires_restart | f description | Path to the java binary for executing UDx written in Java
Once you have set the configuration parameter, Vertica will be able to find the Java executable on each node in your cluster in order to execute Java UDFs.
Note: Since the location of the Java executable is set by a single configuration parameter for the entire cluster, you must ensure that the path to the Java executable is the same across all of the nodes in the cluster.