299 lines
7.4 KiB
Markdown
299 lines
7.4 KiB
Markdown
|
|
# Installation
|
||
|
|
|
||
|
|
Diese Seite beschreibt die Installation und Einrichtung des Customer Installer Systems.
|
||
|
|
|
||
|
|
## 📋 Voraussetzungen
|
||
|
|
|
||
|
|
Bevor Sie beginnen, stellen Sie sicher, dass folgende Voraussetzungen erfüllt sind:
|
||
|
|
|
||
|
|
- **Proxmox VE** Server (getestet mit Version 7.x und 8.x)
|
||
|
|
- **Root-Zugriff** auf den Proxmox Host
|
||
|
|
- **Debian 12 Template** (wird automatisch heruntergeladen)
|
||
|
|
- **Netzwerk-Konfiguration** (Bridge, VLAN)
|
||
|
|
- **Ollama Server** (extern, optional)
|
||
|
|
|
||
|
|
Siehe auch: [Systemanforderungen](System-Requirements.md)
|
||
|
|
|
||
|
|
## 🚀 Schnellstart
|
||
|
|
|
||
|
|
### 1. Repository klonen
|
||
|
|
|
||
|
|
```bash
|
||
|
|
cd /root
|
||
|
|
git clone ssh://backoffice.userman.de:2223/MediaMetz/customer-installer.git
|
||
|
|
cd customer-installer
|
||
|
|
```
|
||
|
|
|
||
|
|
### 2. Basis-Installation
|
||
|
|
|
||
|
|
```bash
|
||
|
|
./install.sh \
|
||
|
|
--storage local-zfs \
|
||
|
|
--bridge vmbr0 \
|
||
|
|
--ip dhcp \
|
||
|
|
--vlan 90
|
||
|
|
```
|
||
|
|
|
||
|
|
### 3. Installation mit allen Optionen
|
||
|
|
|
||
|
|
```bash
|
||
|
|
./install.sh \
|
||
|
|
--storage local-zfs \
|
||
|
|
--bridge vmbr0 \
|
||
|
|
--ip dhcp \
|
||
|
|
--vlan 90 \
|
||
|
|
--cores 4 \
|
||
|
|
--memory 8192 \
|
||
|
|
--disk 100 \
|
||
|
|
--apt-proxy http://192.168.45.2:3142 \
|
||
|
|
--base-domain userman.de \
|
||
|
|
--n8n-owner-email admin@userman.de \
|
||
|
|
--ollama-model ministral-3:3b \
|
||
|
|
--embedding-model nomic-embed-text:latest
|
||
|
|
```
|
||
|
|
|
||
|
|
## 📝 Installations-Parameter
|
||
|
|
|
||
|
|
### Pflicht-Parameter
|
||
|
|
|
||
|
|
Keine - alle Parameter haben sinnvolle Standardwerte.
|
||
|
|
|
||
|
|
### Core-Optionen
|
||
|
|
|
||
|
|
| Parameter | Beschreibung | Standard |
|
||
|
|
|-----------|--------------|----------|
|
||
|
|
| `--ctid <id>` | Container-ID (optional, wird automatisch generiert) | auto |
|
||
|
|
| `--cores <n>` | CPU-Kerne | unlimited |
|
||
|
|
| `--memory <mb>` | RAM in MB | 4096 |
|
||
|
|
| `--swap <mb>` | Swap in MB | 512 |
|
||
|
|
| `--disk <gb>` | Festplatte in GB | 50 |
|
||
|
|
| `--bridge <vmbrX>` | Netzwerk-Bridge | vmbr0 |
|
||
|
|
| `--storage <storage>` | Proxmox Storage | local-zfs |
|
||
|
|
| `--ip <dhcp\|CIDR>` | IP-Konfiguration | dhcp |
|
||
|
|
| `--vlan <id>` | VLAN-Tag (0 = deaktiviert) | 90 |
|
||
|
|
| `--privileged` | Privilegierter Container | unprivileged |
|
||
|
|
| `--apt-proxy <url>` | APT-Proxy URL | - |
|
||
|
|
|
||
|
|
### Domain & n8n Optionen
|
||
|
|
|
||
|
|
| Parameter | Beschreibung | Standard |
|
||
|
|
|-----------|--------------|----------|
|
||
|
|
| `--base-domain <domain>` | Basis-Domain | userman.de |
|
||
|
|
| `--n8n-owner-email <email>` | n8n Admin-Email | admin@<base-domain> |
|
||
|
|
| `--n8n-owner-pass <pass>` | n8n Admin-Passwort | auto-generiert |
|
||
|
|
| `--workflow-file <path>` | Workflow JSON-Datei | RAGKI-BotPGVector.json |
|
||
|
|
| `--ollama-model <model>` | Ollama Chat-Modell | ministral-3:3b |
|
||
|
|
| `--embedding-model <model>` | Embedding-Modell | nomic-embed-text:latest |
|
||
|
|
|
||
|
|
### PostgREST Optionen
|
||
|
|
|
||
|
|
| Parameter | Beschreibung | Standard |
|
||
|
|
|-----------|--------------|----------|
|
||
|
|
| `--postgrest-port <port>` | PostgREST Port | 3000 |
|
||
|
|
|
||
|
|
### Debug-Optionen
|
||
|
|
|
||
|
|
| Parameter | Beschreibung |
|
||
|
|
|-----------|--------------|
|
||
|
|
| `--debug` | Debug-Modus aktivieren |
|
||
|
|
| `--help` | Hilfe anzeigen |
|
||
|
|
|
||
|
|
## 📤 JSON-Output
|
||
|
|
|
||
|
|
Nach erfolgreicher Installation gibt das Script ein JSON-Objekt aus:
|
||
|
|
|
||
|
|
```json
|
||
|
|
{
|
||
|
|
"ctid": 769276659,
|
||
|
|
"hostname": "sb-1769276659",
|
||
|
|
"fqdn": "sb-1769276659.userman.de",
|
||
|
|
"ip": "192.168.45.45",
|
||
|
|
"vlan": 90,
|
||
|
|
"urls": {
|
||
|
|
"n8n_internal": "http://192.168.45.45:5678/",
|
||
|
|
"n8n_external": "https://sb-1769276659.userman.de",
|
||
|
|
"postgrest": "http://192.168.45.45:3000",
|
||
|
|
"chat_webhook": "https://sb-1769276659.userman.de/webhook/rag-chat-webhook/chat",
|
||
|
|
"chat_internal": "http://192.168.45.45:5678/webhook/rag-chat-webhook/chat",
|
||
|
|
"upload_form": "https://sb-1769276659.userman.de/form/rag-upload-form",
|
||
|
|
"upload_form_internal": "http://192.168.45.45:5678/form/rag-upload-form"
|
||
|
|
},
|
||
|
|
"postgres": {
|
||
|
|
"host": "postgres",
|
||
|
|
"port": 5432,
|
||
|
|
"db": "customer",
|
||
|
|
"user": "customer",
|
||
|
|
"password": "HUmMLP8NbW2onmf2A1"
|
||
|
|
},
|
||
|
|
"supabase": {
|
||
|
|
"url": "http://postgrest:3000",
|
||
|
|
"url_external": "http://192.168.45.45:3000",
|
||
|
|
"anon_key": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
|
||
|
|
"service_role_key": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
|
||
|
|
"jwt_secret": "IM9/HRQR9mw63lU/1G7vXPMe7q0n3oLcr35dryv0ToU="
|
||
|
|
},
|
||
|
|
"ollama": {
|
||
|
|
"url": "http://192.168.45.3:11434",
|
||
|
|
"model": "ministral-3:3b",
|
||
|
|
"embedding_model": "nomic-embed-text:latest"
|
||
|
|
},
|
||
|
|
"n8n": {
|
||
|
|
"encryption_key": "d0c9c0ba0551d25e4ee95b6a4b6bc8d5b64e5e14f7f0972fe50332ca051edab5",
|
||
|
|
"owner_email": "admin@userman.de",
|
||
|
|
"owner_password": "FAmeVE7t9d1iMIXWA1",
|
||
|
|
"secure_cookie": false
|
||
|
|
},
|
||
|
|
"log_file": "/root/customer-installer/logs/sb-1769276659.log"
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
### Credentials automatisch speichern
|
||
|
|
|
||
|
|
Die Credentials werden automatisch gespeichert:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
# Automatisch erstellt
|
||
|
|
credentials/sb-1769276659.json
|
||
|
|
```
|
||
|
|
|
||
|
|
Siehe auch: [Credentials-Management](Credentials-Management.md)
|
||
|
|
|
||
|
|
## 🔍 Installations-Schritte
|
||
|
|
|
||
|
|
Das Script führt folgende Schritte aus:
|
||
|
|
|
||
|
|
1. **Parameter-Validierung** - Prüfung aller Eingaben
|
||
|
|
2. **CTID-Generierung** - Eindeutige Container-ID
|
||
|
|
3. **Template-Download** - Debian 12 Template
|
||
|
|
4. **Container-Erstellung** - LXC-Container mit Konfiguration
|
||
|
|
5. **Container-Start** - Initialer Boot
|
||
|
|
6. **System-Update** - APT-Update und Upgrade
|
||
|
|
7. **Docker-Installation** - Docker Engine und Compose
|
||
|
|
8. **Stack-Deployment** - Docker Compose Stack
|
||
|
|
9. **Datenbank-Initialisierung** - PostgreSQL + pgvector
|
||
|
|
10. **n8n-Setup** - Workflow-Import und Konfiguration
|
||
|
|
11. **Workflow-Reload-Service** - Systemd Service
|
||
|
|
12. **NGINX-Proxy-Setup** - Reverse Proxy (optional)
|
||
|
|
13. **Credentials-Speicherung** - JSON-Datei
|
||
|
|
|
||
|
|
## 📊 Installations-Logs
|
||
|
|
|
||
|
|
Logs werden automatisch gespeichert:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
# Log-Datei
|
||
|
|
logs/sb-<timestamp>.log
|
||
|
|
|
||
|
|
# Log-Datei anzeigen
|
||
|
|
tail -f logs/sb-1769276659.log
|
||
|
|
```
|
||
|
|
|
||
|
|
## ✅ Installations-Verifikation
|
||
|
|
|
||
|
|
Nach der Installation sollten Sie die Verifikation durchführen:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
# Vollständige System-Tests
|
||
|
|
./test_complete_system.sh <ctid> <ip> <hostname>
|
||
|
|
|
||
|
|
# Beispiel
|
||
|
|
./test_complete_system.sh 769276659 192.168.45.45 sb-1769276659
|
||
|
|
```
|
||
|
|
|
||
|
|
Siehe auch: [Testing](Testing.md)
|
||
|
|
|
||
|
|
## 🔧 Post-Installation
|
||
|
|
|
||
|
|
### 1. Credentials prüfen
|
||
|
|
|
||
|
|
```bash
|
||
|
|
cat credentials/sb-<timestamp>.json
|
||
|
|
```
|
||
|
|
|
||
|
|
### 2. Services prüfen
|
||
|
|
|
||
|
|
```bash
|
||
|
|
# Container-Status
|
||
|
|
pct status <ctid>
|
||
|
|
|
||
|
|
# Docker-Container
|
||
|
|
pct exec <ctid> -- docker ps
|
||
|
|
|
||
|
|
# n8n-Logs
|
||
|
|
pct exec <ctid> -- docker logs n8n
|
||
|
|
```
|
||
|
|
|
||
|
|
### 3. Zugriff testen
|
||
|
|
|
||
|
|
```bash
|
||
|
|
# n8n Web-Interface
|
||
|
|
curl http://<ip>:5678/
|
||
|
|
|
||
|
|
# PostgREST API
|
||
|
|
curl http://<ip>:3000/
|
||
|
|
|
||
|
|
# Chat-Webhook
|
||
|
|
curl -X POST http://<ip>:5678/webhook/rag-chat-webhook/chat \
|
||
|
|
-H "Content-Type: application/json" \
|
||
|
|
-d '{"query":"Hallo"}'
|
||
|
|
```
|
||
|
|
|
||
|
|
## 🚨 Troubleshooting
|
||
|
|
|
||
|
|
### Container startet nicht
|
||
|
|
|
||
|
|
```bash
|
||
|
|
# Container-Logs prüfen
|
||
|
|
pct status <ctid>
|
||
|
|
journalctl -u pve-container@<ctid>
|
||
|
|
```
|
||
|
|
|
||
|
|
### Docker-Container starten nicht
|
||
|
|
|
||
|
|
```bash
|
||
|
|
# In Container einloggen
|
||
|
|
pct enter <ctid>
|
||
|
|
|
||
|
|
# Docker-Logs prüfen
|
||
|
|
docker compose -f /opt/customer-stack/docker-compose.yml logs
|
||
|
|
```
|
||
|
|
|
||
|
|
### n8n nicht erreichbar
|
||
|
|
|
||
|
|
```bash
|
||
|
|
# n8n-Container prüfen
|
||
|
|
pct exec <ctid> -- docker logs n8n
|
||
|
|
|
||
|
|
# Port-Binding prüfen
|
||
|
|
pct exec <ctid> -- netstat -tlnp | grep 5678
|
||
|
|
```
|
||
|
|
|
||
|
|
Siehe auch: [Troubleshooting](Troubleshooting.md)
|
||
|
|
|
||
|
|
## 🔄 Neuinstallation
|
||
|
|
|
||
|
|
Um einen Container neu zu installieren:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
# Container stoppen und löschen
|
||
|
|
pct stop <ctid>
|
||
|
|
pct destroy <ctid>
|
||
|
|
|
||
|
|
# Neuinstallation
|
||
|
|
./install.sh --storage local-zfs --bridge vmbr0 --ip dhcp --vlan 90
|
||
|
|
```
|
||
|
|
|
||
|
|
## 📚 Weiterführende Dokumentation
|
||
|
|
|
||
|
|
- [Konfiguration](Configuration.md) - Detaillierte Konfigurationsoptionen
|
||
|
|
- [Deployment](Deployment.md) - Produktiv-Deployment
|
||
|
|
- [Monitoring](Monitoring.md) - Überwachung und Logs
|
||
|
|
- [Backup & Recovery](Backup-Recovery.md) - Datensicherung
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
**Nächste Schritte:**
|
||
|
|
- [Credentials-Management](Credentials-Management.md) - Zugangsdaten verwalten
|
||
|
|
- [Testing](Testing.md) - System testen
|
||
|
|
- [n8n](n8n.md) - n8n konfigurieren
|