-
Notifications
You must be signed in to change notification settings - Fork 79
Platform Services v0.2
The dtaas-services CLI is a command-line tool for managing DTaaS platform services including MongoDB, InfluxDB, RabbitMQ, and Grafana.
These services can only be installed in secure (TLS) mode.
The following services can be installed:
- Influx time-series database and dashboard service
- Grafana visualization and dashboard service
- RabbitMQ AMQP broker and its' management interface The MQTT plugin of this broker has been enabled. So, it can also be used as MQTT broker.
- MongoDB database server
- 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, RabbitMQ, and ThingsBoard
- Cross platform: Works on Linux, macOS, and Windows
-
Configuration-driven: Reads settings from
config/services.env
- Python 3.10 or higher
- Docker and Docker Compose
- TLS certificates
Install using pip:
pip install dtaas_services-0.2.0-py3-none-any.whlThis installs the dtaas-services command.
To verify the installation:
dtaas-services --help-
Navigate to where you want to set up the services and generate the project structure and run:
dtaas-services generate-project
This creates:
-
config/directory with configuration templates. It is used for storing the service configuration -
data/directory for service data -
compose.services.secure.ymlfor main services -
certsis used for storing the TLS certificates needed by the services. -
compose.thingsboard.secure.ymlfor ThingsBoard and PostgreSQL (this file can be ignored for now)
-
-
Update
config/services.envwith your environment values:-
SERVICES_UID: User ID for service file ownership -
SERVICES_GID: Group ID for service file ownership -
SERVER_DNS: Your server hostname - Port numbers for each service
-
After generating the project and configuring your settings:
dtaas-services setupThis 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
The following commands are useful for service management.
dtaas-services clean # Clean all data and log files for services with user confirmation
dtaas-services start -s rabbitmq # starts MQTT and RabbitMQ services
dtaas-services start -s grafana,influxdb # starts MQTT and RabbitMQ services
dtaas-services stop services # stop all services
dtaas-services status
dtaas-services restart # restart services
dtaas-services remove # remove services with user confirmation
dtaas-services remove -v # Remove services and their dataOptions:
The dtaas-services can take the following options.
-
-s, --servicesComma-separated list of specific services to manage -
--volumes, -v(remove command only) Remove volumes as well -
--yes(clean command only) Skip confirmation prompt
-
Edit
config/credentials.csvwith user accounts (format:username,password,email) -
Add users to services:
dtaas-services user add
This creates user accounts in InfluxDB, and RabbitMQ.