启动metastore
①前台启动
/export/server/apache-hive-3.1.2-bin/bin/hive --service metastore
关闭:ctrl+c
②后台启动
nohup /export/server/apache-hive-3.1.2-bin/bin/hive --service metastore &
关闭
kill -9 编号
开启hadoop
start-all.sh
启动hive2
nohup /export/server/apache-hive-3.1.2-bin/bin/hive --service metastore &
nohup /export/server/apache-hive-3.1.2-bin/bin/hive --service hiveserver2 &
/export/server/apache-hive-3.1.2-bin/bin/hive(加载完之后按 ctrl + c)
/export/server/apache-hive-3.1.2-bin/bin/beeline
! connect jdbc:hive2://node1:10000
(注意一次一行)
如果在IDEA连接的时候,root⽤户因为为权限问题不能登录,要在 Hadoop 的 core-site.xml中加上下列部分:
<property>
<name>hadoop.proxyuser.root.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.root.groups</name>
<value>*</value>
</property>
接下来就可以像操作mysql一样写sql操作hive