Could not open client transport with JDBC Uri: jdbc:hive2://node03:10000: java.net.ConnectException:

启动beeline连接hive报错:

Could not open client transport with JDBC Uri: jdbc:hive2://node03:10000: java.net.ConnectException:Could not open client transport with JDBC Uri: jdbc:hive2://node03:10000: java.net.ConnectException:

原因是hiveserver2没有启动起来

beeline连接hive命令(注意我的节点名node03,其他人可能根据自己设置的不同):!connect jdbc:hive2://node03:10000

启动hiveserver2命令:hive --service hiveserver2

Could not open client transport with JDBC Uri: jdbc:hive2://node03:10000: java.net.ConnectException:

你以为这样就结束了吗?

Could not open client transport with JDBC Uri: jdbc:hive2://node03:10000: java.net.ConnectException:

but此时输入用户名,又被拒绝连接了(Excuse me?此处脑补表情包)

后来用jps命令查看:看此时启动beeline的那台服务器是不是两个RunJar(一个RunJar是metastore(元数据),一个RunJar是hiveserver2)

Could not open client transport with JDBC Uri: jdbc:hive2://node03:10000: java.net.ConnectException:

如果是三个用kill -9 (进程号) 全部杀死 然后

启动MySQL((1)service mysqld start   (2)mysql -uroot -p******)

启动yarn(start-yarn.sh)只在一台上启动 (备注一下启动yarn(start-yarn.sh)和启动hdfs (start-dfs.sh)是由于hive的原因启动)

启动hive     cd /export/servers/hive  或  cd /export/servers/apache-hive-2.1.1-bin

                   启动元数据 nohup bin/hive --service metastore &                                 (用 cat nohup.out 命令查看启动日志有无报错)

                   启动hiveserver2 nohup bin/hive --service hiveserver2 &                      (用 cat nohup.out 命令查看启动日志有无报错)

Could not open client transport with JDBC Uri: jdbc:hive2://node03:10000: java.net.ConnectException:

最后终于启动成功了(罪魁祸首是MySQL没启动QWQ)

温馨提示:

查看hdfs启动没(start-dfs.sh)

查看yarn启动没(start-yarn.sh)

查看元数据启动没(nohup bin/hive --service metastore &)(和hive,beeline在同一台服务器node03启动)

查看hiveserver2启动没(nohup bin/hive --service metastore &)(和hive,beeline在同一台服务器node03启动)

查看MySQL启动没((1)service mysqld start      (2)mysql -uroot -p******)(和hive,beeline在同一台服务器node03启动)

(ps:查看进程命令 ps -ef | grep (名字)                 杀死进程命令 kill -9 (进程号)             查看启动元数据(metastore),hiveserver2启动日志cat nohup.out))