安装RAGflow:https://github.com/infiniflow/ragflow/blob/main/README_zh.md
安装完毕之后:
root@flexusx-8b5d:/ragflow/docker# docker-compose up -d
WARN[0000] The "HF_ENDPOINT" variable is not set. Defaulting to a blank string.
WARN[0000] The "MACOS" variable is not set. Defaulting to a blank string.
[+] Running 6/6
✔ Network docker_ragflow Created 0.1s
✔ Container ragflow-mysql Healthy 11.1s
✔ Container ragflow-redis Started 0.6s
✔ Container ragflow-es-01 Started 0.6s
✔ Container ragflow-minio Started 0.7s
✔ Container ragflow-server Started 11.4s
root@flexusx-8b5d:/ragflow/docker# docker logs -f ragflow-server
2025-03-05 19:59:38,814 INFO 15 ragflow_server log path: /ragflow/logs/ragflow_server.log, log levels: {'peewee': 'WARNING', 'pdfminer': 'WARNING', 'root': 'INFO'}
2025-03-05 19:59:49,047 INFO 15 init database on cluster mode successfully
2025-03-05 20:00:05,108 INFO 15
____ ___ ______ ______ __
/ __ \ / | / ____// ____// /____ _ __
/ /_/ // /| | / / __ / /_ / // __ \| | /| / /
/ _, _// ___ |/ /_/ // __/ / // /_/ /| |/ |/ /
/_/ |_|/_/ |_|\____//_/ /_/ \____/ |__/|__/
2025-03-05 20:00:05,108 INFO 15 RAGFlow version: v0.17.0 slim
2025-03-05 20:00:05,108 INFO 15 project base: /ragflow
2025-03-05 20:00:05,109 INFO 15 Current configs, from /ragflow/conf/service_conf.yaml:
ragflow: {'host': '0.0.0.0', 'http_port': 9380}
mysql: {'name': 'rag_flow', 'user': 'root', 'password': '********', 'host': 'mysql', 'port': 3306, 'max_connections': 100, 'stale_timeout': 30}
minio: {'user': 'rag_flow', 'password': '********', 'host': 'minio:9000'}
es: {'hosts': 'http://es01:9200', 'username': 'elastic', 'password': '********'}
infinity: {'uri': 'infinity:23817', 'db_name': 'default_db'}
redis: {'db': 1, 'password': '********', 'host': 'redis:6379'}
2025-03-05 20:00:05,109 INFO 15 Use Elasticsearch http://es01:9200 as the doc engine.
2025-03-05 20:00:05,271 INFO 15 GET http://es01:9200/ [status:200 duration:0.161s]
2025-03-05 20:00:05,278 INFO 15 HEAD http://es01:9200/ [status:200 duration:0.006s]
2025-03-05 20:00:05,278 INFO 15 Elasticsearch http://es01:9200 is healthy.
2025-03-05 20:00:05,285 WARNING 15 Load term.freq FAIL!
2025-03-05 20:00:05,290 WARNING 15 Realtime synonym is disabled, since no redis connection.
2025-03-05 20:00:05,296 WARNING 15 Load term.freq FAIL!
2025-03-05 20:00:05,301 WARNING 15 Realtime synonym is disabled, since no redis connection.
2025-03-05 20:00:05,301 INFO 15 MAX_CONTENT_LENGTH: 134217728
2025-03-05 20:00:05,301 INFO 15 SERVER_QUEUE_MAX_LEN: 1024
2025-03-05 20:00:05,301 INFO 15 SERVER_QUEUE_RETENTION: 3600
2025-03-05 20:00:05,301 INFO 15 MAX_FILE_COUNT_PER_USER: 0
2025-03-05 20:00:07,515 INFO 15 init web data success:2.122746706008911
2025-03-05 20:00:07,517 INFO 15 RAGFlow HTTP server start...
2025-03-05 20:00:07,519 INFO 15 WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:9380
* Running on http://172.19.0.6:9380
2025-03-05 20:00:07,520 INFO 15 Press CTRL+C to quit
WARNING:root:Load term.freq FAIL!
WARNING:root:Realtime synonym is disabled, since no redis connection.
WARNING:root:Load term.freq FAIL!
WARNING:root:Realtime synonym is disabled, since no redis connection.
WARNING:root:RedisDB.queue_info rag_flow_svr_queue got exception: no such key
WARNING:root:RedisDB.queue_info rag_flow_svr_queue got exception: no such key
WARNING:root:RedisDB.queue_info rag_flow_svr_queue got exception: no such key
翻译:
警告:root:加载 term.freq 失败!
警告:root:由于没有 Redis 连接,实时同义词已禁用。
警告:root:加载 term.freq 失败!
警告:root:由于没有 Redis 连接,实时同义词已禁用。
警告:root:RedisDB.queue_info rag_flow_svr_queue 出现异常:没有这样的键。
警告:root:RedisDB.queue_info rag_flow_svr_queue 出现异常:没有这样的键。
警告:root:RedisDB.queue_info rag_flow_svr_queue 出现异常:没有这样的键。
异常原因:
Redis客户端操作某个键(key)时,如果该键不存在,就会抛出“ERR no such key”异常。说明在Redis中没有找到对应的键。
Redis里的两个key队列信息,分别是task_consumer_0和rag_flow_svr_queue,这两个是队列信息,第一个待处理文件,第二个是任务。
但是,查看系统,Redis正常:
因为Redis运行正常,可以忽略。我尝试手动加一个rag_flow_svr_queue,去掉告警,但是不成功。
Redis运行在Docker容器中,不能直接在Linux命令中操作Redis,而需要通过Docker命令进入容器内部进行操作。
1. 查找Redis容器名称或ID
首先,你需要找到运行Redis的Docker容器的名称或ID。可以使用以下命令:
docker ps
这将列出所有正在运行的容器。找到Redis容器的名称或ID,例如redis-container
或abc12345
。
2. 进入Redis容器
使用docker exec
命令进入Redis容器的命令行界面:
docker exec -it redis-container bash
将redis-container
替换为你的Redis容器名称或ID。
3. 操作Redis
进入容器后,你可以使用Redis的命令行工具redis-cli
来操作Redis。例如,检查是否存在rag_flow_svr_queue
键:
redis-cli -h redis -p 6379 -a ******** EXISTS rag_flow_svr_queue
替换********
为实际的Redis密码。获取密码的操作,进入.env文件:
root@flexusx-8b5d:/ragflow/docker# vim .env
4. 初始化队列
如果键不存在,可能需要初始化队列。例如,可以使用以下命令创建一个空队列:
redis-cli -h redis -p 6379 -a ******** RPUSH rag_flow_svr_queue ""
5. 退出容器
完成操作后,退出容器:
exit
Redis 服务状态
-
Redis 服务正在运行:你能够成功连接到 Redis 服务器,说明 Redis 服务已经在运行。
-
键不存在:
EXISTS rag_flow_svr_queue
命令返回0
,表示键rag_flow_svr_queue
在 Redis 数据库中不存在。 -
添加键:返回1,说明已经添加成功。