ragflow 网址
demo网址:https://demo.ragflow.io/
介绍网址:https://mp.weixin.qq.com/s/zNnL0LXC2yYT-QZhDkOITA
官网说明
项目地址:
https://github.com/infiniflow/ragflow
项目官网:
https://ragflow.io
在线Demo:
https://demo.ragflow.io
本地部署说明
本人部署环境说明
正常使用Ubuntu即可正常启动,但本机没有正式环境,本人在win11上WSL2安装ubuntu22在需要准备如下配置
本地知识库搭建(基于olama)
docker desk (如果是正式的Ubuntu服务器其实是不需要他的)
正式部署步骤引用官网文件说明
📝 前提条件
- CPU >= 4 核
- RAM >= 16 GB
- Disk >= 50 GB
- Docker >= 24.0.0 & Docker Compose >= v2.26.1
如果你并没有在本机安装 Docker(Windows、Mac,或者 Linux), 可以参考文档 Install Docker Engine 自行安装。
🚀 启动服务器
-
确保
vm.max_map_count
不小于 262144 【更多】:如需确认
vm.max_map_count
的大小:$ sysctl vm.max_map_count
如果
vm.max_map_count
的值小于 262144,可以进行重置:# 这里我们设为 262144: $ sudo sysctl -w vm.max_map_count=262144
你的改动会在下次系统重启时被重置。如果希望做永久改动,还需要在 /etc/sysctl.conf 文件里把
vm.max_map_count
的值再相应更新一遍:vm.max_map_count=262144
-
克隆仓库:
$ git clone https://github.com/infiniflow/ragflow.git
-
进入 docker 文件夹,利用提前编译好的 Docker 镜像启动服务器:
$ cd ragflow/docker $ chmod +x ./entrypoint.sh $ docker compose -f docker-compose-CN.yml up -d
请注意,运行上述命令会自动下载 RAGFlow 的开发版本 docker 镜像。如果你想下载并运行特定版本的 docker 镜像,请在 docker/.env 文件中找到 RAGFLOW_VERSION 变量,将其改为对应版本。例如 RAGFLOW_VERSION=v0.6.0,然后运行上述命令。
核心镜像文件大约 9 GB,可能需要一定时间拉取。请耐心等待。
-
服务器启动成功后再次确认服务器状态:
$ docker logs -f ragflow-server
出现以下界面提示说明服务器启动成功:
____ ______ __ / __ \ ____ _ ____ _ / ____// /____ _ __ / /_/ // __ `// __ `// /_ / // __ \| | /| / / / _, _// /_/ // /_/ // __/ / // /_/ /| |/ |/ / /_/ |_| \__,_/ \__, //_/ /_/ \____/ |__/|__/ /____/ * Running on all addresses (0.0.0.0) * Running on http://127.0.0.1:9380 * Running on http://x.x.x.x:9380 INFO:werkzeug:Press CTRL+C to quit
如果您跳过这一步系统确认步骤就登录 RAGFlow,你的浏览器有可能会提示
network anomaly
或网络异常
,因为 RAGFlow 可能并未完全启动成功。 -
在你的浏览器中输入你的服务器对应的 IP 地址并登录 RAGFlow。
上面这个例子中,您只需输入 http://IP_OF_YOUR_MACHINE 即可:未改动过配置则无需输入端口(默认的 HTTP 服务端口 80)。
-
在 service_conf.yaml 文件的
user_default_llm
栏配置 LLM factory,并在API_KEY
栏填写和你选择的大模型相对应的 API key。好戏开始,接着奏乐接着舞!
🔧 系统配置
系统配置涉及以下三份文件:
- .env:存放一些基本的系统环境变量,比如
SVR_HTTP_PORT
、MYSQL_PASSWORD
、MINIO_PASSWORD
等。 - service_conf.yaml:配置各类后台服务。
- docker-compose-CN.yml: 系统依赖该文件完成启动。
请务必确保 .env 文件中的变量设置与 service_conf.yaml 文件中的配置保持一致!
./docker/README 文件提供了环境变量设置和服务配置的详细信息。请一定要确保 ./docker/README 文件当中列出来的环境变量的值与 service_conf.yaml 文件当中的系统配置保持一致。
如需更新默认的 HTTP 服务端口(80), 可以在 docker-compose-CN.yml 文件中将配置 80:80
改为 <YOUR_SERVING_PORT>:80
。
所有系统配置都需要通过系统重启生效:
$ docker compose -f docker-compose-CN.yml up -d
启动前台有以下两种方式,但是本机一直报nginx错误,所以我用编译情况启动的代码
. 启动WebUI服务(本人用此方法)
$ cd web
$ npm install --registry=https://registry.npmmirror.com --force --audit=false
$ vim .umirc.ts
# 修改proxy.target为127.0.0.1:9380
$ npm run dev
部署WebUI服务
$ cd web
$ npm install --registry=https://registry.npmmirror.com --force
$ umi build
$ mkdir -p /ragflow/web
$ cp -r dist /ragflow/web
$ apt install nginx -y
$ cp ../docker/nginx/proxy.conf /etc/nginx
$ cp ../docker/nginx/nginx.conf /etc/nginx
$ cp ../docker/nginx/ragflow.conf /etc/nginx/conf.d
$ systemctl start nginx
启动成功后,会展示一个前台访问地址,本人是9380,通过地址可直接访问页面。
其他说明
docker desk安装参考网址:https://blog.csdn.net/swadian2008/article/details/137105221
Ubuntu安装cuda参考网址
https://blog.csdn.net/JulyLi2019/article/details/125102098
本地搭建ollama:本地搭建ollama
hugging face官网:ollama依赖的知识库
不要贪大,太大的知识库本地可能无法运行,本人安装8B的中文训练的知识库。
安装过程中可能Ubuntu中缺少docker依赖:Ubuntu安装docker