实际上,我有一个要求,我想使用storage.googleapis.com中的特定主机来创建存储客户端。当我们从storage.googleapis.com获取主机时,我们将获得约10-12个不同的远程IP。我想创建客户端或在特定主机集上调用客户端方法,例如10-12中的我想拥有5-6个主机,我想在上创建客户端。
ips = socket.gethostbyname_ex("storage.googleapis.com")
>> ['172.253.62.128', '172.253.115.128', '172.253.122.128', '17......]
在上面的数组中,我想使用特定的IP来制作存储客户端。有关 172.253.62.128
的示例。
我不确定是否可能。我要做的是,如果在任何一个案例中,IP在我们的结局中都列入黑名单,我们希望在新主机上创建一个存储客户端,并希望避免最后一个黑名单的IP。
在创建存储客户端时,有一个选项可以传递 endpoint
。但这看起来没有帮助,因为我发现桶没有发现错误。
注意:我正在使用Ruby应用程序。
查看以下红宝石文档:
I actually have a requirement where I want to create the storage client using particular hosts from storage.googleapis.com. When we fetch hosts from storage.googleapis.com we get around 10-12 different remote Ips. I want to create client or call the client methods on particular set of hosts like out of 10-12 I want to have 5-6 hosts on which I would like to create client.
ips = socket.gethostbyname_ex("storage.googleapis.com")
>> ['172.253.62.128', '172.253.115.128', '172.253.122.128', '17......]
Out of the above array I want to use particular Ip to make a storage client. For an example on 172.253.62.128
.
I am not sure if this is possible. What I am trying to do is if in anycase a Ip is blacklisted on our end we want to create a storage client on new host and want to avoid the last blacklisted Ip.
There is an option to pass an endpoint
while creating storage client. But it doesn't look helpful as i get bucket not found error.
Note: I am using ruby application.
Look at the following ruby documentation:
https://googleapis.dev/ruby/google-cloud-storage/latest/Google/Cloud/Storage.html#new-class_method
发布评论