How to connect to Deephaven from another Java program
Included in this package are some classes that demonstrate how to connect to Deephaven and either run a query directly, or connect to an existing Persistent Query.
Download the Demo Class Files Here
Set up
These examples rely on some external resources, both to compile and to run.
- The contents of
/usr/illumon/latest/java_lib
from a Deephaven installation of the same version as the server you are connecting to. This will provide all of the necessary underlying jar files needed. - The contents of a client-side Deephaven instance '
resources
' directory. This will contain all of the configuration files needed for a client to connect to the specified server.- On a Linux client, this will be under
~/iris/.programfiles/<instance name>/resources
. - On a Windows client, this will be under %APPDATA%/Local/Illumon/<instance name>/resources.
- On a Linux client, this will be under
- A configured private key for private key exchange. See instructions below.
- Several parameters passed into the Java command line:
-DConfiguration.rootFile=/path/to/your/iris-common.prop
: This is the base configuration file, located in your resources directory from item #2. The client needs to know where to find this file.-Dcom.fishlib.configuration.PropertyInputStreamLoader.override=com.fishlib.configuration.PropertyInputStreamLoaderTraditional
: This instructs the client to use your local property files, and not to try to retrieve property files from etcd. This string should be entered exactly as it is depicted here.-DAuthenticationClientManager.defaultPrivateKeyFile=/path/to/your/key/priv-<iris user name>.base64.txt
: This is the private key from item #3, entering the path as needed. Note that in Deephaven v1.20200331 (Treasure) or later, this is insteadWAuthenticationClientManager.defaultPrivateKeyFile
, and you will need to importcom.fishlib.auth.WAuthenticationClientManager
into the samples, instead ofio.deephaven.auth.AuthenticationClientManager
.-Dtls.passphrase.file=/path/to/your/resources/truststore_passphrase
: The TLS truststore passphrase information. Enter the absolute path here.-Dtls.truststore=/path/to/your/resources/truststore-iris.p12
: The TLS truststore itself. Enter the absolute path here.
Instructions for setting up private keys:
Deephaven has a utility available on the server with your Deephaven installation for generating private keys for automated login.
- On the server you will be connecting to, run:
/usr/illumon/latest/bin/generate-iris-keys <iris user name>
. - This will generate
pub-<iris user name>.base64.txt
andpriv-<iris user name>.base64.txt
on the server. - On the server, append the contents of
pub-<iris user name>.base64.txt
to/etc/sysconfig/deephaven/auth/dsakeys.txt
. - On the server, restart the authentication service. If you are generating multiple keys, you only need to do this one time, after you have finished making changes to
dsakeys.txt
. - Copy
priv-<iris user name>.base64.txt
to the client system that will be connecting to the server.
Last Updated: 16 February 2021 18:06 -04:00 UTC Deephaven v.1.20200928 (See other versions)
Deephaven Documentation Copyright 2016-2020 Deephaven Data Labs, LLC All Rights Reserved