diff --git a/content/docs-lite/zh/docs/DataVec/DataVec-integrations.md b/content/docs-lite/zh/docs/DataVec/DataVec-integrations.md index 4da53f3e118cb8e9a3e507e4bb5f28e06ccec7b9..d13b3a65a22a9721512e5b88e6632b26731da923 100644 --- a/content/docs-lite/zh/docs/DataVec/DataVec-integrations.md +++ b/content/docs-lite/zh/docs/DataVec/DataVec-integrations.md @@ -6,17 +6,21 @@ openGauss DataVec提供多种第三方组件的集成教程,并通过多语言 - [Dify](dify.md) - [AnythingLLM](anythingllm.md) -## 向量数据迁移 -- [从Milvus迁移至openGauss DataVec](milvus2datavec.md) -- 从Pgvector迁移至openGauss DataVec -- 从ElasticSearch迁移至openGauss DataVec - ## 嵌入模型 - [BGE-M3](embedding-bgem3.md) - [Nomic-Embed-Text](embedding-nomic.md) +## 数据迁移 +- [从Milvus迁移至openGauss DataVec](milvus2datavec.md) +- 从PgVector迁移至openGauss DataVec +- 从ElasticSearch迁移至openGauss DataVec + ## API Reference - [Python](integrationPython.md) - [Java](integrationJava.md) - [Node.js](integrationJavaScript.md) - [Go](integrationGo.md) + +## 性能测试 +- [VectorDBBench](openGauss-VectorDBBench.md) +- [AnnBenchmark](testtool_annbenchmark.md) \ No newline at end of file diff --git a/content/docs-lite/zh/docs/DataVec/figures/EmbedDify.png b/content/docs-lite/zh/docs/DataVec/figures/EmbedDify.png index 5aa6118eb7afe7bd40eda82aefde5eb536693159..40340ba49709b347bdd69ef9b18635c77a90c119 100644 Binary files a/content/docs-lite/zh/docs/DataVec/figures/EmbedDify.png and b/content/docs-lite/zh/docs/DataVec/figures/EmbedDify.png differ diff --git a/content/docs-lite/zh/docs/DataVec/figures/LLMDify.png b/content/docs-lite/zh/docs/DataVec/figures/LLMDify.png index 8481b2235ee51817709daac070ef28d96da78c6c..dc8ef7b5f957158915ca277a32d418d9d80ac759 100644 Binary files a/content/docs-lite/zh/docs/DataVec/figures/LLMDify.png and b/content/docs-lite/zh/docs/DataVec/figures/LLMDify.png differ diff --git a/content/docs-lite/zh/docs/DataVec/figures/OpenAIPlugin.png b/content/docs-lite/zh/docs/DataVec/figures/OpenAIPlugin.png new file mode 100644 index 0000000000000000000000000000000000000000..0073d74c14bba851b47a420d7c53387aaf40c5a7 Binary files /dev/null and b/content/docs-lite/zh/docs/DataVec/figures/OpenAIPlugin.png differ diff --git a/content/docs-lite/zh/docs/DataVec/figures/SaveCorpus.png b/content/docs-lite/zh/docs/DataVec/figures/SaveCorpus.png index b3f69146e81e690fd76733d7308680349368b654..6b67e55d289ff0f7aeac12e748cb88f8c01f0554 100644 Binary files a/content/docs-lite/zh/docs/DataVec/figures/SaveCorpus.png and b/content/docs-lite/zh/docs/DataVec/figures/SaveCorpus.png differ diff --git a/content/docs-lite/zh/docs/DataVec/openGauss-Dify.md b/content/docs-lite/zh/docs/DataVec/openGauss-Dify.md index 0bbd62bdcdf8f3ddac681a8632aab651e7a24f13..67b21abe86c38452cee984a707d80f2f93165a09 100644 --- a/content/docs-lite/zh/docs/DataVec/openGauss-Dify.md +++ b/content/docs-lite/zh/docs/DataVec/openGauss-Dify.md @@ -46,9 +46,9 @@ http://your_server_ip ![](./figures/LoginDify.png) ### 接入大模型 -在主界面点击右上角用户名,然后点击“设置”进入设置页面,单击“模型供应商”,选择“Ollama”单击“安装”按钮。(ollama服务及大模型部署参考:[openGauss-RAG实践](openGauss-RAG实践.md)) +在主界面点击右上角用户名,然后点击“设置”进入设置页面,单击“模型供应商”,选择“OpenAI”单击“安装”按钮。(大模型及嵌入模型部署采用昇腾解决方案参考:[MindIE-DeepSeek-R1-Distill-Qwen-7B模型部署](https://modelers.cn/models/MindIE/DeepSeek-R1-Distill-Qwen-7B)、[mis-tei-embedding部署](https://www.hiascend.com/developer/ascendhub/detail/07a016975cc341f3a5ae131f2b52399d)) -![](./figures/OllamaPlugin.png) +![](./figures/OpenAIPlugin.png) 安装完成后,在添加模型页面,“模型类型”选择“LLM”,配置如下: diff --git "a/content/docs-lite/zh/docs/DataVec/openGauss-RAG\345\256\236\350\267\265.md" "b/content/docs-lite/zh/docs/DataVec/openGauss-RAG\345\256\236\350\267\265.md" index d17fe1d57348697af5b88e81fa5cb1b11b719e55..bc19ac6f335d296d9973828b94c81e038f02eae6 100644 --- "a/content/docs-lite/zh/docs/DataVec/openGauss-RAG\345\256\236\350\267\265.md" +++ "b/content/docs-lite/zh/docs/DataVec/openGauss-RAG\345\256\236\350\267\265.md" @@ -35,19 +35,19 @@ RAG (Retrieval-Augmented Generation,检索增强生成): 一种将信息检索 ### 安装Ollama服务 首先,我们需要下载 ollama 的 pypi 包,以便后续访问 ollama 服务: -```abap +```shell [test@localhost ~]$ pip3 install ollama ``` 然后,我们可以使用官网提供的一键式部署脚本来部署 ollama 服务: -```abap +```shell curl -fsSL https://ollama.com/install.sh | sh ``` 如果遇到网络问题无法直接安装,我们可以考虑采用手动方案: -```abap +```shell [test@localhost ~]$ wget https://ollama.com/download/ollama-linux-amd64.tgz [test@localhost ~]$ tar -zxvf ollama-linux-amd64.tgz -C /usr/ [test@localhost ~]$ which ollama @@ -58,7 +58,7 @@ curl -fsSL https://ollama.com/install.sh | sh 安装成功后,我们可以启动 ollama 服务: -```abap +```shell [test@localhost ~]$ ollama serve & ``` @@ -67,12 +67,12 @@ curl -fsSL https://ollama.com/install.sh | sh **deepseek-r1** 模型是基于先进的深度学习技术开发的,它具有独特的架构和训练方式,能够更好地捕捉文本中的语义信息,从而为文本生成带来更出色的效果。同时,我们选用**nomic-embed-text**模型用于嵌入任务,该模型能够将文本转换为高维向量表示,为后续的检索和匹配提供了强有力的支持。二者协同工作,共同助力我们基于DeepSeek与openGauss打造的本地AI知识库,使其能够更高效、更精准地为用户提供服务。 -```abap +```shell [test@localhost ~]$ ollama --version ollama version is 0.5.6 ``` -```abap +```shell [test@localhost ~]$ ollama pull deepseek-r1 [test@localhost ~]$ ollama pull nomic-embed-text ``` @@ -82,21 +82,21 @@ ollama version is 0.5.6 ### 下载依赖 首先,我们需要下载 psycopg2 依赖: -```abap +```shell [test@localhost ~]$ pip3 install psycopg2 ``` ### 获取镜像 通过如下命令获取 openGauss 镜像: -```abap +```shell [root@localhost ~]$ docker pull opengauss/opengauss:7.0.0-RC1 ``` ### 启动服务 镜像拉取完成后,我们可以启动openGauss服务: -```abap +```shell [root@localhost ~]$ docker run --name opengauss --privileged=true -d -e GS_PASSWORD=****** -p 8888:5432 -v /home/test/opengauss:/var/lib/opengauss opengauss/opengauss:7.0.0-RC1 ``` diff --git a/content/docs-lite/zh/docs/DataVec/openGauss-VectorDBBench.md b/content/docs-lite/zh/docs/DataVec/openGauss-VectorDBBench.md new file mode 100644 index 0000000000000000000000000000000000000000..3ff2714d5e15f7bd239edc76f8434a91af079a37 --- /dev/null +++ b/content/docs-lite/zh/docs/DataVec/openGauss-VectorDBBench.md @@ -0,0 +1,104 @@ +# 使用VectorDBBench工具性能测试 +VectorDBBench 是一款开源向量数据库基准测试工具,主要通过测量关键指标来衡量向量数据库的性能。 +本文介绍如何使用VectorDBBench工具对openGauss中Datavec向量引擎进行性能测试。 + +### 安装python3 +推荐安装Python3.11以上版本 +```bash +wget --no-check-certificate https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tar.xz +tar -xvf Python-3.11.0.tar.xz +cd Python-3.11.0 + +# 为用户自定义的python安装路径 +./configure --prefix= --enable-optimizations +make -j; make install +``` +设置python3环境变量 +```bash +vim ~/.bashrc +export PATH=/bin:$PATH +source ~/.bashrc +``` +### 安装vectordb-bench +```bash +pip3 install vectordb-bench[all] +``` +替换适配opengauss的vectordb-bench文件夹 +```bash +# 下载适配opengauss的vectordb-bench:https://github.com/wlff123/VectorDBBench.git +cp -r vectordb_bench /lib/python3.11/site-packages/ +``` +### 数据集下载 +VectorDBBench工具执行测试时,会根据选择的数据集自行从网络下载,也可以手动下载。 +```bash +# cohere1m数据集下载示例 +wget https://assets.zilliz.com/benchmark/cohere_medium_1m/test.parquet --no-check-certificate +wget https://assets.zilliz.com/benchmark/cohere_medium_1m/neighbors.parquet --no-check-certificate +wget https://assets.zilliz.com/benchmark/cohere_medium_1m/shuffle_train.parquet --no-check-certificate +``` +### 配置openGauss数据库参数 +按照测试需求对数据库节点目录下postgresql.conf文件中影响性能的关键参数配置: +```bash +max_connections = 1000 # 多并发测试时此值应大于并发连接数 +shared_buffers = 16GB # 机器内存足够时,建议此值大于数据集大小 +enable_indexscan = on # 开启索引扫描 +enable_seqscan = off # 关闭全表扫描 +``` +### 性能测试 +建议使用vectordbbench命令行执行测试,可以根据测试需求灵活调整测试参数。 +```bash +# 修改数据集路径 +# vi /lib/python3.11/site-packages/vectordb_bench/__init__.py +DATASET_LOCAL_DIR = '' + +# 本地机器如果不能从网络下载数据集,执行测试可能会报错,此时可以屏蔽掉下载数据集的相关代码 +# vi /lib/python3.11/site-packages/vectordb_bench/backend/data_source.py +class AwsS3Reader(DatasetReader): + # ... + def read(self, dataset: str, files: list[str], local_ds_root: pathlib.Path): + downloads = [] + # ... + else: + for file in files: + remote_file = pathlib.PurePosixPath(self.remote_root, dataset, file) + local_file = local_ds_root.joinpath(file) + # 此处屏蔽下载数据集的代码 + # if (not local_file.exists()) or (not self.validate_file(remote_file, local_file)): + # log.info(f"local file: {local_file} not match with remote: {remote_file}; add to downloading list") + # downloads.append(remote_file) +``` +测试命令示例 +```bash +# vectordbbench opengausshnsw --case-type --k --concurrency-duration --num-concurrency --user-name --password --host --port --db-name -m --ef-construction --ef-search +# ALGORITHM 测试用例类型 +# DATASET 测试用例数据集 +# TOPK 查询最近邻结果数量 +# DURATION 查询持续时间(秒) +# CONCURRENCY_NUM 并发数量 +# USERNAME 数据库用户名 +# PASSWORD 数据库密码 +# HOST 数据库ip地址 +# PORT 数据库端口 +# M hnsw索引构建参数 +# EF_CONSTRUCTION hnsw索引构建参数 +# EF_SEARCH hnsw索引搜索参数 + +# 详细参数说明可以执行命令查看帮助 +vectordbbench opengausshnsw --help +vectordbbench opengausshnswpq --help + +# hnsw索引测试命令 +vectordbbench opengausshnsw --case-type Performance768D1M --k 10 --concurrency-duration 60 --num-concurrency 1 --user-name gaussdb --password YourPassword --host 127.0.0.1 --port 5432 --db-name postgres -m 16 --ef-construction 200 --ef-search 200 +# hnswpq索引测试命令 +vectordbbench opengausshnswpq --pq_m 96 --hnsw_earlystop_threshold 160 --case-type Performance768D1M --k 10 --concurrency-duration 60 --num-concurrency 1 --user-name gaussdb --password YourPassword --host 127.0.0.1 --port 5432 --db-name postgres -m 16 --ef-construction 200 --ef-search 200 +``` +执行测试命令后,会在当前终端中打印测试执行过程和结果 +```bash +# 测试结果示例说明 +... INFO: Performance case got result: Metric(max_load_count=0, load_duration=xxx, qps=xxx, serial_latency_p99=xxx, recall=xxx, ndcg=xxx, conc_num_list=xxx, conc_qps_list=xxx, conc_latency_p99_list=xxx, conc_latency_avg_list=xxx)... +# load_duration 导入数据和构建索引的总时间 +# qps 吞吐量 +# serial_latency_p99 单并发查询p99时延 +# recall 召回率 +# conc_latency_p99_list 多并发查询p99时延 +``` diff --git a/content/docs-lite/zh/docs/DataVec/testtool_annbenchmark.md b/content/docs-lite/zh/docs/DataVec/testtool_annbenchmark.md new file mode 100644 index 0000000000000000000000000000000000000000..3c1d828e00e51cd10ec0c85334653aeabd816598 --- /dev/null +++ b/content/docs-lite/zh/docs/DataVec/testtool_annbenchmark.md @@ -0,0 +1,110 @@ +# 向量分析性能测试-AnnBenchmark + +## 1. 准备工作 +### 测试环境 +- 安装python>=3.8.6 +- 下载适配openGauss数据库的ann-benchmark性能测试工具。下载链接:[ann-benchmarks-openGauss](https://github.com/lauraty123/ann-benchmarks-openGauss) +- 安装测试工具所需的依赖包`pip3 install -r requirements.txt` +- 部署openGauss-DataVec容器实例,教程可参考[openGauss-DataVec容器镜像安装](../InstallationGuide/容器镜像安装.md) +### 测试数据 +| Dataset | Dimensions | Train size | Test size | Neighbors | Distance | Download | +| ----------------------------------------------------------------- | ---------: | ---------: | --------: | --------: | --------- | -------------------------------------------------------------------------- | +| [DEEP1B](http://sites.skoltech.ru/compvision/noimi/) | 96 | 9,990,000 | 10,000 | 100 | Angular | [HDF5](http://ann-benchmarks.com/deep-image-96-angular.hdf5) (3.6GB) +| [Fashion-MNIST](https://github.com/zalandoresearch/fashion-mnist) | 784 | 60,000 | 10,000 | 100 | Euclidean | [HDF5](http://ann-benchmarks.com/fashion-mnist-784-euclidean.hdf5) (217MB) | +| [GIST](http://corpus-texmex.irisa.fr/) | 960 | 1,000,000 | 1,000 | 100 | Euclidean | [HDF5](http://ann-benchmarks.com/gist-960-euclidean.hdf5) (3.6GB) | +| [GloVe](http://nlp.stanford.edu/projects/glove/) | 25 | 1,183,514 | 10,000 | 100 | Angular | [HDF5](http://ann-benchmarks.com/glove-25-angular.hdf5) (121MB) | +| GloVe | 50 | 1,183,514 | 10,000 | 100 | Angular | [HDF5](http://ann-benchmarks.com/glove-50-angular.hdf5) (235MB) | +| GloVe | 100 | 1,183,514 | 10,000 | 100 | Angular | [HDF5](http://ann-benchmarks.com/glove-100-angular.hdf5) (463MB) | +| GloVe | 200 | 1,183,514 | 10,000 | 100 | Angular | [HDF5](http://ann-benchmarks.com/glove-200-angular.hdf5) (918MB) | +| [Kosarak](http://fimi.uantwerpen.be/data/) | 27,983 | 74,962 | 500 | 100 | Jaccard | [HDF5](http://ann-benchmarks.com/kosarak-jaccard.hdf5) (33MB) | +| [MNIST](http://yann.lecun.com/exdb/mnist/) | 784 | 60,000 | 10,000 | 100 | Euclidean | [HDF5](http://ann-benchmarks.com/mnist-784-euclidean.hdf5) (217MB) | +| [MovieLens-10M](https://grouplens.org/datasets/movielens/10m/) | 65,134 | 69,363 | 500 | 100 | Jaccard | [HDF5](http://ann-benchmarks.com/movielens10m-jaccard.hdf5) (63MB) | +| [NYTimes](https://archive.ics.uci.edu/ml/datasets/bag+of+words) | 256 | 290,000 | 10,000 | 100 | Angular | [HDF5](http://ann-benchmarks.com/nytimes-256-angular.hdf5) (301MB) | +| [SIFT](http://corpus-texmex.irisa.fr/) | 128 | 1,000,000 | 10,000 | 100 | Euclidean | [HDF5](http://ann-benchmarks.com/sift-128-euclidean.hdf5) (501MB) | +| [Last.fm](https://github.com/erikbern/ann-benchmarks/pull/91) | 65 | 292,385 | 50,000 | 100 | Angular | [HDF5](http://ann-benchmarks.com/lastfm-64-dot.hdf5) (135MB) | +| [COCO-I2I](https://cocodataset.org/) | 512 | 113,287 | 10,000 | 100 | Angular | [HDF5](https://github.com/fabiocarrara/str-encoders/releases/download/v0.1.3/coco-i2i-512-angular.hdf5) (136MB) | +| [COCO-T2I](https://cocodataset.org/) | 512 | 113,287 | 10,000 | 100 | Angular | [HDF5](https://github.com/fabiocarrara/str-encoders/releases/download/v0.1.3/coco-t2i-512-angular.hdf5) (136MB) | + +> 注:
+> 数据集位置:置放路径为/ann-benchmarks-openGauss/data,需要先`mkdir data`
+> 数据集下载:可以直接通过`wget`下载,例如:`wget http://ann-benchmarks.com/glove-50-angular.hdf5 --no-check-certificate` + +## 2. 测试流程 +### 数据库配置 +容器内的配置文件路径: +``` +/var/lib/opengauss/data/postgresql.conf +``` +推荐配置参数: +``` +shared_buffers=50GB #推荐大于数据库和索引的总和 +maintenance_work_mem=4GB +password_encryption_type=1 +max_connections=1000 #最大连接数 +``` +有关具体参数的修改,请参考 **[GUC参数说明](../DatabaseReference/GUC参数说明.md)** +### ann-benchmark配置 +修改`go_opgs.sh`中的数据库连接配置 +```bash +export ANN_BENCHMARKS_OG_USER='YourUserName' +export ANN_BENCHMARKS_OG_PASSWORD='YourPassword' +export ANN_BENCHMARKS_OG_DBNAME='YourDBName' +export ANN_BENCHMARKS_OG_HOST='YourHost' +export ANN_BENCHMARKS_OG_PORT=YourPort +``` +修改ann-benchmarks-openGauss/ann_benchmarks/algorithms/openGauss/config.yml中构建索引、索引查询相关参数(按需) +```bash + - base_args: ['@metric'] + constructor: openGaussHNSW + disabled: false + docker_tag: ann-benchmarks-openGauss + module: ann_benchmarks.algorithms.openGauss + name: openGauss-hnsw + run_groups: + M-16: + arg_groups: [{M: 16, efConstruction: 200}] + args: {} + query_args: [[10, 20, 40, 80, 120, 200, 400, 800]] + M-24: + arg_groups: [{M: 24, efConstruction: 200}] + args: {} + query_args: [[10, 20, 40, 80, 120, 200, 400, 800]] +``` +- name: 近似搜索算法名 +- run_groups: 索引构建和索引查询参数设置,这里的arg_groups设置的是hnsw索引构建参数m和efconstruction,query_args则是hnsw索引查询参数ef_search。 + +### 执行测试 +修改`go_opgs.sh`中的启动命令 +```bash +python3 run.py --algorithm openGauss-hnsw --dataset fashion-mnist-784-euclidean --local --runs 1 -k 10 --batch +``` +- --algorithm 算法名,这里的算法名来源于ann-benchmarks-openGauss/ann_benchmarks/algorithms/openGauss/config.yml的name字段,目前支持openGauss-hnsw、openGauss-hnswpq、openGauss-ivfflat。 +- --dataset 数据集名称,支持的数据集见准备工作的测试数据章节。 +- -- runs 执行测试集次数 +- --k topk数目 +- --batch 如果加入该参数,可以开启向量数据的并发查询 + +开启测试 +```bash +sh go_opgs.sh +``` + +> 注:
+> 若已经执行过同组测试,需要重命名或删除`ann-benchmarks-openGauss/results///`下对应的文件,否则会直接跳过改组测试。 + +## 3. 测试结果 +### 输出html可互动网页 +```bash +python3 create_website.py --outputdir --scatter --recompute +``` + +### 输出数据表格 +```bash +python3 data_export.py --out <结果文件名>.csv +``` + +测试结果说明: +- k-nn:准确率 +- qps:吞吐量 +- p99:p99时延 +- build:构建索引耗时 diff --git "a/content/docs-lite/zh/docs/SQLReference/\350\236\215\345\220\210\346\237\245\350\257\242\344\275\277\347\224\250\346\214\207\345\215\227.md" "b/content/docs-lite/zh/docs/SQLReference/\350\236\215\345\220\210\346\237\245\350\257\242\344\275\277\347\224\250\346\214\207\345\215\227.md" index fa609c9a6159c5343554131c21e50984e1034d9f..4812430e628f43bcad6065f8bd15b6df24fb6bc9 100644 --- "a/content/docs-lite/zh/docs/SQLReference/\350\236\215\345\220\210\346\237\245\350\257\242\344\275\277\347\224\250\346\214\207\345\215\227.md" +++ "b/content/docs-lite/zh/docs/SQLReference/\350\236\215\345\220\210\346\237\245\350\257\242\344\275\277\347\224\250\346\214\207\345\215\227.md" @@ -2,125 +2,7 @@ 本章节主要介绍openGauss中DataVec向量引擎的融合查询使用指导。 ## 1. 安装部署 -使用Docker实现openGauss搭载DataVec的容器化部署,简化DevOps用户的安装、配置和环境设置。 - -### 容器架构和操作系统版本支持 - -opengauss-datavec 镜像支持以下架构和操作系统版本: - -- **x86-64 openEuler 20.03 LTS**: -```bash -$ docker pull swr.cn-north-4.myhuaweicloud.com/opengauss-x86-64/opengauss-datavec:latest -``` - -- **ARM64 openEuler 20.03 LTS**: -```bash -$ docker pull swr.cn-north-4.myhuaweicloud.com/opengauss-aarch64/opengauss-datavec:latest -``` - -### 验证镜像状态 -成功拉取镜像后,查看镜像状态: -```bash -$ docker images -``` - -输出示例: -``` -REPOSITORY TAG IMAGE ID CREATED SIZE -swr.cn-north-4.myhuaweicloud.com/opengauss-aarch64/opengauss-datavec latest 5be9d4f1ca12 2 hours ago 1.02GB -``` - -### 修改镜像名称 -使用`docker tag`命令更改镜像名称或标签: -```bash -$ docker tag swr.cn-north-4.myhuaweicloud.com/opengauss-aarch64/opengauss-datavec:latest opengauss-datavec:latest -``` - -### 启动实例 -以`openGauss-datavec latest` 版本为例,以下命令将启动数据库并映射宿主机的端口到容器: -```bash -$ docker run --name opengauss --privileged=true -d -e GS_PASSWORD=YourPassoword -p 8888:5432 opengauss-datavec:latest -``` - -#### 启动参数 -- `--name opengauss`:为容器命名为`opengauss` -- `--privileged=true`: 授予容器特权模式 -- `-d`: 以后台模式运行容器 -- `-p 8888:5432`: 将容器的5432端口映射到宿主机的8888端口 - -##### 必选容器内环境变量 -- `-e GS_PASSWORD=YourPassoword`:设置数据库超级用户`omm`密码 - -使用 openGauss 镜像的时候,必须设置该参数,且不能为空或未定义。该参数用于设置 openGauss 数据库的超级用户`omm`。安装过程中将默认创建omm超级用户,该用户名目前无法更改。 - -openGauss 镜像配置了本地信任机制,因此在容器内连接数据库时无需密码,但若从容器外部(其它主机或者容器)连接,则必须要输入密码。 - -###### **密码要求** - -- 密码长度必须至少为8个字符。 -- 必须同时包含大写字母、小写字母、数字、以及特殊符号。 -- 支持的特殊符号仅包含`\#?!@$%^&\*-`(其中`!$&`需使用转义符号”\“)。 - -##### 可选容器内环境变量 -- `-e GS_NODENAME=YourNodeName`:指定数据库节点名称,默认为`gaussdb` -- `-e GS_USERNAME=YourUserName`:指定数据库连接用户名,默认为测试用户`gaussdb` -- `-e GS_USER_PASSWORD=YourUserPassword`:指定用户`$GS_USERNAME`密码,默认为`$GS_PASSWORD` -- `-e GS_PORT=YourPort`:指定容器内数据库端口,默认为`5432` -- `-e GS_DB=YourDbName`:在容器内创建数据库,默认为`postgres` - -### 验证容器状态 -查看运行中的容器: -```bash -$ docker ps -``` -输出示例: -``` -CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -7abc538f242a opengauss-datavec:latest "entrypoint.sh gauss…" About a minute ago Up About a minute 0.0.0.0:8888->5432/tcp opengauss -``` - -### 连接数据库 - -#### 容器内部连接数据库 - -进入容器: -``` -$ docker exec -it bash -``` - -登录`omm`超级用户: -``` -$ su omm -$ gsql -d postgres -p 5432 -``` - -#### 从宿主机连接数据库 - -宿主机可以通过以下命令连接数据库(需安装`gsql`客户端): -```shell -$ gsql -d postgres -U gaussdb -W YourPassoword -h your-host-ip -p 8888 -``` - -### 数据持久化 - -通过以下命令,将宿主机的`/opengauss`目录挂载到容器的`/var/lib/opengauss`目录,实现数据的持久化存储: -```bash -$ docker run --name opengauss --privileged=true -d -e GS_PASSWORD=YourPassoword -v /opengauss:/var/lib/opengauss opengauss-datavec:latest -``` - -### 参数配置 -容器内的配置文件路径: -``` -/var/lib/opengauss/data/postgresql.conf -``` - -修改完配置文件后,请使用以下命令重启容器以使更改生效: -```bash -docker restart -``` -若在容器外配置参数,需要挂载宿主机路径到容器内部的`/var/lib/opengauss`目录。 - -有关具体参数的修改,请参考 **[GUC参数说明](../DatabaseReference/GUC参数说明.md)** +使用Docker实现openGauss搭载DataVec的容器化部署,简化DevOps用户的安装、配置和环境设置,参考 [容器镜像安装](../InstallationGuide/容器镜像安装.md)。 ## 2. 融合查询 数据源类型通常是多样化的,包含结构化数据(如文本、数字等)和非结构化数据(如视频、图片、音频等)。为了有效存储和检索不同类型的数据,融合查询结合了结构化过滤和非结构化检索的技术,使用户在同一查询中使用不同的数据类型和查询方法,以获取更为精确的非结构化数据。openGauss集成了结构化数据和非结构化数据融合查询的能力。 diff --git a/content/docs-lite/zh/menu/index.md b/content/docs-lite/zh/menu/index.md index de2fc08ce2f42f64c6a059e72ce68e02b1dd2c9e..93c6fa639d0413454688119c1b2cf65b7cd8d992 100644 --- a/content/docs-lite/zh/menu/index.md +++ b/content/docs-lite/zh/menu/index.md @@ -162,7 +162,7 @@ headless: true - [使用openGauss]({{< relref "./docs/GettingStarted/使用openGauss.md" >}}) - [安装指南]({{< relref "./docs/InstallationGuide/Installation.md" >}}) - [安装概述]({{< relref "./docs/InstallationGuide/安装概述.md" >}}) - - [向量数据库容器镜像安装]({{< relref "./docs/InstallationGuide/容器镜像安装.md" >}}) + - [容器镜像安装]({{< relref "./docs/InstallationGuide/容器镜像安装.md" >}}) - [安装准备]({{< relref "./docs/InstallationGuide/安装准备.md" >}}) - [获取安装包]({{< relref "./docs/InstallationGuide/获取安装包.md" >}}) - [准备软硬件安装环境]({{< relref "./docs/InstallationGuide/准备软硬件安装环境.md" >}}) @@ -628,12 +628,21 @@ headless: true - [向量存储引擎]({{< relref "./docs/DataVec/DataVec-architecture.md" >}}) - [PQ]({{< relref "./docs/DataVec/PQ.md" >}}) - [工具编排使用]({{< relref "./docs/DataVec/DataVec-integrations.md" >}}) - - [使用openGauss部署Dify]({{< relref "./docs/DataVec/dify.md" >}}) - - [使用openGauss部署AnythingLLM]({{< relref "./docs/DataVec/anythingllm.md" >}}) - - [从Milvus迁移至openGauss DataVec]({{< relref "./docs/DataVec/milvus2datavec.md" >}}) - - [Python SDK对接向量数据库]({{< relref "./docs/DataVec/integrationPython.md" >}}) - - [Java SDK对接向量数据库]({{< relref "./docs/DataVec/integrationJava.md" >}}) - - [Go SDK对接向量数据库]({{< relref "./docs/DataVec/integrationGo.md" >}}) + - 编排组件 + - [Dify]({{< relref "./docs/DataVec/dify.md" >}}) + - [AnythingLLM]({{< relref "./docs/DataVec/anythingllm.md" >}}) + - 嵌入模型 + - [BGE-M3]({{< relref "./docs/DataVec/embedding-bgem3.md" >}}) + - [Nomic]({{< relref "./docs/DataVec/embedding-nomic.md" >}}) + - 数据迁移 + - [从Milvus迁移至openGauss DataVec]({{< relref "./docs/DataVec/milvus2datavec.md" >}}) + - API Reference + - [Python SDK]({{< relref "./docs/DataVec/integrationPython.md" >}}) + - [Java SDK]({{< relref "./docs/DataVec/integrationJava.md" >}}) + - [Node.js SDK]({{< relref "./docs/DataVec/integrationJavaScript.md" >}}) + - [Go SDK]({{< relref "./docs/DataVec/integrationGo.md" >}}) + - 性能测试 + - [VectorDBBench]({{< relref "./docs/DataVec/openGauss-VectorDBBench.md" >}}) - [教程案例指导]({{< relref "./docs/DataVec/DataVec-tutorials.md" >}}) - [打破AI黑盒,拥抱开源力量:基于openGauss+DeepSeek的本地知识库,打造你的专属AI助手!]({{< relref "./docs/DataVec/openGauss-RAG实践.md" >}}) - [openGauss Datavec + Dify,快速搭建你的智能助手平台]({{< relref "./docs/DataVec/openGauss-Dify.md" >}}) diff --git "a/content/zh/docs/AboutopenGauss/Postgresql_openGauss\350\277\201\347\247\273\345\267\245\345\205\267debezium-connector-postgres.md" "b/content/zh/docs/AboutopenGauss/Postgresql_openGauss\350\277\201\347\247\273\345\267\245\345\205\267debezium-connector-postgres.md" index ed576f15f4a46b109d5ee30b8d9d51489fc163b7..2cb4478a6ac0942cee9e246fc110f466ef86abd7 100644 --- "a/content/zh/docs/AboutopenGauss/Postgresql_openGauss\350\277\201\347\247\273\345\267\245\345\205\267debezium-connector-postgres.md" +++ "b/content/zh/docs/AboutopenGauss/Postgresql_openGauss\350\277\201\347\247\273\345\267\245\345\205\267debezium-connector-postgres.md" @@ -6,19 +6,19 @@ ## 特性简介 -debezium-connector-postgres工具是一个基于Java语言的Postgresql到openGauss的复制工具。该工具提供了初始全量数据及对象(视图、触发器、函数、存储过程)的复制能力,可实现数据及对象从Postgresql迁移至openGauss。对于数据的全量迁移,支持Postgresql中各种数据类型的迁移,同时对于Postgresql中的浮点数据类型,包括decimal、numeric、double precision、real数据类型,可保证迁移后数据精度不丢失。 +debezium-connector-postgres工具是一个基于Java语言的Postgresql到openGauss的复制工具。该工具提供了初始全量数据及对象(视图、触发器、函数、存储过程)和增量数据(DML)的复制能力,可实现数据及对象从Postgresql迁移至openGauss。对于数据的全量迁移,支持Postgresql中各种数据类型的迁移,同时对于Postgresql中的浮点数据类型,包括decimal、numeric、double precision、real数据类型,可保证迁移后数据精度不丢失。对于数据的增量迁移,可以将Postgresql数据迁移期间(包括全量和增量迁移)产生的数据迁移至openGauss端。 ## 客户价值 -通过使用debezium-connector-postgres工具,可完成数据从Postgresql搬迁至openGauss数据库。基于sysbench测试模型,2路鲲鹏920 CPU、openEuler操作系统下,Postgresql数据库20张表(无索引)单表数据量在500万以上时,gs_mysync使用20并发迁移数据至openGauss,整体全量迁移性能可达300M/s以上。 +通过使用debezium-connector-postgres工具,可完成数据从Postgresql搬迁至openGauss数据库。基于sysbench测试模型,2路鲲鹏920 CPU、openEuler操作系统下,Postgresql数据库20张表(无索引)单表数据量在500万以上时,gs_mysync使用20并发迁移数据至openGauss,整体全量迁移性能可达300M/s以上。增量迁移按表回放,针对混合IUD场景,50张表50个线程(insert-30线程,update-10线程,delete-10线程),性能可达3w tps。 ## 特性描述 -debezium-connector-postgres工具提供数据全量复制功能,使得数据可以从Postgresql迁移至openGauss数据库。对于数据的全量迁移,debezium-connector-postgres工具中存储了Postgresql数据类型与openGauss数据类型之间的映射关系,可支持Postgresql中各种数据类型的迁移。 +debezium-connector-postgres工具提供数据全量和增量复制功能,使得数据可以从Postgresql迁移至openGauss数据库。debezium-connector-postgres工具中存储了Postgresql数据类型与openGauss数据类型之间的映射关系,可支持Postgresql中各种数据类型的迁移。 debezium-connector-postgres工具支持在指定版本和架构的系统(包括CentOS7、openEuler20.03、openEuler22.03系统版本,x86_64和aarch64架构)上进行离线安装,无需连接外部网络。 -debezium-connector-postgres工具采用debezium connector结构,source端使用pgjdbc驱动查询postgresql数据库并导出数据至csv文件中,sink端使用ogjdbc驱动将csv文件导入至openGauss数据库。数据复制过程中,debezium-connector-postgres工具会针对不同的类型进行相应的转换。 +debezium-connector-postgres工具采用debezium connector结构,全量迁移时,source端使用pgjdbc驱动查询postgresql数据库并导出数据至csv文件中,sink端使用ogjdbc驱动将csv文件导入至openGauss数据库。增量迁移时,source端将数据推送至指定topic下,同时sink端配置topics为合并后的topic,用于从kafka抽取数据,从而可保证事务的顺序。数据复制过程中,debezium-connector-postgres工具会针对不同的类型进行相应的转换。 ## 特性约束 @@ -31,6 +31,6 @@ debezium-connector-postgres工具依赖kafka、zookeeper和schema-registry三方 ## 参考文档 -debezium-connector-postgres详细说明和使用文档参考:debezium-connector-postgres.md +debezium-connector-postgres详细说明和使用文档参考:debezium-connector-postgres.md diff --git a/content/zh/docs/DataVec/DataVec-Overview.md b/content/zh/docs/DataVec/DataVec-Overview.md index ed685312a0f4d8b70742a10d362bfde219ae0d31..9cf43cdd83721c984ed0819d2ff3f49f6e1ee094 100644 --- a/content/zh/docs/DataVec/DataVec-Overview.md +++ b/content/zh/docs/DataVec/DataVec-Overview.md @@ -4,7 +4,7 @@ openGauss DataVec 向量数据库是一个基于openGauss的向量引擎, 提 DataVec目前支持的向量功能有:精确和近似的最近邻搜索、L2距离&余弦距离&内积、向量索引、向量操作函数和操作符。作为openGauss的内核特性,DataVec使用熟悉的SQL语法操作向量,简化了用户使用向量数据库的过程。 ## 快速部署指南 -DataVec向量数据库可通过[容器镜像安装](../InstallationGuide/容器镜像安装.md)快速部署,并快速对接大模型,打造本地RAG智能问答服务。 +DataVec向量数据库可通过[容器镜像安装](../../../docs-lite/zh/docs/InstallationGuide/容器镜像安装.md)快速部署,并快速对接大模型,打造本地RAG智能问答服务。 ## 特性描述 diff --git a/content/zh/docs/DataVec/DataVec-integrations.md b/content/zh/docs/DataVec/DataVec-integrations.md index abe23f3bc16d45b132962cce1723f08186c9458c..09f592a254985b79beed78382a801b692b43290c 100644 --- a/content/zh/docs/DataVec/DataVec-integrations.md +++ b/content/zh/docs/DataVec/DataVec-integrations.md @@ -4,20 +4,24 @@ openGauss DataVec提供多种第三方组件的集成教程,并通过多语言 ## 编排第三方组件 - [Dify](dify.md) -- [AnythingLLM](./anythingllm.md) - -## 向量数据迁移 -- [从Milvus迁移至openGauss DataVec](milvus2datavec.md) -- 从Pgvector迁移至openGauss DataVec -- 从ElasticSearch迁移至openGauss DataVec +- [AnythingLLM](anythingllm.md) ## 嵌入模型 - [BGE-M3](embedding-bgem3.md) - [Nomic-Embed-Text](embedding-nomic.md) +## 数据迁移 +- [从Milvus迁移至openGauss DataVec](milvus2datavec.md) +- [从PgVector迁移至openGauss DataVec](../AboutopenGauss/Postgresql_openGauss迁移工具debezium-connector-postgres.md) +- 从ElasticSearch迁移至openGauss DataVec + ## API Reference - [Python](integrationPython.md) - [Java](integrationJava.md) - [Node.js](integrationJavaScript.md) - [Go](integrationGo.md) +## 性能测试 +- [VectorDBBench](openGauss-VectorDBBench.md) +- [AnnBenchmark](testtool_annbenchmark.md) + diff --git a/content/zh/docs/DataVec/DataVec-quickstart.md b/content/zh/docs/DataVec/DataVec-quickstart.md index 59788b38e0d1de513b56c7d95fbd2b02dcadfa87..c29f4e1be1a1a519e83834834926f592a8947757 100644 --- a/content/zh/docs/DataVec/DataVec-quickstart.md +++ b/content/zh/docs/DataVec/DataVec-quickstart.md @@ -1,7 +1,7 @@ # 向量数据库快速入门 ## 快速部署 -详见[容器镜像安装](../InstallationGuide/容器镜像安装.md)。 +详见[容器镜像安装](../../../docs-lite/zh/docs/InstallationGuide/容器镜像安装.md)。 ## 创建向量表 diff --git a/content/zh/docs/DataVec/embedding-bgem3.md b/content/zh/docs/DataVec/embedding-bgem3.md index 507c103d48248be86a008361836fa9966c8e49ff..94060558d868b21cdc02cc1adf7b939e1c03b1fe 100644 --- a/content/zh/docs/DataVec/embedding-bgem3.md +++ b/content/zh/docs/DataVec/embedding-bgem3.md @@ -1,7 +1,7 @@ # 使用BGE M3和openGauss DataVec进行向量生成与存储 [BGE M3](https://huggingface.co/BAAI/bge-m3)是一款由BAAI开发的多语言高性能文本嵌入模型,能够将文本转化为语义丰富的高维向量表示。本文将围绕BGE M3和向量数据库openGauss DataVec,介绍如何实现文本向量生成与高效存储。通过这两个工具的结合,能够构建更加智能化的数据检索和处理系统。 -注:openGauss DataVec容器化部署详见[链接](../InstallationGuide/容器镜像安装.md)。 +注:openGauss DataVec容器化部署详见[链接](../../../docs-lite/zh/docs/InstallationGuide/容器镜像安装.md)。 ## 案例一: FlagEmbedding + openGauss DataVec ### 环境准备 - 安装依赖包 diff --git a/content/zh/docs/DataVec/embedding-nomic.md b/content/zh/docs/DataVec/embedding-nomic.md index 82551a15774803cad3ec841bfe7dfdfca8174c87..4821262fe12e4e4ae10f6aac2a6c397f70351894 100644 --- a/content/zh/docs/DataVec/embedding-nomic.md +++ b/content/zh/docs/DataVec/embedding-nomic.md @@ -1,7 +1,7 @@ # 使用nomic-embed-text和openGauss DataVec进行向量化搜索 nomic-embed-text是一个专门用于文本转化为高维向量表示的高性能嵌入模型,本文将介绍如何通过nomic-embed-text和openGauss DataVec轻松实现从文本到向量的转化,并基于语义的相似性快速进行搜索操作。 -注:openGauss DataVec容器化部署详见[链接](../InstallationGuide/容器镜像安装.md)。 +注:openGauss DataVec容器化部署详见[链接](../../../docs-lite/zh/docs/InstallationGuide/容器镜像安装.md)。 ## 环境准备 - 加载模型 diff --git a/content/zh/docs/DataVec/figures/EmbedDify.png b/content/zh/docs/DataVec/figures/EmbedDify.png index 5aa6118eb7afe7bd40eda82aefde5eb536693159..40340ba49709b347bdd69ef9b18635c77a90c119 100644 Binary files a/content/zh/docs/DataVec/figures/EmbedDify.png and b/content/zh/docs/DataVec/figures/EmbedDify.png differ diff --git a/content/zh/docs/DataVec/figures/LLMDify.png b/content/zh/docs/DataVec/figures/LLMDify.png index 8481b2235ee51817709daac070ef28d96da78c6c..dc8ef7b5f957158915ca277a32d418d9d80ac759 100644 Binary files a/content/zh/docs/DataVec/figures/LLMDify.png and b/content/zh/docs/DataVec/figures/LLMDify.png differ diff --git a/content/zh/docs/DataVec/figures/OpenAIPlugin.png b/content/zh/docs/DataVec/figures/OpenAIPlugin.png new file mode 100644 index 0000000000000000000000000000000000000000..0073d74c14bba851b47a420d7c53387aaf40c5a7 Binary files /dev/null and b/content/zh/docs/DataVec/figures/OpenAIPlugin.png differ diff --git a/content/zh/docs/DataVec/figures/SaveCorpus.png b/content/zh/docs/DataVec/figures/SaveCorpus.png index b3f69146e81e690fd76733d7308680349368b654..6b67e55d289ff0f7aeac12e748cb88f8c01f0554 100644 Binary files a/content/zh/docs/DataVec/figures/SaveCorpus.png and b/content/zh/docs/DataVec/figures/SaveCorpus.png differ diff --git a/content/zh/docs/DataVec/integrationGo.md b/content/zh/docs/DataVec/integrationGo.md index fa09700d415b246f9206f234c79afdba5303c676..ca43ce57c685738ddf558e7108788c3761d2821a 100644 --- a/content/zh/docs/DataVec/integrationGo.md +++ b/content/zh/docs/DataVec/integrationGo.md @@ -3,7 +3,7 @@ ## 环境要求 - 安装Go 1.19及以上版本。 -- openGauss数据库安装部署 [容器镜像安装](../InstallationGuide/容器镜像安装.md)。 +- openGauss数据库安装部署 [容器镜像安装](../../../docs-lite/zh/docs/InstallationGuide/容器镜像安装.md)。 ## 安装SDK 开发者可以运行以下命令安装Go SDK[官方仓库](http://gitee.com/opengauss/openGauss-connector-go-pq),并在项目中导入该包。 diff --git a/content/zh/docs/DataVec/milvus2datavec.md b/content/zh/docs/DataVec/milvus2datavec.md index e53d9a14dea082a6bafa337a9789deeb13944e0d..2d5a40dc15fc847c9d1f85bf96b1b9441c71ff00 100644 --- a/content/zh/docs/DataVec/milvus2datavec.md +++ b/content/zh/docs/DataVec/milvus2datavec.md @@ -4,7 +4,7 @@ ## 环境准备 - 已部署2.3 及以上版本的Milvus实例 -- 已部署7.0.0-RC1 及以上版本的openGauss实例,容器部署参考[容器镜像安装](../InstallationGuide/容器镜像安装.md) +- 已部署7.0.0-RC1 及以上版本的openGauss实例,容器部署参考[容器镜像安装](../../../docs-lite/zh/docs/InstallationGuide/容器镜像安装.md) - 已安装3.8 及以上版本的Python环境 - 已安装涉及的Python库 diff --git a/content/zh/docs/DataVec/openGauss-Dify.md b/content/zh/docs/DataVec/openGauss-Dify.md index 0bbd62bdcdf8f3ddac681a8632aab651e7a24f13..67b21abe86c38452cee984a707d80f2f93165a09 100644 --- a/content/zh/docs/DataVec/openGauss-Dify.md +++ b/content/zh/docs/DataVec/openGauss-Dify.md @@ -46,9 +46,9 @@ http://your_server_ip ![](./figures/LoginDify.png) ### 接入大模型 -在主界面点击右上角用户名,然后点击“设置”进入设置页面,单击“模型供应商”,选择“Ollama”单击“安装”按钮。(ollama服务及大模型部署参考:[openGauss-RAG实践](openGauss-RAG实践.md)) +在主界面点击右上角用户名,然后点击“设置”进入设置页面,单击“模型供应商”,选择“OpenAI”单击“安装”按钮。(大模型及嵌入模型部署采用昇腾解决方案参考:[MindIE-DeepSeek-R1-Distill-Qwen-7B模型部署](https://modelers.cn/models/MindIE/DeepSeek-R1-Distill-Qwen-7B)、[mis-tei-embedding部署](https://www.hiascend.com/developer/ascendhub/detail/07a016975cc341f3a5ae131f2b52399d)) -![](./figures/OllamaPlugin.png) +![](./figures/OpenAIPlugin.png) 安装完成后,在添加模型页面,“模型类型”选择“LLM”,配置如下: diff --git "a/content/zh/docs/DataVec/openGauss-RAG\345\256\236\350\267\265.md" "b/content/zh/docs/DataVec/openGauss-RAG\345\256\236\350\267\265.md" index d17fe1d57348697af5b88e81fa5cb1b11b719e55..bc19ac6f335d296d9973828b94c81e038f02eae6 100644 --- "a/content/zh/docs/DataVec/openGauss-RAG\345\256\236\350\267\265.md" +++ "b/content/zh/docs/DataVec/openGauss-RAG\345\256\236\350\267\265.md" @@ -35,19 +35,19 @@ RAG (Retrieval-Augmented Generation,检索增强生成): 一种将信息检索 ### 安装Ollama服务 首先,我们需要下载 ollama 的 pypi 包,以便后续访问 ollama 服务: -```abap +```shell [test@localhost ~]$ pip3 install ollama ``` 然后,我们可以使用官网提供的一键式部署脚本来部署 ollama 服务: -```abap +```shell curl -fsSL https://ollama.com/install.sh | sh ``` 如果遇到网络问题无法直接安装,我们可以考虑采用手动方案: -```abap +```shell [test@localhost ~]$ wget https://ollama.com/download/ollama-linux-amd64.tgz [test@localhost ~]$ tar -zxvf ollama-linux-amd64.tgz -C /usr/ [test@localhost ~]$ which ollama @@ -58,7 +58,7 @@ curl -fsSL https://ollama.com/install.sh | sh 安装成功后,我们可以启动 ollama 服务: -```abap +```shell [test@localhost ~]$ ollama serve & ``` @@ -67,12 +67,12 @@ curl -fsSL https://ollama.com/install.sh | sh **deepseek-r1** 模型是基于先进的深度学习技术开发的,它具有独特的架构和训练方式,能够更好地捕捉文本中的语义信息,从而为文本生成带来更出色的效果。同时,我们选用**nomic-embed-text**模型用于嵌入任务,该模型能够将文本转换为高维向量表示,为后续的检索和匹配提供了强有力的支持。二者协同工作,共同助力我们基于DeepSeek与openGauss打造的本地AI知识库,使其能够更高效、更精准地为用户提供服务。 -```abap +```shell [test@localhost ~]$ ollama --version ollama version is 0.5.6 ``` -```abap +```shell [test@localhost ~]$ ollama pull deepseek-r1 [test@localhost ~]$ ollama pull nomic-embed-text ``` @@ -82,21 +82,21 @@ ollama version is 0.5.6 ### 下载依赖 首先,我们需要下载 psycopg2 依赖: -```abap +```shell [test@localhost ~]$ pip3 install psycopg2 ``` ### 获取镜像 通过如下命令获取 openGauss 镜像: -```abap +```shell [root@localhost ~]$ docker pull opengauss/opengauss:7.0.0-RC1 ``` ### 启动服务 镜像拉取完成后,我们可以启动openGauss服务: -```abap +```shell [root@localhost ~]$ docker run --name opengauss --privileged=true -d -e GS_PASSWORD=****** -p 8888:5432 -v /home/test/opengauss:/var/lib/opengauss opengauss/opengauss:7.0.0-RC1 ``` diff --git a/content/zh/docs/DataVec/openGauss-Springboot.md b/content/zh/docs/DataVec/openGauss-Springboot.md index 7d5c57baca7264e9efe94dc5048a6d9260459688..8a0f75ae6b55c16581497f5cfc724f534a175fd4 100644 --- a/content/zh/docs/DataVec/openGauss-Springboot.md +++ b/content/zh/docs/DataVec/openGauss-Springboot.md @@ -6,7 +6,7 @@ - 安装java1.8及以上版本 - Spring Boot 3.X及以上版本 - Ollama服务安装部署 [部署参考](https://github.com/ollama/ollama) -- openGauss数据库安装部署 [容器镜像安装](../InstallationGuide/容器镜像安装.md) +- openGauss数据库安装部署 [容器镜像安装](../../../docs-lite/zh/docs/InstallationGuide/容器镜像安装.md) ## 添加Maven依赖 在pom.xml中添加openGauss jdbc和ollama sdk依赖 diff --git a/content/zh/docs/DataVec/openGauss-VectorDBBench.md b/content/zh/docs/DataVec/openGauss-VectorDBBench.md new file mode 100644 index 0000000000000000000000000000000000000000..777061eae0ea4ca602d65e811890323081c7b0a5 --- /dev/null +++ b/content/zh/docs/DataVec/openGauss-VectorDBBench.md @@ -0,0 +1,104 @@ +# 使用VectorDBBench工具性能测试 +VectorDBBench 是一款开源向量数据库基准测试工具,主要通过测量关键指标来衡量向量数据库的性能。 +本文介绍如何使用VectorDBBench工具对openGauss中Datavec向量引擎进行性能测试。 + +### 安装python3 +推荐安装Python3.11以上版本 +```bash +wget --no-check-certificate https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tar.xz +tar -xvf Python-3.11.0.tar.xz +cd Python-3.11.0 + +# 为用户自定义的python安装路径 +./configure --prefix= --enable-optimizations +make -j; make install +``` +设置python3环境变量 +```bash +vim ~/.bashrc +export PATH=/bin:$PATH +source ~/.bashrc +``` +### 安装vectordb-bench +```bash +pip3 install vectordb-bench[all] +``` +替换适配opengauss的vectordb-bench文件夹 +```bash +# 下载适配opengauss的vectordb-bench:https://github.com/wlff123/VectorDBBench.git +cp -r vectordb_bench /lib/python3.11/site-packages/ +``` +### 数据集下载 +VectorDBBench工具执行测试时,会根据选择的数据集自行从网络下载,也可以手动下载。 +```bash +# cohere1m数据集下载示例 +wget https://assets.zilliz.com/benchmark/cohere_medium_1m/test.parquet --no-check-certificate +wget https://assets.zilliz.com/benchmark/cohere_medium_1m/neighbors.parquet --no-check-certificate +wget https://assets.zilliz.com/benchmark/cohere_medium_1m/shuffle_train.parquet --no-check-certificate +``` +### 配置openGauss数据库参数 +按照测试需求对数据库节点目录下postgresql.conf文件中影响性能的关键参数配置: +```bash +max_connections = 1000 # 多并发测试时此值应大于并发连接数 +shared_buffers = 16GB # 机器内存足够时,建议此值大于数据集大小 +enable_indexscan = on # 开启索引扫描 +enable_seqscan = off # 关闭全表扫描 +``` +### 性能测试 +建议使用vectordbbench命令行执行测试,可以根据测试需求灵活调整测试参数。 +```bash +# 修改数据集路径 +# vi /lib/python3.11/site-packages/vectordb_bench/__init__.py +DATASET_LOCAL_DIR = '' + +# 本地机器如果不能从网络下载数据集,执行测试可能会报错,此时可以屏蔽掉下载数据集的相关代码 +# vi /lib/python3.11/site-packages/vectordb_bench/backend/data_source.py +class AwsS3Reader(DatasetReader): + # ... + def read(self, dataset: str, files: list[str], local_ds_root: pathlib.Path): + downloads = [] + # ... + else: + for file in files: + remote_file = pathlib.PurePosixPath(self.remote_root, dataset, file) + local_file = local_ds_root.joinpath(file) + # 此处屏蔽下载数据集的代码 + # if (not local_file.exists()) or (not self.validate_file(remote_file, local_file)): + # log.info(f"local file: {local_file} not match with remote: {remote_file}; add to downloading list") + # downloads.append(remote_file) +``` +测试命令示例 +```bash +# vectordbbench opengausshnsw --case-type --k --concurrency-duration --num-concurrency --user-name --password --host --port --db-name -m --ef-construction --ef-search +# ALGORITHM 测试用例类型 +# DATASET 测试用例数据集 +# TOPK 查询最近邻结果数量 +# DURATION 查询持续时间(秒) +# CONCURRENCY_NUM 并发数量 +# USERNAME 数据库用户名 +# PASSWORD 数据库密码 +# HOST 数据库ip地址 +# PORT 数据库端口 +# M hnsw索引构建参数 +# EF_CONSTRUCTION hnsw索引构建参数 +# EF_SEARCH hnsw索引搜索参数 + +# 详细参数说明可以执行命令查看帮助 +vectordbbench opengausshnsw --help +vectordbbench opengausshnswpq --help + +# hnsw索引测试命令 +vectordbbench opengausshnsw --case-type Performance768D1M --k 10 --concurrency-duration 60 --num-concurrency 1 --user-name gaussdb --password YourPassword --host 127.0.0.1 --port 5432 --db-name postgres -m 16 --ef-construction 200 --ef-search 200 +# hnswpq索引测试命令 +vectordbbench opengausshnswpq --pq_m 96 --hnsw_earlystop_threshold 160 --case-type Performance768D1M --k 10 --concurrency-duration 60 --num-concurrency 1 --user-name gaussdb --password YourPassword --host 127.0.0.1 --port 5432 --db-name postgres -m 16 --ef-construction 200 --ef-search 200 +``` +执行测试命令后,会在当前终端中打印测试执行过程和结果 +```bash +# 测试结果示例说明 +... INFO: Performance case got result: Metric(max_load_count=0, load_duration=xxx, qps=xxx, serial_latency_p99=xxx, recall=xxx, ndcg=xxx, conc_num_list=xxx, conc_qps_list=xxx, conc_latency_p99_list=xxx, conc_latency_avg_list=xxx)... +# load_duration 导入数据和构建索引的总时间 +# qps 吞吐量 +# serial_latency_p99 单并发查询p99时延 +# recall 召回率 +# conc_latency_p99_list 多并发查询p99时延 +``` diff --git a/content/zh/docs/DataVec/testtool_annbenchmark.md b/content/zh/docs/DataVec/testtool_annbenchmark.md new file mode 100644 index 0000000000000000000000000000000000000000..7b1a17dc33f56dfa26873c494f0a4f3872c678b3 --- /dev/null +++ b/content/zh/docs/DataVec/testtool_annbenchmark.md @@ -0,0 +1,110 @@ +# 向量分析性能测试-AnnBenchmark + +## 1. 准备工作 +### 测试环境 +- 安装python>=3.8.6 +- 下载适配openGauss数据库的ann-benchmark性能测试工具。下载链接:[ann-benchmarks-openGauss](https://github.com/lauraty123/ann-benchmarks-openGauss) +- 安装测试工具所需的依赖包`pip3 install -r requirements.txt` +- 部署openGauss-DataVec容器实例,教程可参考[openGauss-DataVec容器镜像安装](../../../docs-lite/zh/docs/InstallationGuide/容器镜像安装.md) +### 测试数据 +| Dataset | Dimensions | Train size | Test size | Neighbors | Distance | Download | +| ----------------------------------------------------------------- | ---------: | ---------: | --------: | --------: | --------- | -------------------------------------------------------------------------- | +| [DEEP1B](http://sites.skoltech.ru/compvision/noimi/) | 96 | 9,990,000 | 10,000 | 100 | Angular | [HDF5](http://ann-benchmarks.com/deep-image-96-angular.hdf5) (3.6GB) +| [Fashion-MNIST](https://github.com/zalandoresearch/fashion-mnist) | 784 | 60,000 | 10,000 | 100 | Euclidean | [HDF5](http://ann-benchmarks.com/fashion-mnist-784-euclidean.hdf5) (217MB) | +| [GIST](http://corpus-texmex.irisa.fr/) | 960 | 1,000,000 | 1,000 | 100 | Euclidean | [HDF5](http://ann-benchmarks.com/gist-960-euclidean.hdf5) (3.6GB) | +| [GloVe](http://nlp.stanford.edu/projects/glove/) | 25 | 1,183,514 | 10,000 | 100 | Angular | [HDF5](http://ann-benchmarks.com/glove-25-angular.hdf5) (121MB) | +| GloVe | 50 | 1,183,514 | 10,000 | 100 | Angular | [HDF5](http://ann-benchmarks.com/glove-50-angular.hdf5) (235MB) | +| GloVe | 100 | 1,183,514 | 10,000 | 100 | Angular | [HDF5](http://ann-benchmarks.com/glove-100-angular.hdf5) (463MB) | +| GloVe | 200 | 1,183,514 | 10,000 | 100 | Angular | [HDF5](http://ann-benchmarks.com/glove-200-angular.hdf5) (918MB) | +| [Kosarak](http://fimi.uantwerpen.be/data/) | 27,983 | 74,962 | 500 | 100 | Jaccard | [HDF5](http://ann-benchmarks.com/kosarak-jaccard.hdf5) (33MB) | +| [MNIST](http://yann.lecun.com/exdb/mnist/) | 784 | 60,000 | 10,000 | 100 | Euclidean | [HDF5](http://ann-benchmarks.com/mnist-784-euclidean.hdf5) (217MB) | +| [MovieLens-10M](https://grouplens.org/datasets/movielens/10m/) | 65,134 | 69,363 | 500 | 100 | Jaccard | [HDF5](http://ann-benchmarks.com/movielens10m-jaccard.hdf5) (63MB) | +| [NYTimes](https://archive.ics.uci.edu/ml/datasets/bag+of+words) | 256 | 290,000 | 10,000 | 100 | Angular | [HDF5](http://ann-benchmarks.com/nytimes-256-angular.hdf5) (301MB) | +| [SIFT](http://corpus-texmex.irisa.fr/) | 128 | 1,000,000 | 10,000 | 100 | Euclidean | [HDF5](http://ann-benchmarks.com/sift-128-euclidean.hdf5) (501MB) | +| [Last.fm](https://github.com/erikbern/ann-benchmarks/pull/91) | 65 | 292,385 | 50,000 | 100 | Angular | [HDF5](http://ann-benchmarks.com/lastfm-64-dot.hdf5) (135MB) | +| [COCO-I2I](https://cocodataset.org/) | 512 | 113,287 | 10,000 | 100 | Angular | [HDF5](https://github.com/fabiocarrara/str-encoders/releases/download/v0.1.3/coco-i2i-512-angular.hdf5) (136MB) | +| [COCO-T2I](https://cocodataset.org/) | 512 | 113,287 | 10,000 | 100 | Angular | [HDF5](https://github.com/fabiocarrara/str-encoders/releases/download/v0.1.3/coco-t2i-512-angular.hdf5) (136MB) | + +> 注:
+> 数据集位置:置放路径为/ann-benchmarks-openGauss/data,需要先`mkdir data`
+> 数据集下载:可以直接通过`wget`下载,例如:`wget http://ann-benchmarks.com/glove-50-angular.hdf5 --no-check-certificate` + +## 2. 测试流程 +### 数据库配置 +容器内的配置文件路径: +``` +/var/lib/opengauss/data/postgresql.conf +``` +推荐配置参数: +``` +shared_buffers=50GB #推荐大于数据库和索引的总和 +maintenance_work_mem=4GB +password_encryption_type=1 +max_connections=1000 #最大连接数 +``` +有关具体参数的修改,请参考 **[GUC参数说明](../DatabaseReference/GUC参数说明.md)** +### ann-benchmark配置 +修改`go_opgs.sh`中的数据库连接配置 +```bash +export ANN_BENCHMARKS_OG_USER='YourUserName' +export ANN_BENCHMARKS_OG_PASSWORD='YourPassword' +export ANN_BENCHMARKS_OG_DBNAME='YourDBName' +export ANN_BENCHMARKS_OG_HOST='YourHost' +export ANN_BENCHMARKS_OG_PORT=YourPort +``` +修改ann-benchmarks-openGauss/ann_benchmarks/algorithms/openGauss/config.yml中构建索引、索引查询相关参数(按需) +```bash + - base_args: ['@metric'] + constructor: openGaussHNSW + disabled: false + docker_tag: ann-benchmarks-openGauss + module: ann_benchmarks.algorithms.openGauss + name: openGauss-hnsw + run_groups: + M-16: + arg_groups: [{M: 16, efConstruction: 200}] + args: {} + query_args: [[10, 20, 40, 80, 120, 200, 400, 800]] + M-24: + arg_groups: [{M: 24, efConstruction: 200}] + args: {} + query_args: [[10, 20, 40, 80, 120, 200, 400, 800]] +``` +- name: 近似搜索算法名 +- run_groups: 索引构建和索引查询参数设置,这里的arg_groups设置的是hnsw索引构建参数m和efconstruction,query_args则是hnsw索引查询参数ef_search。 + +### 执行测试 +修改`go_opgs.sh`中的启动命令 +```bash +python3 run.py --algorithm openGauss-hnsw --dataset fashion-mnist-784-euclidean --local --runs 1 -k 10 --batch +``` +- --algorithm 算法名,这里的算法名来源于ann-benchmarks-openGauss/ann_benchmarks/algorithms/openGauss/config.yml的name字段,目前支持openGauss-hnsw、openGauss-hnswpq、openGauss-ivfflat。 +- --dataset 数据集名称,支持的数据集见准备工作的测试数据章节。 +- -- runs 执行测试集次数 +- --k topk数目 +- --batch 如果加入该参数,可以开启向量数据的并发查询 + +开启测试 +```bash +sh go_opgs.sh +``` + +> 注:
+> 若已经执行过同组测试,需要重命名或删除`ann-benchmarks-openGauss/results///`下对应的文件,否则会直接跳过改组测试。 + +## 3. 测试结果 +### 输出html可互动网页 +```bash +python3 create_website.py --outputdir --scatter --recompute +``` + +### 输出数据表格 +```bash +python3 data_export.py --out <结果文件名>.csv +``` + +测试结果说明: +- k-nn:准确率 +- qps:吞吐量 +- p99:p99时延 +- build:构建索引耗时 diff --git "a/content/zh/docs/DatabaseAdministrationGuide/\350\265\204\346\272\220\346\261\240\345\214\226\347\275\221\347\273\234\345\217\214\351\233\206\347\276\244\351\203\250\347\275\262.md" "b/content/zh/docs/DatabaseAdministrationGuide/\350\265\204\346\272\220\346\261\240\345\214\226\347\275\221\347\273\234\345\217\214\351\233\206\347\276\244\351\203\250\347\275\262.md" index 22e1393c0bf25191aa252ea02dac3fbaa0223fa3..6a7d0864c0c2f6bf97babda39a642ea6b1cb39f2 100644 --- "a/content/zh/docs/DatabaseAdministrationGuide/\350\265\204\346\272\220\346\261\240\345\214\226\347\275\221\347\273\234\345\217\214\351\233\206\347\276\244\351\203\250\347\275\262.md" +++ "b/content/zh/docs/DatabaseAdministrationGuide/\350\265\204\346\272\220\346\261\240\345\214\226\347\275\221\347\273\234\345\217\214\351\233\206\347\276\244\351\203\250\347\275\262.md" @@ -2,9 +2,7 @@ ## 内容简介 -openGauss资源池化是openGauss推出的一种新型的集群架构.通过DMS和DSS组件,实现集群中多个节点的底层存储数据共享和节点间的内存实时共享,达到节省底层存储资源以及集群内部支持一写多读且可以实时一致性读的目的。 -本文主要介绍基资源池化部署网络双集群。 - +openGauss资源池化是openGauss推出的一种新型的集群架构.通过DMS和DSS组件,实现集群中多个节点的底层存储数据共享和节点间的内存实时共享,从而节省底层存储资源,并支持集群内部一写多读及实时一致性读。本文主要介绍基于资源池化部署双集群网络。 - 在社区上正式发布的企业版安装包中,如果需要搭建资源池化网络双集群,在硬件上需要准备磁阵,服务器和光交换机,且需要部署CM和OM组件。 diff --git "a/content/zh/docs/InstallationGuide/deb\345\214\205\345\256\211\350\243\205.md" "b/content/zh/docs/InstallationGuide/deb\345\214\205\345\256\211\350\243\205.md" new file mode 100644 index 0000000000000000000000000000000000000000..7a21772e206b6280b2dfd2f0df18056d0d1b4d37 --- /dev/null +++ "b/content/zh/docs/InstallationGuide/deb\345\214\205\345\256\211\350\243\205.md" @@ -0,0 +1,73 @@ +# deb包安装 + +本章节主要介绍在Ubuntu和Debian操作系统上,通过apt命令一键安装openGauss数据库。 + +## 支持的架构和操作系统版本以及对应的openGauss版本 + +| 操作系统 | 架构 | openauss版本 | +| ----------------------- | ------ | --------------- | +| Ubuntu 22.04 LTS | ARM64/x86_64 | openGauss 6.0.0 企业版 | +| Debian 12 | x86_64 | openGauss 6.0.0 企业版 | + +注意:如果需要其他系统上安装openGauss,请联系华为技术支持。 + +## 支持特性 + +- 从openGauss 5.0.1开始,支持兼容性B库,详细参考[dolphin插件](../ExtensionReference/dolphin概述.md)。 + +## 约束 + +- openGauss 6.0.0企业版不包含mot,obs和codegen功能,以及om、cm等外部组件,仅有纯数据库功能(支持兼容性B库)。 + +## 使用限制 + +- 当前仅在Ubuntu和Debian操作系统上支持apt方式安装,支持arm64和x86_64两种架构。 +- 默认安装实例监听127.0.0.1:7654地址和端口。如果需要进行远程连接,需要手动修改postgresql.conf文件中的listen_address。 +- 安装数据库默认创建用户opengauss,卸载数据库后不删除该用户。 + +## 安装方式 + +以sudo用户安装为例 + +- 使用apt install安装。 + - Ubuntu安装: + + ```shell + $ add-apt-repository ppa:opengauss/opengauss + $ apt update + $ apt install opengauss + ``` + - Debian安装: + ```shell + $ add-apt-repository ppa:opengauss/opengauss + $ sed -i 's/bookworm/jammy/g' /etc/apt/sources.list.d/opengauss-ubuntu-opengauss-bookworm.list + $ apt update + $ apt install opengauss + ``` +- 安装完成后根据提示启动数据库 + + ```shell + $ service opengauss start + ``` +>![](public_sys-resources/icon-note.png) **说明:** +> 由于PPA只支持Ubuntu系统软件包构建,在Debian操作系统上使用时需修改apt源列表文件。 + +## 卸载方式 +- 卸载openGauss + + ```shell + $ apt remove opengauss + ``` +- 删除openGauss PPA仓库 + + ```shell + $ add-apt-repository --remove ppa:opengauss/opengauss + ``` + +## 使用说明 + +1. 切换到opengauss用户 `su - opengauss` + +2. 查看进程 `ps ux`, 可以看到,二进制安装目录在 `/usr/opengauss`下,默认启动的数据目录在`/var/lib/opengauss/data`目录下。 + +3. 数据库连接 `gsql -d postgres -p 7654 -r`,数据库默认端口为7654。连接到数据库后,可正常使用数据库。 diff --git "a/content/zh/docs/InstallationGuide/\345\256\271\345\231\250\351\225\234\345\203\217\345\256\211\350\243\205.md" "b/content/zh/docs/InstallationGuide/\345\256\271\345\231\250\351\225\234\345\203\217\345\256\211\350\243\205.md" index b78436bcbc02519fb0fdf2a19a540ff135c0bdcc..8aad9cb58eb91fedf71d33c09914027b5af48729 100644 --- "a/content/zh/docs/InstallationGuide/\345\256\271\345\231\250\351\225\234\345\203\217\345\256\211\350\243\205.md" +++ "b/content/zh/docs/InstallationGuide/\345\256\271\345\231\250\351\225\234\345\203\217\345\256\211\350\243\205.md" @@ -4,34 +4,33 @@ ## 1. 获取镜像 openGauss镜像主要有两种获取方式,分别可以通过`docker pull`和`docker load`拉取对应镜像,下面将详细介绍这两种获取路径。 ### 拉取dockerhub镜像 -openGauss 镜像支持x86-64、ARM64架构和openEuler 20.03 LTS操作系统版本,拉取镜像时无需指定架构和版本。 ```bash -$ docker pull opengauss/opengauss:latest +$ docker pull opengauss/opengauss-server:latest ``` - 验证镜像状态 ```bash $ docker images -REPOSITORY TAG IMAGE ID CREATED SIZE -opengauss/opengauss latest 9aa832ba6684 2 hours ago 1.44GB +REPOSITORY TAG IMAGE ID CREATED SIZE +opengauss/opengauss-server latest 9763e8b26794 2 days ago 1.68GB ``` ### 下载镜像包并加载 -- 下载镜像包(以openGauss7.0.0-RC1.B020/openEuler20.03/arm下的包为例) +- 下载镜像包(以openGauss7.0.0-RC1.B023/openEuler20.03/arm下的包为例) ``` bash -$ wget https://download-opengauss.osinfra.cn/archive_test/7.0.0-RC1/openGauss7.0.0-RC1.B020/openEuler20.03/arm/openGauss-Docker-7.0.0-RC1.tar +$ wget https://download-opengauss.osinfra.cn/archive_test/7.0.0-RC1/openGauss7.0.0-RC1.B023/openEuler20.03/arm/openGauss-Docker-7.0.0-RC1-aarch64.tar ``` - 加载镜像 ``` bash -$ docker load -i openGauss-Docker-7.0.0-RC1.tar +$ docker load -i openGauss-Docker-7.0.0-RC1-aarch64.tar ``` - 验证镜像状态 ```bash $ docker images -REPOSITORY TAG IMAGE ID CREATED SIZE -opengauss latest 9aa832ba6684 2 hours ago 1.44GB +REPOSITORY TAG IMAGE ID CREATED SIZE +opengauss/opengauss-server latest 9763e8b26794 2 days ago 1.68GB ``` >![](public_sys-resources/icon-note.png) **说明:** > @@ -39,9 +38,9 @@ opengauss latest 9aa832ba6684 2 hours ago 1 ## 2. 运行容器 -以`opengauss/opengauss:latest` 版本为例,以下命令将启动数据库并映射宿主机的端口到容器: +以`opengauss/opengauss-server:latest` 版本为例,以下命令将启动数据库并映射宿主机的端口到容器: ```bash -$ docker run --name opengauss --privileged=true -d -e GS_PASSWORD=YourPassoword -p 8888:5432 opengauss/opengauss:latest +$ docker run --name opengauss --privileged=true -d -e GS_PASSWORD=YourPassoword -p 8888:5432 opengauss/opengauss-server:latest ``` ### 启动参数 @@ -79,8 +78,8 @@ $ docker ps ``` 输出示例: ``` -CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -7abc538f242a opengauss/opengauss:latest "entrypoint.sh gauss…" About a minute ago Up About a minute 0.0.0.0:8888->5432/tcp opengauss +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +7abc538f242a opengauss/opengauss-server:latest "entrypoint.sh gauss…" About a minute ago Up About a minute 0.0.0.0:8888->5432/tcp opengauss ``` ### 容器内部连接数据库 @@ -108,7 +107,7 @@ $ gsql -d postgres -U gaussdb -W YourPassoword -h your-host-ip -p 8888 通过以下命令,将宿主机的`/opengauss`目录挂载到容器的`/var/lib/opengauss`目录,实现数据的持久化存储: ```bash -$ docker run --name opengauss --privileged=true -d -e GS_PASSWORD=YourPassoword -v /opengauss:/var/lib/opengauss opengauss/opengauss:latest +$ docker run --name opengauss --privileged=true -d -e GS_PASSWORD=YourPassoword -v /opengauss:/var/lib/opengauss opengauss/opengauss-server:latest ``` ### 参数配置 diff --git "a/content/zh/docs/InstallationGuide/\346\236\201\347\256\200\347\211\210\345\256\211\350\243\205.md" "b/content/zh/docs/InstallationGuide/\346\236\201\347\256\200\347\211\210\345\256\211\350\243\205.md" index 688d4fc202204a9846c2d13462f9057be19a61f8..16ccf459998a428552f42b27cb5c678b6fd40a91 100644 --- "a/content/zh/docs/InstallationGuide/\346\236\201\347\256\200\347\211\210\345\256\211\350\243\205.md" +++ "b/content/zh/docs/InstallationGuide/\346\236\201\347\256\200\347\211\210\345\256\211\350\243\205.md" @@ -6,4 +6,8 @@ - **[服务器安装](服务器安装.md)** -- **[容器安装](容器安装.md)** \ No newline at end of file +- **[容器安装](容器安装.md)** + +- **[RPM安装](RPM安装.md)** + +- **[deb包安装](deb包安装.md)** \ No newline at end of file diff --git "a/content/zh/docs/SQLReference/\350\236\215\345\220\210\346\237\245\350\257\242\344\275\277\347\224\250\346\214\207\345\215\227.md" "b/content/zh/docs/SQLReference/\350\236\215\345\220\210\346\237\245\350\257\242\344\275\277\347\224\250\346\214\207\345\215\227.md" index fa609c9a6159c5343554131c21e50984e1034d9f..41e4ae51794b287ead7451f541c448eca051da27 100644 --- "a/content/zh/docs/SQLReference/\350\236\215\345\220\210\346\237\245\350\257\242\344\275\277\347\224\250\346\214\207\345\215\227.md" +++ "b/content/zh/docs/SQLReference/\350\236\215\345\220\210\346\237\245\350\257\242\344\275\277\347\224\250\346\214\207\345\215\227.md" @@ -2,125 +2,7 @@ 本章节主要介绍openGauss中DataVec向量引擎的融合查询使用指导。 ## 1. 安装部署 -使用Docker实现openGauss搭载DataVec的容器化部署,简化DevOps用户的安装、配置和环境设置。 - -### 容器架构和操作系统版本支持 - -opengauss-datavec 镜像支持以下架构和操作系统版本: - -- **x86-64 openEuler 20.03 LTS**: -```bash -$ docker pull swr.cn-north-4.myhuaweicloud.com/opengauss-x86-64/opengauss-datavec:latest -``` - -- **ARM64 openEuler 20.03 LTS**: -```bash -$ docker pull swr.cn-north-4.myhuaweicloud.com/opengauss-aarch64/opengauss-datavec:latest -``` - -### 验证镜像状态 -成功拉取镜像后,查看镜像状态: -```bash -$ docker images -``` - -输出示例: -``` -REPOSITORY TAG IMAGE ID CREATED SIZE -swr.cn-north-4.myhuaweicloud.com/opengauss-aarch64/opengauss-datavec latest 5be9d4f1ca12 2 hours ago 1.02GB -``` - -### 修改镜像名称 -使用`docker tag`命令更改镜像名称或标签: -```bash -$ docker tag swr.cn-north-4.myhuaweicloud.com/opengauss-aarch64/opengauss-datavec:latest opengauss-datavec:latest -``` - -### 启动实例 -以`openGauss-datavec latest` 版本为例,以下命令将启动数据库并映射宿主机的端口到容器: -```bash -$ docker run --name opengauss --privileged=true -d -e GS_PASSWORD=YourPassoword -p 8888:5432 opengauss-datavec:latest -``` - -#### 启动参数 -- `--name opengauss`:为容器命名为`opengauss` -- `--privileged=true`: 授予容器特权模式 -- `-d`: 以后台模式运行容器 -- `-p 8888:5432`: 将容器的5432端口映射到宿主机的8888端口 - -##### 必选容器内环境变量 -- `-e GS_PASSWORD=YourPassoword`:设置数据库超级用户`omm`密码 - -使用 openGauss 镜像的时候,必须设置该参数,且不能为空或未定义。该参数用于设置 openGauss 数据库的超级用户`omm`。安装过程中将默认创建omm超级用户,该用户名目前无法更改。 - -openGauss 镜像配置了本地信任机制,因此在容器内连接数据库时无需密码,但若从容器外部(其它主机或者容器)连接,则必须要输入密码。 - -###### **密码要求** - -- 密码长度必须至少为8个字符。 -- 必须同时包含大写字母、小写字母、数字、以及特殊符号。 -- 支持的特殊符号仅包含`\#?!@$%^&\*-`(其中`!$&`需使用转义符号”\“)。 - -##### 可选容器内环境变量 -- `-e GS_NODENAME=YourNodeName`:指定数据库节点名称,默认为`gaussdb` -- `-e GS_USERNAME=YourUserName`:指定数据库连接用户名,默认为测试用户`gaussdb` -- `-e GS_USER_PASSWORD=YourUserPassword`:指定用户`$GS_USERNAME`密码,默认为`$GS_PASSWORD` -- `-e GS_PORT=YourPort`:指定容器内数据库端口,默认为`5432` -- `-e GS_DB=YourDbName`:在容器内创建数据库,默认为`postgres` - -### 验证容器状态 -查看运行中的容器: -```bash -$ docker ps -``` -输出示例: -``` -CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -7abc538f242a opengauss-datavec:latest "entrypoint.sh gauss…" About a minute ago Up About a minute 0.0.0.0:8888->5432/tcp opengauss -``` - -### 连接数据库 - -#### 容器内部连接数据库 - -进入容器: -``` -$ docker exec -it bash -``` - -登录`omm`超级用户: -``` -$ su omm -$ gsql -d postgres -p 5432 -``` - -#### 从宿主机连接数据库 - -宿主机可以通过以下命令连接数据库(需安装`gsql`客户端): -```shell -$ gsql -d postgres -U gaussdb -W YourPassoword -h your-host-ip -p 8888 -``` - -### 数据持久化 - -通过以下命令,将宿主机的`/opengauss`目录挂载到容器的`/var/lib/opengauss`目录,实现数据的持久化存储: -```bash -$ docker run --name opengauss --privileged=true -d -e GS_PASSWORD=YourPassoword -v /opengauss:/var/lib/opengauss opengauss-datavec:latest -``` - -### 参数配置 -容器内的配置文件路径: -``` -/var/lib/opengauss/data/postgresql.conf -``` - -修改完配置文件后,请使用以下命令重启容器以使更改生效: -```bash -docker restart -``` -若在容器外配置参数,需要挂载宿主机路径到容器内部的`/var/lib/opengauss`目录。 - -有关具体参数的修改,请参考 **[GUC参数说明](../DatabaseReference/GUC参数说明.md)** +使用Docker实现openGauss搭载DataVec的容器化部署,简化DevOps用户的安装、配置和环境设置,参考 [容器镜像安装](../../../docs-lite/zh/docs/InstallationGuide/容器镜像安装.md)。 ## 2. 融合查询 数据源类型通常是多样化的,包含结构化数据(如文本、数字等)和非结构化数据(如视频、图片、音频等)。为了有效存储和检索不同类型的数据,融合查询结合了结构化过滤和非结构化检索的技术,使用户在同一查询中使用不同的数据类型和查询方法,以获取更为精确的非结构化数据。openGauss集成了结构化数据和非结构化数据融合查询的能力。 diff --git a/content/zh/menu/index.md b/content/zh/menu/index.md index c7a3234c2366352b4043ba6e58e3665cbbceeb25..f52a6fcc59b3f04168241cfdcd087b5cddad723a 100644 --- a/content/zh/menu/index.md +++ b/content/zh/menu/index.md @@ -209,7 +209,7 @@ headless: true - [使用openGauss]({{< relref "./docs/GettingStarted/使用openGauss.md" >}}) - [安装指南]({{< relref "./docs/InstallationGuide/InstallationGuide.md" >}}) - [安装概述]({{< relref "./docs/InstallationGuide/安装概述.md" >}}) - - [向量数据库容器镜像安装]({{< relref "./docs/InstallationGuide/容器镜像安装.md" >}}) + - [容器镜像安装]({{< relref "./docs/InstallationGuide/容器镜像安装.md" >}}) - [极简版安装]({{< relref "./docs/InstallationGuide/极简版安装.md" >}}) - [安装准备]({{< relref "./docs/InstallationGuide/安装准备.md" >}}) - [获取安装包]({{< relref "./docs/InstallationGuide/获取安装包.md" >}}) @@ -222,6 +222,7 @@ headless: true - [一主两备安装]({{< relref "./docs/InstallationGuide/一主两备不带cm安装_容器.md" >}}) - [CM安装]({{< relref "./docs/InstallationGuide/CM安装_容器.md" >}}) - [RPM安装]({{< relref "./docs/InstallationGuide/RPM安装.md" >}}) + - [deb包安装]({{< relref "./docs/InstallationGuide/deb包安装.md" >}}) - [企业版安装]({{< relref "./docs/InstallationGuide/企业版安装.md" >}}) - [安装准备]({{< relref "./docs/InstallationGuide/安装准备_企业版.md" >}}) - [了解安装流程]({{< relref "./docs/InstallationGuide/了解安装流程.md" >}}) @@ -912,12 +913,21 @@ headless: true - [向量存储引擎]({{< relref "./docs/DataVec/DataVec-architecture.md" >}}) - [PQ]({{< relref "./docs/DataVec/PQ.md" >}}) - [工具编排使用]({{< relref "./docs/DataVec/DataVec-integrations.md" >}}) - - [使用openGauss部署Dify]({{< relref "./docs/DataVec/dify.md" >}}) - - [使用openGauss部署AnythingLLM]({{< relref "./docs/DataVec/anythingllm.md" >}}) - - [从Milvus迁移至openGauss DataVec]({{< relref "./docs/DataVec/milvus2datavec.md" >}}) - - [Python SDK对接向量数据库]({{< relref "./docs/DataVec/integrationPython.md" >}}) - - [Java SDK对接向量数据库]({{< relref "./docs/DataVec/integrationJava.md" >}}) - - [Go SDK对接向量数据库]({{< relref "./docs/DataVec/integrationGo.md" >}}) + - 编排组件 + - [Dify]({{< relref "./docs/DataVec/dify.md" >}}) + - [AnythingLLM]({{< relref "./docs/DataVec/anythingllm.md" >}}) + - 嵌入模型 + - [BGE-M3]({{< relref "./docs/DataVec/embedding-bgem3.md" >}}) + - [Nomic]({{< relref "./docs/DataVec/embedding-nomic.md" >}}) + - 数据迁移 + - [从Milvus迁移至openGauss DataVec]({{< relref "./docs/DataVec/milvus2datavec.md" >}}) + - API Reference + - [Python SDK]({{< relref "./docs/DataVec/integrationPython.md" >}}) + - [Java SDK]({{< relref "./docs/DataVec/integrationJava.md" >}}) + - [Node.js SDK]({{< relref "./docs/DataVec/integrationJavaScript.md" >}}) + - [Go SDK]({{< relref "./docs/DataVec/integrationGo.md" >}}) + - 性能测试 + - [VectorDBBench]({{< relref "./docs/DataVec/openGauss-VectorDBBench.md" >}}) - [教程案例指导]({{< relref "./docs/DataVec/DataVec-tutorials.md" >}}) - [打破AI黑盒,拥抱开源力量:基于openGauss+DeepSeek的本地知识库,打造你的专属AI助手!]({{< relref "./docs/DataVec/openGauss-RAG实践.md" >}}) - [openGauss Datavec + Dify,快速搭建你的智能助手平台]({{< relref "./docs/DataVec/openGauss-Dify.md" >}})