我使用新操作符在Kubernetes上部署了Minio:
helm repo add minio https://operator.min.io/
helm install --namespace minio-operator --create-namespace --generate-name minio/minio-operator
kubectl apply -f https://raw.githubusercontent.com/minio/operator/master/examples/tenant-tiny.yaml
sudo -E kubefwd svc
Port-Forward: 127.1.27.1 minio:80 to pod minio-ss-0-0:9000
Port-Forward: 127.1.27.2 minio-hl:9000 to pod minio-ss-0-0:9000
Port-Forward: 127.1.27.3 minio-ss-0-0.minio-hl:9000 to pod minio-ss-0-0:9000租户正在工作,我可以在minio:80和minio-hl:9000访问web控制台。
我想从集群外部访问存储(运行在Docker上的朱庇特笔记本);这是我收到错误"ConnectionRefusedError: Errno 111连接被拒绝“的地方:
def main():
client = Minio(
"minio:80", #minio-hl:9000 leads to the same error
access_key="minio",
secret_key="minio123!",
secure=False
)
found = client.bucket_exists("posts")
if not found:
client.make_bucket("posts")
print("Bucket 'posts' created")
else:
print("Bucket 'posts' already exists")我也尝试过用s3a jars编写读取器,但是连接挂起了很长时间,最后收到了类似的错误。
有人能帮帮我吗?非常感谢!
发布于 2022-03-22 13:13:24
希望现在提供以下信息还为时不晚:
首先,确保您可以在端口转发之后访问该服务.然后尝试使用minio客户机来做类似的事情。
实际上,我最近和你们有类似的问题,通过使用自定义http客户端,经过双倍确认服务在端口转发后是可访问的,最终解决了问题。
from minio import Minio
from minio.error import InvalidResponseError
import urllib3
def main():
httpClient = urllib3.PoolManager(
cert_reqs="CERT_NONE")
client = Minio('my-domain:443',
access_key='xxxxx',
secret_key='xxxxx',
http_client=httpClient
)
try:
objects = client.list_objects('bucket_name', prefix='/', recursive=True)
for obj in objects:
print(obj.bucket_name)
except InvalidResponseError as err:
print("error", err)https://stackoverflow.com/questions/67431835
复制相似问题