步骤1:node1启动metastore和hiveserver2
----------在node1启动metastore,并在后台运行,可通过jps查看是否成功----------
nohup /export/servers/apache-hive-3.1.2-bin/bin/hive --service metastore &
----------在node1启动hiveserver2服务----------
nohup /export/servers/apache-hive-3.1.2-bin/bin/hive --service hiveserver2 &
步骤2:连接node1的hiveserver2,node1以外机器通过hiveserver2访问metastore,无需配置
----------在node1以外机器启动hiveserver2-beeline,无需配置hive-site.xml----------
/export/servers/apache-hive-3.1.2-bin/bin/beeline
----------通过beeline连接node1 ----------
! connect jdbc:hive2://node1:10000
---如果报错,User: root is not allowed to impersonate root (state=08S01,code=0),
则需要在hadoop文件下的etc/hadoop/core-site.xml加入如下配置项,表示允许root用户在不同的客户端上