用户客户端连接:
1)jdbc|odbc
2)hiveserver2 远程 其他节点连接hive
将hive的服务端启动 启动为后台服务
通过指定的工具 在任意节点上连接hive jdbc
配置:
hive底层的数据存在hdfs的
客户端连接hive的时候 连接hdfs hdfs需要开启连接权限的
1)修改hdfs的配置文件 修改的hadoop的连接权限
1)hdfs-site.xml $hadoop_home/etc/hadoop
dfs.webhdfs.enabled
true
2)core-site.xml
<property>
<!-- 配置hdfs允许哪些外部主机连接 第二个hadoop代表的是连接的用户名(安装hive的普通用户名) -->
<name>hadoop.proxyuser.hadoop.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.hadoop.groups</name>
<value>*</value>
</property>
3)远程发送 上面两个配置文件 到其他hadoop节点
scp core-site.xml hdfs-site.xml hdp02:/home/hadoop/apps/hadoop/etc/hadoop/
scp core-site.xml hdfs-site.xml hdp01:/home/hadoop/apps/hadoop/etc/hadoop/
2)重启hadoop
start-dfs.sh
start-yarn.sh
yarn-daemon.sh start resourcemanager
3)启动hive的服务端
hiveserver2
4)使用 beeline连接工具去连接hive
beeline — navicate
使用hive安装包中自带的
将hive的安装的二进制包远程发送到hdp02上
scp apache-hive-2.3.2-bin.tar.gz hdp02:/home/hadoop/hive_tool
解压
远程连接
启动beeline
./beeline
beeline> hive 连接的url
jdbc:mysql://localhost:3306
!connect jdbc:hive2://hdp03:10000
Enter username for jdbc:hive2://hdp03:10000: 安装hive的用户名 hadoop
Enter password for jdbc:hive2://hdp03:10000: 安装hive的普通用户的密码 123456
0: jdbc:hive2://hdp03:10000> 连接成功
-----hive>