MaxKB
MaxKB copied to clipboard
[BUG]集群部署后无法登录
联系方式
MaxKB 版本
v1.1.3
问题描述
pgsql单独部署,maxkb部署在k8s中,启用多pod时,一直无法登录,后台日志显示:[log WARNING] Unauthorized: /api/user,[basehttp WARNING] "GET /api/user HTTP/1.1" 401 127
重现步骤
pgsql单独部署,maxkb部署在k8s中,启用多pod时,一直无法登录,后台日志显示:[log WARNING] Unauthorized: /api/user,[basehttp WARNING] "GET /api/user HTTP/1.1" 401 127
期待的正确结果
实现在k8s中集群化部署、pgsql独立部署,提高并发及稳定性
相关日志输出
[root@k8s-master1 yaml]# kubectl get pod,deploy -n maxkb -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
pod/maxkb-66d564f465-kkjhr 1/1 Running 0 15m 20.0.4.26 k8s-worker2 <none> <none>
pod/maxkb-66d564f465-pb5w8 1/1 Running 0 154m 20.0.4.23 k8s-worker2 <none> <none>
NAME READY UP-TO-DATE AVAILABLE AGE CONTAINERS IMAGES SELECTOR
deployment.apps/maxkb 2/2 2 2 170m maxkb harbor.wingtech.com/library/maxkb:v1.0 app=maxkb
[root@k8s-master1 yaml]# kubectl logs pod/maxkb-66d564f465-kkjhr -n maxkb
Building prefix dict from the default dictionary ...
DEBUG:jieba:Building prefix dict from the default dictionary ...
Loading model from cache /tmp/jieba.cache
DEBUG:jieba:Loading model from cache /tmp/jieba.cache
Loading model cost 0.630 seconds.
DEBUG:jieba:Loading model cost 0.630 seconds.
Prefix dict has been built successfully.
DEBUG:jieba:Prefix dict has been built successfully.
Operations to perform:
Apply all migrations: application, contenttypes, dataset, django_apscheduler, embedding, setting, users
Running migrations:
No migrations to apply.
Your models in app(s): 'application' have changes that are not yet reflected in a migration, and so won't be applied.
Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.
Building prefix dict from the default dictionary ...
DEBUG:jieba:Building prefix dict from the default dictionary ...
Loading model from cache /tmp/jieba.cache
DEBUG:jieba:Loading model from cache /tmp/jieba.cache
Loading model cost 0.538 seconds.
DEBUG:jieba:Loading model cost 0.538 seconds.
Prefix dict has been built successfully.
DEBUG:jieba:Prefix dict has been built successfully.
Operations to perform:
Apply all migrations: application, contenttypes, dataset, django_apscheduler, embedding, setting, users
Running migrations:
No migrations to apply.
Your models in app(s): 'application' have changes that are not yet reflected in a migration, and so won't be applied.
Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.
2024-06-03 13:41:30 [log WARNING] Unauthorized: /api/user/logout
2024-06-03 13:41:30 [basehttp WARNING] "POST /api/user/logout HTTP/1.1" 401 127
2024-06-03 13:41:42 [log WARNING] Unauthorized: /api/user
2024-06-03 13:41:42 [basehttp WARNING] "GET /api/user HTTP/1.1" 401 127
2024-06-03 13:41:44 [log WARNING] Unauthorized: /api/user
2024-06-03 13:41:44 [basehttp WARNING] "GET /api/user HTTP/1.1" 401 127
附加信息
No response