问题:

sqoop从postgresql拉数据,在执行到mapreduce时报错Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections

问题定位过程:

1、postgresql 5432端口已开放,执行任务的节点能telnet通,并且netcat测试通过

2、sqoop list-tables命令可正常执行,sqoop import报错Connection refused. Check that the hostname and port are correct and that the 

3、从其它服务器集群跑同样脚本正常

解决:

集群中有node不能访问5432,sqoop import命令一定要集群中所有起nodemanager服务的节点有访问数据库端口的权限,所以保证所有节点访问5432后解决

备注:

sqoop list-tables能执行就说明肯定不是postgresql端的问题,sqoop list-tables执行命令的这台服务器能访问5432即可

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐