Connecting to Spark via JDBC/ODBC Thrift Server
For Legacy Support Purposes Only |
---|
This page will walk you through connecting to JDBC via Thrift Server to use for querying to your Spark cluster.
Table of Contents
Setting Up Your Environment
Create and set up your Spark cluster
To start, follow the first three steps in Getting Started with Instaclustr Spark & Cassandra:
- Provision a cluster with Cassandra
- Set up a Spark Client (but changing the configuration to “AMI: Ubuntu Server 167.04 LTS (HVM), SSD Volume Type”).
- Configure Client Network Access
Java 8
Ensure that your Spark client machine has Java 8 installed and selected as the preferred Java version.
1 2 |
sudo apt update sudo apt install openjdk-8-jdk |
Install Spark 2.1.1:
1 2 |
wget https://archive.apache.org/dist/spark/spark-2.1.1/spark-2.1.1-bin-hadoop2.7.tgz tar -xf spark-2.1.1-bin-hadoop2.7.tgz |
Start the Thrift Server
1 |
./start-thriftserver.sh --master spark://<spark_master_IP1>:7077,<spark_master_IP2>:7077,<spark_master_IP3>:7077 |
Query using Beeline
Start beeline (included with Spark):
1 |
./bin/beeline |
Once Beeline starts, connect to the Thrift Server:
1 |
!connect jdbc:hive2://localhost:1000 |
Username: ubuntu
Password: <empty> (just press enter when prompted).
Now run your queries as you wish!
By Instaclustr Support
Need Support?
Experiencing difficulties on the website or console?
Already have an account?
Need help with your cluster?
Contact Support
Why sign up?