mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-14 19:35:52 +08:00
Add Kibana component for Elasticsearch (#1710)
### What problem does this PR solve? Add Kibana component for Elasticsearch ### Type of change - [ ] Bug Fix (non-breaking change which fixes an issue) - [x] New Feature (non-breaking change which adds functionality) --------- Co-authored-by: Theta Wang (ncu) <chunshan.connect@gmail.com>
This commit is contained in:
parent
3f495b2d22
commit
548f01850f
@ -10,6 +10,8 @@ ELASTIC_PASSWORD=infini_rag_flow
|
|||||||
|
|
||||||
# Port to expose Kibana to the host
|
# Port to expose Kibana to the host
|
||||||
KIBANA_PORT=6601
|
KIBANA_PORT=6601
|
||||||
|
KIBANA_USER=rag_flow
|
||||||
|
KIBANA_PASSWORD=infini_rag_flow
|
||||||
|
|
||||||
# Increase or decrease based on the available host memory (in bytes)
|
# Increase or decrease based on the available host memory (in bytes)
|
||||||
|
|
||||||
|
33
docker/docker-compose-admin-tool.yml
Normal file
33
docker/docker-compose-admin-tool.yml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
services:
|
||||||
|
kibana:
|
||||||
|
image: kibana:${STACK_VERSION}
|
||||||
|
container_name: ragflow-kibana
|
||||||
|
environment:
|
||||||
|
ELASTICSEARCH_USERNAME: ${KIBANA_USER}
|
||||||
|
ELASTICSEARCH_PASSWORD: ${KIBANA_PASSWORD}
|
||||||
|
ELASTICSEARCH_HOSTS: "http://es01:9200"
|
||||||
|
ports:
|
||||||
|
- ${KIBANA_PORT}:5601
|
||||||
|
depends_on:
|
||||||
|
es01:
|
||||||
|
condition: service_healthy
|
||||||
|
kibana-user-init:
|
||||||
|
condition: service_completed_successfully
|
||||||
|
|
||||||
|
networks:
|
||||||
|
- ragflow
|
||||||
|
kibana-user-init:
|
||||||
|
image: appropriate/curl
|
||||||
|
depends_on:
|
||||||
|
es01:
|
||||||
|
condition: service_healthy
|
||||||
|
volumes:
|
||||||
|
- ./init-kibana.sh:/app/init-kibana.sh
|
||||||
|
environment:
|
||||||
|
- ELASTIC_PASSWORD=${ELASTIC_PASSWORD}
|
||||||
|
- KIBANA_USER=${KIBANA_USER}
|
||||||
|
- KIBANA_PASSWORD=${KIBANA_PASSWORD}
|
||||||
|
command: /bin/sh -c "sh /app/init-kibana.sh"
|
||||||
|
networks:
|
||||||
|
- ragflow
|
||||||
|
restart: 'no'
|
@ -1,7 +1,8 @@
|
|||||||
include:
|
include:
|
||||||
- path: ./docker-compose-base.yml
|
- path: ./docker-compose-base.yml
|
||||||
env_file: ./.env
|
env_file: ./.env
|
||||||
|
- path: ./docker-compose-admin-tool.yml
|
||||||
|
env_file: ./.env
|
||||||
services:
|
services:
|
||||||
ragflow:
|
ragflow:
|
||||||
depends_on:
|
depends_on:
|
||||||
|
30
docker/init-kibana.sh
Executable file
30
docker/init-kibana.sh
Executable file
@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 等待 Elasticsearch 啟動
|
||||||
|
until curl -u "elastic:${ELASTIC_PASSWORD}" -s http://es01:9200 >/dev/null; do
|
||||||
|
echo "等待 Elasticsearch 啟動..."
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
echo "使用者: elastic:${ELASTIC_PASSWORD}"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
PAYLOAD="{
|
||||||
|
\"password\" : \"${KIBANA_PASSWORD}\",
|
||||||
|
\"roles\" : [ \"kibana_admin\",\"kibana_system\" ],
|
||||||
|
\"full_name\" : \"${KIBANA_USER}\",
|
||||||
|
\"email\" : \"${KIBANA_USER}@example.com\"
|
||||||
|
}"
|
||||||
|
echo "新用戶帳戶: $PAYLOAD"
|
||||||
|
|
||||||
|
# 創建新用戶帳戶
|
||||||
|
curl -X POST "http://es01:9200/_security/user/${KIBANA_USER}" \
|
||||||
|
-u "elastic:${ELASTIC_PASSWORD}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "$PAYLOAD"s
|
||||||
|
|
||||||
|
echo "新用戶帳戶已創建"
|
||||||
|
|
||||||
|
exit 0
|
@ -17,6 +17,10 @@ es:
|
|||||||
hosts: 'http://es01:9200'
|
hosts: 'http://es01:9200'
|
||||||
username: 'elastic'
|
username: 'elastic'
|
||||||
password: 'infini_rag_flow'
|
password: 'infini_rag_flow'
|
||||||
|
kibana:
|
||||||
|
hosts: 'http://${host}:6601'
|
||||||
|
username: 'rag_flow'
|
||||||
|
password: 'infini_rag_flow'
|
||||||
redis:
|
redis:
|
||||||
db: 1
|
db: 1
|
||||||
password: 'infini_rag_flow'
|
password: 'infini_rag_flow'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user