网络科技公司网站建设,关键词挖掘站网,久就建筑网,免费推广店铺的网站目录
1.修改 core-site.xml 和 hive-site.xml 的配置文件
2.启动HiveServer2服务
3.启动Beeline工具连接Hiveserver2服务
4.利用IDEA工具连接Hiveserver2服务
完成Hive本地模式安装后#xff0c;可以启动hiveserver2服务进行远程连接和操作Hive。
1.修改 core-site.xml …目录
1.修改 core-site.xml 和 hive-site.xml 的配置文件
2.启动HiveServer2服务
3.启动Beeline工具连接Hiveserver2服务
4.利用IDEA工具连接Hiveserver2服务
完成Hive本地模式安装后可以启动hiveserver2服务进行远程连接和操作Hive。
1.修改 core-site.xml 和 hive-site.xml 的配置文件
修改core-site.xml
[rootmaster ~]# cd /opt/module/hadoop-3.1.3/etc/hadoop
[rootmaster hadoop]#vi core-site.xml 在文件/configuration标签上方加入以下内容
property namehadoop.proxyuser.root.hosts/name value*/value /property property namehadoop.proxyuser.root.groups/name value*/value /property
将更改的配置文件分发给slave1、slave2主机
[rootmaster hadoop]# scp core-site.xml slave1:/opt/module/hadoop-3.1.3/etc/hadoop/
[rootmaster hadoop]# scp core-site.xml slave2:/opt/module/hadoop-3.1.3/etc/hadoop/
修改hive-site.xml
[rootmaster hadoop]# cd /opt/module/hive/conf/
[rootmaster conf]# vi hive-site.xml 在文件/configuration标签上方加入以下内容
!-- 指定 hiveserver2 连接的 host -- property namehive.server2.thrift.bind.host/name valuemaster/value /property
!-- 指定 hiveserver2 连接的端口号 -- property namehive.server2.thrift.port/name value10000/value /property
2.启动HiveServer2服务 后台启动HiveServer2服务
[rootmaster conf]#hive --service hiveserver2 后台启动metastore服务
[rootmaster conf]# hive --service metastore
关闭服务 kill -9 进程号
3.启动Beeline工具连接Hiveserver2服务
可以打开一个master主机新窗口,输入以下命令
[rootmaster conf]# beeline
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/module/hive/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/module/hadoop-3.1.3/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Beeline version 3.1.2 by Apache Hive
beeline !connect jdbc:hive2://master:10000 -n root -p 123456
Connected to: Apache Hive (version 3.1.2)
Driver: Hive JDBC (version 3.1.2)
Transaction isolation: TRANSACTION_REPEATABLE_READ
0: jdbc:hive2://master:10000
输入!quit命令可以断开Hiveserver2服务
4.利用IDEA工具连接Hiveserver2服务
启动IDEA软件打开任何一个项目即可。
点击右侧Database菜单项配置Apache HiveDriver。 测试连接是否成功