Use Deephaven with AWS EC2
Amazon Web Services (AWS) is the world's most popular cloud computing service. It offers a wide variety of cloud solutions, and these tend to pair well with Deephaven Community Core.
This guide shows you how to run Deephaven on an AWS EC2 (Elastic Compute Cloud) instance, then connect to the user interface (UI) from your local machine and run queries.
Create an AWS EC2 instance
This guide uses an EC2 instance running Amazon Linux. AWS offers a variety of other operating systems for cloud instances.
The instance type you need depends on your data and your calculations. There are many different AWS EC2 instance types to choose from. Tables you create in Deephaven live on the JVM heap, so choose an instance with enough memory for the in-memory tables and results you expect. Tables read from Parquet files load on demand. You set the server's heap size when you install Deephaven. See Install and run Deephaven.
Create an instance with the following steps.
- Follow the steps in Amazon's Set up to use Amazon EC2 guide.
- Follow the steps in Amazon's Get started with Amazon EC2 Linux instances guide.
For more options, see Amazon's EC2 tutorials.
Install and run Deephaven
We recommend installing Deephaven with Docker on your EC2 instance.
Install and start Docker on the instance first. On Amazon Linux 2023, run:
Log out and back in so the docker group applies to your user.
Docker needs no Java on the host. To set the heap size, see Add more memory.
Install Java to build from source
Install Java only if you plan to build Deephaven from source. Building from source requires JDK 21. Install the Java Development Kit (JDK) as that guide describes. Amazon provides Corretto, a free OpenJDK distribution. On Amazon Linux 2023, install Corretto 21 with:
Connect to Deephaven
With Deephaven running on your AWS instance, all that's left to do is to connect to the user interface (UI) from your local machine:
- In the EC2 console, add an inbound rule to the instance's security group that allows TCP traffic on port
10000from your own IP address only. Port10000is Deephaven's default. If you changed the server's port, allow that port instead. - Find the instance's public IPv4 address or public DNS name in the EC2 console.
- In your web browser, go to
http://<public-ip>:10000/ide, replacing<public-ip>with that address or name. - Enter the pre-shared key when prompted. Unless you set your own key, Deephaven generates one and prints it in the server log.
The http:// address sends the key and your data over the internet unencrypted. To keep the connection private, close port 10000 in the security group and open an SSH tunnel from your local machine instead:
With the tunnel open, go to http://localhost:10000/ide in your browser.
Once logged in, you'll see your Deephaven UI, where you can create and run queries.