File size: 2,018 Bytes
b30f068
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
# Qdrant Docker Setup Script

echo "πŸš€ Setting up Qdrant with Docker..."
echo ""

# Check if Qdrant container already exists
if docker ps -a | grep -q qdrant; then
    echo "πŸ“¦ Qdrant container found"
    
    # Check if it's running
    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..."
    
    # Run 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
    
    # Check if container is running
    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!"