forked from DreamLab-AI/origin-logseq-AR
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathcheck-neo4j.sh
More file actions
executable file
·57 lines (46 loc) · 1.92 KB
/
check-neo4j.sh
File metadata and controls
executable file
·57 lines (46 loc) · 1.92 KB
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
#!/bin/bash
# Check if Neo4j is available in the docker_ragflow network
echo "=== Checking for Neo4j in docker_ragflow network ==="
echo ""
# Check if docker_ragflow network exists
if docker network inspect docker_ragflow &>/dev/null; then
echo "✓ docker_ragflow network exists"
echo ""
# List all containers in the network
echo "Containers in docker_ragflow network:"
docker network inspect docker_ragflow -f '{{range .Containers}}{{.Name}} ({{.IPv4Address}}){{"\n"}}{{end}}'
echo ""
# Check for Neo4j specifically
NEO4J_CONTAINER=$(docker ps --filter "network=docker_ragflow" --format "{{.Names}}" | grep -i neo4j)
if [ -n "$NEO4J_CONTAINER" ]; then
echo "✓ Neo4j container found: $NEO4J_CONTAINER"
echo ""
# Get container details
echo "Neo4j container details:"
docker inspect "$NEO4J_CONTAINER" --format '
Container: {{.Name}}
Image: {{.Config.Image}}
Status: {{.State.Status}}
Ports: {{range $p, $conf := .NetworkSettings.Ports}}{{$p}} {{end}}
Network IP: {{(index .NetworkSettings.Networks "docker_ragflow").IPAddress}}'
echo ""
# Check if Neo4j is responding
NEO4J_IP=$(docker inspect "$NEO4J_CONTAINER" --format '{{(index .NetworkSettings.Networks "docker_ragflow").IPAddress}}')
echo "Testing Neo4j connectivity at bolt://$NEO4J_IP:7687..."
# Test connection (requires netcat)
if timeout 2 bash -c "echo > /dev/tcp/$NEO4J_IP/7687" 2>/dev/null; then
echo "✓ Neo4j bolt port (7687) is accessible"
else
echo "✗ Neo4j bolt port (7687) is NOT accessible"
fi
else
echo "✗ No Neo4j container found in docker_ragflow network"
echo ""
echo "You need to add Neo4j to the network."
fi
else
echo "✗ docker_ragflow network does NOT exist"
echo "Create it with: docker network create docker_ragflow"
fi
echo ""
echo "=== Check complete ==="