没有关注的小伙伴可以在微信搜索框中搜索微信公众号:
3分钟秒懂大数据,然后点击关注,回复 Hive SQL总结 即可免费领取Hive SQL总结(大数据学习18)全部文档!!!
一. HIVE启动的两种方式 :1 直接启动 2 Hive thrift服务
1 Hive 直接启动: 找寻你所安装的hive文件下的hive驱动 我的驱动是在 apps/apache-hive-1.2.1-bin/hive 下 执行驱动就可以将hive启动起来
[hadoop@mini1 ~]$ cd apps/apache-hive-1.2.1-bin/
[hadoop@mini1 apache-hive-1.2.1-bin]$ bin/hive
2 Hive thrift服务: 将hive作为一个服务器,通过另一个节点用beeline去连接 具体操作如下:
[hadoop@mini1 ~]$ cd apps/apache-hive-1.2.1-bin/
[hadoop@mini1 apache-hive-1.2.1-bin]$ bin/hiveserver2 //先作为服务器启动
重新开一个mini1窗口
[hadoop@mini1 ~]$ cd apps/apache-hive-1.2.1-bin/
[hadoop@mini1 apache-hive-1.2.1-bin]$ bin/beeline //先启动beeline节点,然后在连接你启动的hive服务器
// 当进去beeline节点后执行下面操作
beeline> !connect jdbc:hive2://localhost:10000
Connecting to jdbc:hive2://localhost:10000
Enter username for jdbc:hive2://localhost:10000: hadoop //该账号为你登录的服务器用户名
Enter password for jdbc:hive2://localhost:10000: ****** //密码为服务器密码