ubuntu 安装 beeline

9/25/2021 beelineubuntuhive

Although Beeline is included on the head nodes, you may want to install it locally. The install steps for a local machine are based on a Windows Subsystem for Linux.

# Update package lists. Enter the following command in your bash shell:

sudo apt-get update
1

# Install Java if not installed. You can check with the which java command.

java -version
1

# If no java package is installed, enter the following command:

sudo apt install openjdk-8-jre-headless
1

# Open the bashrc file (often found in ~/.bashrc):

nano ~/.bashrc
1

# Amend the bashrc file. Add the following line at the end of the file:

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
1

Then press Ctrl+X, then Y, then enter.

# Download Hadoop and Beeline archives, enter the following commands:

wget https://archive.apache.org/dist/hadoop/core/hadoop-2.7.3/hadoop-2.7.3.tar.gz
wget https://archive.apache.org/dist/hive/hive-1.2.1/apache-hive-1.2.1-bin.tar.gz
1
2

# Unpack the archives, enter the following commands:

tar -xvzf hadoop-2.7.3.tar.gz
tar -xvzf apache-hive-1.2.1-bin.tar.gz
1
2

# Further amend the bashrc file. You'll need to identify the path to where the archives were unpacked. If using the Windows Subsystem for Linux, and you followed the steps exactly, your path would be /mnt/c/Users/user/, where user is your user name.

# Open the file: nano ~/.bashrc

# Modify the commands below with the appropriate path and then enter them at the end of the bashrc file:

export HADOOP_HOME=/path_where_the_archives_were_unpacked/hadoop-2.7.3
export HIVE_HOME=/path_where_the_archives_were_unpacked/apache-hive-1.2.1-bin
PATH=$PATH:$HIVE_HOME/bin
1
2
3

# Then press Ctrl+X, then Y, then enter.

# Close and then reopen you bash session.

# Test your connection. Use the connection format from Over public or private endpoints, above.

Last Updated: 12/26/2022, 11:54:10 AM