| #!/bin/bash |
| |
|
|
| echo "π Starting 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!" |
| else |
| echo "π Starting existing container..." |
| docker start qdrant |
| sleep 2 |
| echo "β
Qdrant started!" |
| 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 "β³ Waiting for Qdrant to start..." |
| sleep 3 |
| echo "β
Qdrant container created and started!" |
| fi |
|
|
| echo "" |
| echo "π Qdrant Dashboard: http://localhost:6333/dashboard" |
| echo "π Qdrant API: http://localhost:6333" |
| echo "" |
| echo "π§ͺ Testing connection..." |
| python3 -c " |
| try: |
| from qdrant_client import QdrantClient |
| client = QdrantClient(host='localhost', port=6333, timeout=5) |
| collections = client.get_collections().collections |
| print(f'β
Connection successful!') |
| print(f'π¦ Collections: {len(collections)}') |
| for coll in collections: |
| coll_info = client.get_collection(coll.name) |
| print(f' - {coll.name}: {coll_info.points_count} points') |
| except Exception as e: |
| print(f'β Connection failed: {e}') |
| print(' Make sure Docker is running and Qdrant container started') |
| " |
|
|
| echo "" |
| echo "β
Done!" |
|
|
|
|