社区微信群开通啦,扫一扫抢先加入社区官方微信群
社区微信群
Linux需要连接远程Hive,可以使用beeline。
一、确保服务器已经安装配置了java环境;
二、下载hadoop和hive相关的包
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
三、解压步骤二中下载的包:
tar -xvzf hadoop-2.7.3.tar.gz
tar -xvzf apache-hive-1.2.1-bin.tar.gz
四、配置hadoop和hive的环境变量:
vim /etc/profile
加入内容:
export HADOOP_HOME=/你的路径/hadoop-2.7.3
export HIVE_HOME=/你的路径/apache-hive-1.2.1-bin
PATH=$PATH:$HIVE_HOME/bin
使配置的环境变量生效
source /etc/profile
五、通过beeline连接hive
进入beeline工具
beeline
输入连接信息
!connect jdbc:hive2://ip:端口 用户名 密码
连接成功
即可执行hive相关的sql
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!