【问题标题】:Connecting to Milvus Database through Google Kubernetes Engine and Python通过 Google Kubernetes Engine 和 Python 连接 Milvus 数据库
【发布时间】:2022-03-27 21:30:52
【问题描述】:

我希望连接到我在 Google Kubernetes Engine 上部署的 Milvus database

我在脚本的最后一行遇到了错误。我在本地运行脚本。

这是我设置 GKE 集群的过程:(https://milvus.io/docs/v2.0.0/gcp.md)

这里是a similar question我正在画画

对我缺少什么有什么想法吗?

import os
from pymilvus import connections
from kubernetes import client, config

My_Kubernetes_IP = 'XX.XXX.XX.XX'

# Authenticate with GCP credentials
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = os.path.abspath('credentials.json')

# load milvus config file and connect to GKE instance 
config = client.Configuration(os.path.abspath('milvus/config.yaml'))
config.host = f'https://{My_Kubernetes_IP}:19530'
client.Configuration.set_default(config)

## connect to milvus
milvus_ip = 'xx.xxx.xx.xx'
connections.connect(host=milvus_ip, port= '19530')

错误:

BaseException:

【问题讨论】:

    标签: python authentication kubernetes google-cloud-platform google-kubernetes-engine


    【解决方案1】:

    如果你想通过ip+port连接到k8s集群中的Milvus,你可能需要将你本地的19530端口转发给Milvus服务。使用如下命令:

    $ kubectl 端口转发服务/my-release-milvus 19530

    【讨论】:

      【解决方案2】:

      你查过你的 milvus 外网 IP 在哪里吗?

      按照文档中的说明,您应该使用kubectl get services 来检查为 milvus 分配的外部 IP。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-04-12
        • 2019-03-09
        • 2021-09-22
        • 1970-01-01
        • 1970-01-01
        • 2018-04-28
        • 2013-11-09
        • 1970-01-01
        相关资源
        最近更新 更多