use*_*129 6 python python-3.x minio
我安装了本地 minio 存储:
wget https://dl.min.io/server/minio/release/linux-amd64/minio
chmod +x minio
./minio server /home/myuser/minio_storage --console-address ":5050"
Run Code Online (Sandbox Code Playgroud)
我正在尝试连接并创建新存储桶:
client = Minio("127.0.0.1:5050")
found = client.bucket_exists("my_bucket")
if not found:
client.make_bucket("my_bucket")
else:
print("Bucket 'my_bucket' already exists")
Run Code Online (Sandbox Code Playgroud)
我收到错误:
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='127.0.0.1', port=5050): Max retries exceeded with url: /my_buket (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:852)'
Run Code Online (Sandbox Code Playgroud)
我需要做什么才能创建新存储桶?
Bri*_*ham 11
您已在未启用 TLS 的情况下启动 minio 服务,因此该服务在端口 上的 HTTP 协议上运行5050。
因此,您还需要使用文档secure=False中的选项告诉客户端使用 HTTP 进行连接
client = Minio("127.0.0.1:5050", secure=False)
Run Code Online (Sandbox Code Playgroud)
或者将服务器配置为使用 TLS 运行,这是更好的选项,也有记录。