开发者社区 > 大数据与机器学习 > 大数据计算 MaxCompute > 正文

大数据计算MaxCompute建立了网络连接 但是ECS那边是不是还得加白名单啊?

大数据计算MaxCompute建立了网络连接 但是ECS那边是不是还得加白名单啊 现在运行pyodps还是报超时的错误 无法建立连接什么的?Tunnel session created:

Traceback (most recent call last):
File "/home/tops/lib/python3.7/site-packages/urllib3/connection.py", line 175, in _new_conn
(self._dns_host, self.port), self.timeout, extra_kw
File "/home/tops/lib/python3.7/site-packages/urllib3/util/connection.py", line 95, in create_connection
raise err
File "/home/tops/lib/python3.7/site-packages/urllib3/util/connection.py", line 85, in create_connection
sock.connect(sa)
TimeoutError: [Errno 110] Connection timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/tops/lib/python3.7/site-packages/urllib3/connectionpool.py", line 710, in urlopen
chunked=chunked,
File "/home/tops/lib/python3.7/site-packages/urllib3/connectionpool.py", line 386, in _make_request
self._validate_conn(conn)
File "/home/tops/lib/python3.7/site-packages/urllib3/connectionpool.py", line 1042, in _validate_conn
conn.connect()
File "/home/tops/lib/python3.7/site-packages/urllib3/connection.py", line 358, in connect
self.sock = conn = self._new_conn()
File "/home/tops/lib/python3.7/site-packages/urllib3/connection.py", line 187, in _new_conn
self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 110] Connection timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/tops/lib/python3.7/site-packages/requests/adapters.py", line 499, in send
timeout=timeout,
File "/home/tops/lib/python3.7/site-packages/urllib3/connectionpool.py", line 788, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/home/tops/lib/python3.7/site-packages/urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='t-cdd.myvecid.cn', port=443): Max retries exceeded with url: /dbb-server/open/googlesheet/data_channel/1759760968784678913 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 110] Connection timed out'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 37, in
post_data(url, secret, result_dict)
File "", line 17, in post_data
response = requests.request( "POST", url, headers=header, data=payload )
File "/home/tops/lib/python3.7/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url,
kwargs)
File "/home/tops/lib/python3.7/site-packages/requests/sessions.py", line 587, in request
resp = self.send(prep, send_kwargs)
File "/home/tops/lib/python3.7/site-packages/requests/sessions.py", line 701, in send
r = adapter.send(request,
kwargs)
File "/home/tops/lib/python3.7/site-packages/requests/adapters.py", line 565, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='t-cdd.myvecid.cn', port=443): Max retries exceeded with url: /dbb-server/open/googlesheet/data_channel/1759760968784678913 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 110] Connection timed out'))
WARNING:pyodps.pyodpswrapper:
遇到请求超时错误时,可以尝试下面的方法:
from odps import options
options.connect_timeout = 1200 # 修改连接超时,默认为 120
options.read_timeout = 1200 # 修改读数据超时,默认为 120

展开
收起
真的很搞笑 2024-02-25 08:11:37 74 0
2 条回答
写回答
取消 提交回答
  • 面对过去,不要迷离;面对未来,不必彷徨;活在今天,你只要把自己完全展示给别人看。

    根据您提供的错误信息,连接超时可能是由于网络不稳定或服务器响应时间过长导致的。您可以尝试以下方法来解决这个问题:

    1. 增加连接超时时间:在您的代码中,将连接超时时间设置为一个更大的值,例如300秒(5分钟)。这可以给服务器更多的时间来响应请求。

    2. 检查网络连接:确保您的计算机与MaxCompute服务之间的网络连接正常。您可以尝试使用其他网络连接或重启网络设备来解决问题。

    3. 联系服务提供商:如果问题仍然存在,建议您联系MaxCompute的技术支持团队,向他们报告问题并寻求进一步的帮助。他们可能会提供更多关于连接问题的诊断和解决方案。

    请注意,具体的解决方法可能因您的环境和配置而异。以上建议仅供参考,您可能需要根据实际情况进行调整和尝试。

    2024-02-25 18:45:54
    赞同 展开评论 打赏
  • ecs绑定的安全组,和networklink里的安全组一致吗?PyODPS代码里有没有加参数:set odps.session.networklink=testLink;
    https://help.aliyun.com/zh/maxcompute/user-guide/sql?spm=a2c4g.11186623.0.i6#section-ntm-54m-cfb
    image.png
    ,此回答整理自钉群“MaxCompute开发者社区2群”

    2024-02-25 12:59:06
    赞同 展开评论 打赏

MaxCompute(原ODPS)是一项面向分析的大数据计算服务,它以Serverless架构提供快速、全托管的在线数据仓库服务,消除传统数据平台在资源扩展性和弹性方面的限制,最小化用户运维投入,使您经济并高效的分析处理海量数据。

相关产品

  • 云原生大数据计算服务 MaxCompute
  • 相关电子书

    更多
    如何运维千台以上游戏云服务器 立即下载
    网站/服务器取证 实践与挑战 立即下载
    ECS快储存加密技术 立即下载