milvus的二进制文件集群部署
本文使用二进制文件进行milvus集群的部署,非docker,非k8s部署。
环境说明
操作系统:Ubuntu 22.04.3
milvus版本:v2.4.10
获取二进制文件
由于官方提供的是docker文件,因此我们可以把容器里面的二进制文件及其它库文件拷贝出来。
从dockerfile文件可以窥探出。
dockerfile
# Copyright (C) 2019-2022 Zilliz. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under the License.
FROM ubuntu:jammy-20240530
ARG TARGETARCH
RUN apt-get update && \
apt-get install -y --no-install-recommends curl ca-certificates libaio-dev libgomp1 libopenblas-dev && \
apt-get remove --purge -y && \
rm -rf /var/lib/apt/lists/*
COPY --chown=root:root --chmod=774 ./bin/ /milvus/bin/
COPY --chown=root:root --chmod=774 ./configs/ /milvus/configs/
COPY --chown=root:root --chmod=774 ./lib/ /milvus/lib/
ENV PATH=/milvus/bin:$PATH
ENV LD_LIBRARY_PATH=/milvus/lib:$LD_LIBRARY_PATH:/usr/lib
ENV LD_PRELOAD=/milvus/lib/libjemalloc.so
ENV MALLOC_CONF=background_thread:true
# Add Tini
ADD https://github.com/krallin/tini/releases/download/v0.19.0/tini-$TARGETARCH /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]
WORKDIR /milvus/
从dockerfile可以看出来,我们只需要安装依赖的包,把对应文件拷贝出来即可。
部署二进制
将容器里的/milvus文件夹打包拷贝出来。
shell
docker cp milvus-standalone:/milvus .
安装依赖:
apt-get install --no-install-recommends curl ca-certificates libaio-dev libgomp1 libopenblas-dev
设置环境变量:
vi .bashrc
export LD_PRELOAD=/opt/milvus/lib/libjemalloc.so
export LD_LIBRARY_PATH=/opt/milvus/lib::/usr/lib
export MALLOC_CONF=background_thread:true
运行milvus文件验证:
bin/milvus --help
如果不报错,即配置正确。
部署etcd、pulsar、minio、attu
这3个服务,我们还是以docker形式进行部署。
具体如何部署,参考以前的文章。