mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
convert hostname to ip to avoid pymilvus dns domain name parse bug
This commit is contained in:
parent
d4fb05688a
commit
63d3372b4c
@ -43,7 +43,7 @@ class Server:
|
||||
ip = socket.gethostbyname(url.hostname)
|
||||
socket.inet_pton(socket.AF_INET, ip)
|
||||
self.conn_mgr.register('WOSERVER',
|
||||
'{}://{}:{}'.format(url.scheme, ip, url.port))
|
||||
'{}://{}:{}'.format(url.scheme, ip, url.port or 80))
|
||||
|
||||
def register_pre_run_handler(self, func):
|
||||
logger.info('Regiterring {} into server pre_run_handlers'.format(func))
|
||||
|
||||
@ -2,6 +2,7 @@ import os, sys
|
||||
if __name__ == '__main__':
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
import socket
|
||||
from utils import singleton
|
||||
from sd import ProviderManager
|
||||
|
||||
@ -15,7 +16,7 @@ class KubernetesProvider(object):
|
||||
NAME = 'Static'
|
||||
def __init__(self, settings, conn_mgr, **kwargs):
|
||||
self.conn_mgr = conn_mgr
|
||||
self.hosts = settings.hosts
|
||||
self.hosts = [socket.gethostbyname(host) for host in settings.hosts]
|
||||
|
||||
def start(self):
|
||||
for host in self.hosts:
|
||||
|
||||
28
start_services.yml
Normal file
28
start_services.yml
Normal file
@ -0,0 +1,28 @@
|
||||
version: "2.3"
|
||||
services:
|
||||
milvus:
|
||||
runtime: nvidia
|
||||
restart: always
|
||||
image: registry.zilliz.com/milvus/engine:branch-0.4.0-release-c58ca6
|
||||
# ports:
|
||||
# - "0.0.0.0:19530:19530"
|
||||
volumes:
|
||||
- /tmp/milvus/db:/opt/milvus/db
|
||||
|
||||
mishards:
|
||||
restart: always
|
||||
image: registry.zilliz.com/milvus/mishards:v0.0.2
|
||||
ports:
|
||||
- "0.0.0.0:19530:19531"
|
||||
- "0.0.0.0:19532:19532"
|
||||
volumes:
|
||||
- /tmp/milvus/db:/tmp/milvus/db
|
||||
- /tmp/mishards_env:/source/mishards/.env
|
||||
command: ["python", "mishards/main.py"]
|
||||
environment:
|
||||
DEBUG: 'true'
|
||||
SERVER_PORT: 19531
|
||||
WOSERVER: tcp://milvus:19530
|
||||
SD_STATIC_HOSTS: milvus
|
||||
depends_on:
|
||||
- milvus
|
||||
Loading…
x
Reference in New Issue
Block a user