DTaaS Services CLI
A command-line tool for managing DTaaS platform services including MongoDB, InfluxDB, RabbitMQ, and Grafana.
🗒️ The CLI does not install ThingsBoard and PostgreSQL services. See the commands in manual install page for installing these two services.
Features
- Project Initialization: Generate project structure with config and data directories
- Automated Setup: One command setup of TLS certificates and permissions
- Service Management: Start, stop, and check status of all services
- User Management: Easy creation of user accounts in InfluxDB and RabbitMQ
- Cross platform: Works on Linux, macOS, and Windows
- Configuration-driven: Reads settings from
config/services.env
Installation
Prerequisites
- Python 3.10 or higher
- Docker
- TLS certificates
Install from Wheel Package
Run the following commands from a virtual environment. Install the standalone wheel package using pip:
This installs the dtaas-services command.
To verify the installation:
Quick Start
- Navigate to where you want to set up the services and generate the project structure:
This creates:
* config/ directory with configuration templates
* data/ directory for service data
* compose.services.secure.yml for Docker Compose
- Update
config/services.envwith your environment values: SERVICES_UID- User ID for service file ownershipSERVICES_GID- Group ID for service file ownershipSERVER_DNS- Your server hostname-
Port numbers for each service
-
Update
config/credentials.csvwith user accounts (format:username,password)
Usage
Service Setup
After generating the project and configuring your settings:
This command will:
- Copy TLS certificates to the correct locations
- Set up MongoDB certificates and permissions
- Set up InfluxDB certificates and permissions
- Set up RabbitMQ certificates and permissions
Permission Requirements:
This command requires access to the Docker daemon. You have two options:
- Recommended: Add your user to the docker group (run once):
Then run the command without sudo:
- Alternative: Run with sudo:
Service Management
Start all services:
Stop all services:
Restart services:
Check service status:
Remove services (with confirmation prompt):
Remove services and their volumes:
User Account Management
-
Edit
config/credentials.csvwith user accounts (format:username,password) -
Add users to InfluxDB and RabbitMQ:
This will create user accounts with appropriate permissions in both services.
Commands Reference
dtaas-services generate-project
Generates the project structure with config, data directories, and compose file.
Options:
--path- Directory to generate project structure (default: current directory)
Example:
dtaas-services setup
Performs complete service setup including certificates and permissions.
Example:
dtaas-services start
Starts all platform services using Docker Compose.
Options:
-s, --services- Comma-separated list of specific services to start
Examples:
dtaas-services stop
Stops all running platform services.
Options:
-s, --services- Comma-separated list of specific services to stop
Examples:
dtaas-services restart
Restarts platform services.
Options:
-s, --services- Comma-separated list of specific services to restart
Examples:
dtaas-services remove
Removes platform services and optionally their volumes. Prompts for confirmation before removal.
Note: When volumes are removed with --volumes, the data directories are
automatically recreated empty to ensure successful reinstallation of services.
Options:
-s, --services- Comma-separated list of specific services to remove-v, --volumes- Remove volumes as well (data will be deleted but directories preserved)
Examples:
dtaas-services status
Shows the current status of all services.
Options:
-s, --services- Comma-separated list of specific services to check
Examples:
dtaas-services user add
Adds user accounts to InfluxDB and RabbitMQ from config/credentials.csv.
Example:
Troubleshooting
Permission Issues (Linux/macOS)
If you encounter permission errors when setting up services, ensure you run the setup command with appropriate privileges:
Docker Connection Issues
Ensure Docker daemon is running: