Taurus Executor is a high-performance remote command execution system. This guide covers the complete deployment process from registration to production deployment.
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Taurus Server │◄────────│ Taurus Executor │────────►│ Target Host │
│ (Backend) │ Heart- │ (Agent Process) │ Execute │ (Remote Host) │
│ │ beat/Reg│ │ Commands│ │
└─────────────────┘ └──────────────────┘ └─────────────────┘
| Component | Path | Purpose |
|---|---|---|
| Executor Core | src/executor_core/ |
Main process for command execution |
| Client SDK | manage/sdk/ |
Python library for connecting to executors |
| CLI Tool | manage/cli.py |
Command-line interface |
| Web UI | web_ui.py |
Web-based management interface |
- Zero-Downtime Updates: New versions start on independent ports before switching
- Auto Recovery: Automatic restart on process failure
- Version Management: Multiple versions can coexist for quick rollback
- mTLS Security: Mutual TLS for all communications
- Python 3.12+
- Poetry (for dependency management)
- OpenSSL (for certificate management)
- systemd (for production deployment)
git clone https://github.com/taurus-stack/taurus-executor.git
cd taurus-executorpoetry installmake build-allcp .env.example .envEdit .env with your settings:
TAURUS_SERVER_URL=http://your-server:8000
TAURUS_HOST_UUID=your-host-uuid
# TLS Configuration
TLS_SERVER_CERT_PATH=./tls/server.crt
TLS_SERVER_KEY_PATH=./tls/server.key
TLS_CA_PATH=./tls/ca.crt
# gRPC Configuration
GRPC_HOST=0.0.0.0
GRPC_PORT=50051Taurus Executor uses mTLS (mutual TLS) for secure communication:
Taurus Server (holds ca.key)
├── Issues client certificates
├── Manages certificate trust
└── Certificate revocation/renewal
Taurus Executor (does not hold ca.key)
├── ca.crt # Verify server certificate
├── client.crt / client.key # mTLS authentication
└── .env # Configuration
When registering with the server, certificates are automatically issued:
./scripts/register.sh --server http://<taurus-server>:8000 --token <your-token>This creates:
~/.taurus-executor/tls/ca.crt- CA root certificate~/.taurus-executor/tls/client.crt- Client certificate~/.taurus-executor/tls/client.key- Client private key
- Generate client key and CSR:
openssl genrsa -out client.key 2048
openssl req -new -key client.key -out client.csr \
-subj "/C=CN/ST=Beijing/L=Beijing/O=taurus-stack/CN=<hostname>"- Submit CSR to server API:
curl -X POST http://<taurus-server>:8000/api/taurus/executor/certificate/ \
-H "Content-Type: application/json" \
-d '{"host_id": "<host_id>", "csr": "<CSR_CONTENT>"}'- Save returned certificates to
tls/directory
- Automatic: Client detects expiring certificates and requests renewal
- Manual: Administrator reissues certificates from server
- Revocation: Administrator can revoke specific client certificates
# Start the executor
poetry run client
# Or using Python directly
python -m executor_core.main- Create systemd service file:
sudo tee /etc/systemd/system/taurus-executor.service > /dev/null << 'EOF'
[Unit]
Description=Taurus Executor Agent
After=network.target
[Service]
Type=simple
User=taurus
Group=taurus
WorkingDirectory=/opt/taurus-executor
ExecStart=/opt/taurus-executor/taurus-executor
Restart=always
RestartSec=5
Environment=PYTHONUNBUFFERED=1
# Security
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=read-only
ReadWritePaths=/opt/taurus-executor/data /opt/taurus-executor/logs
[Install]
WantedBy=multi-user.target
EOF- Install the executor:
# Create user and directories
sudo useradd -r -s /sbin/nologin taurus
sudo mkdir -p /opt/taurus-executor/{data,logs,tls}
sudo chown -R taurus:taurus /opt/taurus-executor
# Copy binary and configuration
sudo cp dist/taurus-executor /opt/taurus-executor/
sudo cp .env /opt/taurus-executor/
sudo cp -r tls/* /opt/taurus-executor/tls/
# Enable and start service
sudo systemctl daemon-reload
sudo systemctl enable taurus-executor
sudo systemctl start taurus-executor- Check status:
sudo systemctl status taurus-executor
sudo journalctl -u taurus-executor -f# Start with docker-compose
docker-compose up -d
# View logs
docker-compose logs -f taurus-executor
# Stop
docker-compose down# Build image
docker build -t taurus-executor:latest .
# Run container
docker run -d \
--name taurus-executor \
--restart unless-stopped \
-p 50051:50051 \
-v $(pwd)/tls:/opt/taurus-executor/tls:ro \
-v $(pwd)/data:/opt/taurus-executor/data \
-e TAURUS_SERVER_URL=http://your-server:8000 \
-e TAURUS_HOST_UUID=your-host-uuid \
taurus-executor:latest# Package the executor
make package
# Or manually
bash scripts/package.shThis creates a standalone binary in dist/taurus-executor.
dist/
└── taurus-executor # Standalone binary
The executor exposes a health check endpoint:
curl http://localhost:50051/healthMetrics are available at:
curl http://localhost:50051/metricsAvailable metrics:
executor_commands_total: Total commands executedexecutor_commands_failed_total: Failed commands countexecutor_command_duration_seconds: Command execution durationexecutor_sessions_active: Active sessions countexecutor_cpu_usage_percent: CPU usageexecutor_memory_usage_bytes: Memory usage
Error: TLS handshake failed
Solution: Verify certificates are valid and correctly configured:
openssl x509 -in tls/client.crt -text -noout
openssl verify -CAfile tls/ca.crt tls/client.crtError: Connection refused
Solution: Check if the executor is running:
sudo systemctl status taurus-executor
netstat -tlnp | grep 50051Error: Permission denied
Solution: Verify file permissions:
ls -la tls/
sudo chown -R taurus:taurus /opt/taurus-executor# systemd logs
sudo journalctl -u taurus-executor -f
# Docker logs
docker logs -f taurus-executor
# File logs (if configured)
tail -f /opt/taurus-executor/logs/executor.logThe executor supports automatic zero-downtime upgrades:
- New version downloads package
- Verifies SHA256 checksum
- Installs to independent directory
- Starts new version on different port
- Health checks new version
- Switches traffic and stops old version
# Stop current version
sudo systemctl stop taurus-executor
# Backup current version
sudo cp /opt/taurus-executor/taurus-executor /opt/taurus-executor/taurus-executor.bak
# Install new version
sudo cp dist/taurus-executor /opt/taurus-executor/
# Start new version
sudo systemctl start taurus-executor
# Verify
sudo systemctl status taurus-executor# Stop current version
sudo systemctl stop taurus-executor
# Restore backup
sudo mv /opt/taurus-executor/taurus-executor.bak /opt/taurus-executor/taurus-executor
# Start restored version
sudo systemctl start taurus-executor- Always use mTLS: Enable mutual TLS for all communications
- Rotate certificates: Regularly rotate TLS certificates
- Limit network exposure: Only expose gRPC port to trusted networks
- Use firewall rules: Restrict access using iptables/firewalld
- Monitor logs: Regularly review logs for suspicious activity
- Keep updated: Always run the latest version
- Audit permissions: Regularly audit command execution permissions
- Secure private keys: Store private keys with restricted permissions
# Set proper permissions
chmod 600 tls/*.key
chmod 644 tls/*.crt
chown -R taurus:taurus tls/