When access a gpfdist external table, it may report error :
=# select * from table_name;
NOTICE: External scan from gpfdist(s) server will utilize 64 out of 96 segment databases
ERROR: http response code 503 from gpfdist (gpfdist://hostname:1234/filename.csv): HTTP/1.1 503 Service Unavailable (seg1 slice1 xxx.xxx.xxx.xxx:1234 pid=121212)
Use curl command to check the connection :
curl -iv -H "X-GP-VERSION:6" http://hostname:1234/filename_ext.csv
* Uses proxy env variable no_proxy == 'localhost,127.0.0.1,abc.com'
* Uses proxy env variable http_proxy == 'http://abc.com:8080'
* Trying 172.xxx.xxx.xxx...
* TCP_NODELAY set
* Connected to proxy abc.com (172.xxx.xxx.xxx) port 8080 (#0)
> GET http://hostname:1234/filename.csv HTTP/1.1
> Host: hostname:1234
> User-Agent: curl/7.61.1
> Accept: */*
> Proxy-Connection: Keep-Alive
> X-GP-VERSION:6
>
< HTTP/1.1 404 Not Found
HTTP/1.1 404 Not Found
< Cache-Control: no-cache
Cache-Control: no-cache
< X-XSS-Protection: 1
X-XSS-Protection: 1
< Connection: Keep-Alive
Connection: Keep-Alive
< Content-Type: text/html; charset=utf-8
Content-Type: text/html; charset=utf-8
< Content-Length: 790
Content-Length: 790
< Pragma: no-cache
Pragma: no-cache
<
<HTML><HEAD>
<TITLE>Network Error</TITLE>
</HEAD>
<BODY>
<FONT face="Helvetica">
<big><strong></strong></big><BR>
</FONT>
<blockquote>
<TABLE border=0 cellPadding=1 width="80%">
<TR><TD>
<FONT face="Helvetica">
<big>Network Error (dns_unresolved_hostname)</big>
<BR>
<BR>
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
Your requested host "hostname" could not be resolved by DNS.
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
</FONT>
gpdb 6.x, 7.x
This issue is caused by an improper setup proxy server running on both greenplum server side and gpfdist host. When use below command to verify, it's working fine.
curl --noproxy "*" -iv -H "X-GP-PROTO: 1" http://hostname:1234/filename.csv
To avoid this error, it required either properly setup proxy server, or disabled proxy service from all hosts. For best performance, it's better NOT use proxy between gpdb host and gpfdist server host.