小编Shr*_*kar的帖子

Blob download_as_string Google容器引擎上的SSL错误

我在Google Container Engine上运行了一个容器.在这个容器里面,我有一些python代码试图从托管的Google云存储中读取一个blob.

代码很简单:

from google.cloud import storage

gs = storage.Client(project="my-shiny-project")
gc_bucket = gs.get_bucket("my-bucket")
blob = gc_bucket.get_blob("my-blob")
print blob.download_as_string()
Run Code Online (Sandbox Code Playgroud)

上面的代码在我的本地机器上运行正常.但是,当我在GKE上的Docker容器中运行它时,创建blob对象的部分工作得很好.但是,对download_as_string的调用失败了:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/google/cloud/storage/blob.py", line 453, in download_as_string
    self.download_to_file(string_buffer, client=client)
  File "/usr/lib/python2.7/site-packages/google/cloud/storage/blob.py", line 412, in download_to_file
    self._do_download(transport, file_obj, download_url, headers)
  File "/usr/lib/python2.7/site-packages/google/cloud/storage/blob.py", line 363, in _do_download
    response = download.consume(transport)
  File "/usr/lib/python2.7/site-packages/google/resumable_media/download.py", line 136, in consume
    transport, u'GET', self.media_url, headers=headers)
  File "/usr/lib/python2.7/site-packages/google/resumable_media/_helpers.py", line 134, in http_request
    return transport.request(method, url, data=data, headers=headers)
  File …
Run Code Online (Sandbox Code Playgroud)

python google-cloud-storage google-kubernetes-engine

6
推荐指数
1
解决办法
398
查看次数

Apache Kafka:降低“request.timeout.ms”会导致元数据获取失败?

我有一个 9 个代理、5 个节点的 Zookeeper Kafka 设置。

为了减少报告失败的时间,我们将其设置request.timeout.ms为 3000。但是,通过此设置,我观察到一些奇怪的行为。

有时,我会看到客户端(生产者)收到错误: org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.

这种情况并不总是发生。有些生产商工作得很好。

当我提高该request.timeout.ms值时,我没有看到任何错误。

知道为什么降低request.timeout.ms会导致元数据获取超时吗?

apache-kafka

5
推荐指数
0
解决办法
2254
查看次数