| #!/bin/bash |
| |
|
|
| echo "π Setting up Qdrant with Docker..." |
| echo "" |
|
|
| |
| if docker ps -a | grep -q qdrant; then |
| echo "π¦ Qdrant container found" |
| |
| |
| if docker ps | grep -q qdrant; then |
| echo "β
Qdrant is already running!" |
| echo "" |
| echo "π Qdrant Dashboard: http://localhost:6333/dashboard" |
| echo "π Qdrant API: http://localhost:6333" |
| else |
| echo "β οΈ Container exists but not running. Starting it..." |
| docker start qdrant |
| sleep 2 |
| echo "β
Qdrant started!" |
| echo "" |
| echo "π Qdrant Dashboard: http://localhost:6333/dashboard" |
| echo "π Qdrant API: http://localhost:6333" |
| fi |
| else |
| echo "π¦ Creating new Qdrant container..." |
| |
| |
| docker run -d \ |
| --name qdrant \ |
| -p 6333:6333 \ |
| -p 6334:6334 \ |
| -v $(pwd)/qdrant_storage:/qdrant/storage \ |
| qdrant/qdrant |
| |
| echo "" |
| echo "β³ Waiting for Qdrant to start..." |
| sleep 3 |
| |
| |
| if docker ps | grep -q qdrant; then |
| echo "β
Qdrant is running!" |
| echo "" |
| echo "π Qdrant Dashboard: http://localhost:6333/dashboard" |
| echo "π Qdrant API: http://localhost:6333" |
| echo "" |
| echo "πΎ Storage: ./qdrant_storage (persistent)" |
| else |
| echo "β Failed to start Qdrant. Check Docker logs:" |
| docker logs qdrant |
| fi |
| fi |
|
|
| echo "" |
| echo "π§ͺ Testing connection..." |
| python3 -c " |
| from qdrant_client import QdrantClient |
| try: |
| client = QdrantClient(host='localhost', port=6333) |
| collections = client.get_collections().collections |
| print(f'β
Connection successful!') |
| print(f'π¦ Collections: {len(collections)}') |
| for coll in collections: |
| print(f' - {coll.name}') |
| except Exception as e: |
| print(f'β Connection failed: {e}') |
| " |
|
|
| echo "" |
| echo "β
Setup complete!" |
|
|
|
|