Eplan p8 2.8 download. ThingsBoard cloud We recommend to use ThingsBoard Cloud - fully managed, scalable and fault-tolerant platform for your IoT applications ThingsBoard Cloud is for everyone who would like to use ThingsBoard but don't want to host their own instance of the platform. |
- Troubleshooting
Docker: Build Image is one of the Docker commands the Docker extension provides in the Command Palette. Another way to invoke the Docker Build command is to right click on the Dockerfile itself in the VS Code Explorer window and select Build Image. You will then get a prompt asking for the name and version to tag the image. Inside docker container, you can build SC20 Linux, just follow the Quectel getting started manual. $ cd SDK/poky $ source build/conf/setbbenv.sh $ build-8909-quec-smart-image Output of the build is inside /opt/build folder. Create docker compose file for ThingsBoard queue service: sudo nano docker-compose.yml. Add the following lines to the yml file. Don't forget to replace 'YOURNAMESPACENAME' with your real Service Bus namespace name, and 'YOURSASKEYNAME', 'YOURSASKEY' with your real Service Bus credentials.
This guide will help you to install and start ThingsBoard using Docker on Linux or Mac OS.
Prerequisites
Running
Depending on the database used there are three type of ThingsBoard single instance docker images:
thingsboard/tb-postgres - single instance of ThingsBoard with PostgreSQL database.
Recommended option for small servers with at least 1GB of RAM and minimum load (few messages per second). 2-4GB is recommended.
thingsboard/tb-cassandra - single instance of ThingsBoard with Cassandra database.
The most performant and recommended option but requires at least 4GB of RAM. 8GB is recommended.
thingsboard/tb - single instance of ThingsBoard with embedded HSQLDB database.
Note: Not recommended for any evaluation or production usage and is used only for development purposes and automatic tests.
In this instruction thingsboard/tb-postgres
image will be used. You can choose any other images with different databases (see above).
Choose ThingsBoard queue service
ThingsBoard is able to use various messaging systems/brokers for storing the messages and communication between ThingsBoard services. How to choose the right queue implementation?
In Memory queue implementation is built-in and default. It is useful for development(PoC) environments and is not suitable for production deployments or any sort of cluster deployments.
Kafka is recommended for production deployments. This queue is used on the most of ThingsBoard production environments now. It is useful for both on-prem and private cloud deployments. It is also useful if you like to stay independent from your cloud provider.However, some providers also have managed services for Kafka. See AWS MSK for example.
RabbitMQ is recommended if you don't have much load and you already have experience with this messaging system.
AWS SQS is a fully managed message queuing service from AWS. Useful if you plan to deploy ThingsBoard on AWS.
Google Pub/Sub is a fully managed message queuing service from Google. Useful if you plan to deploy ThingsBoard on Google Cloud.
Azure Service Bus is a fully managed message queuing service from Azure. Useful if you plan to deploy ThingsBoard on Azure.
Confluent Cloud is a fully managed streaming platform based on Kafka. Useful for a cloud agnostic deployments.
See corresponding architecture page and rule engine page for more details.
How To Build A Docker Image For Linux On Mac Catalina
ThingsBoard includes In Memory Queue service and use it by default without extra settings. Create docker compose file for ThingsBoard queue service: Add the following lines to the yml file: |
Apache Kafka is an open-source stream-processing software platform. Create docker compose file for ThingsBoard queue service: Add the following lines to the yml file. |
AWS SQS ConfigurationTo access AWS SQS service, you first need to create an AWS account. To work with AWS SQS service you will need to create your next credentials using this instruction:
Create docker compose file for ThingsBoard queue service: Add the following lines to the yml file. Don't forget to replace 'YOUR_KEY', 'YOUR_SECRET' with your real AWS SQS IAM user credentials and 'YOUR_REGION' with your real AWS SQS account region: |
Google Pub/Sub ConfigurationTo access Pub/Sub service, you first need to create an Google cloud account. To work with Pub/Sub service you will need to create a project using this instruction. Create service account credentials with the role 'Editor' or 'Admin' using this instruction,and save json file with your service account credentials step 9 here. Create docker compose file for ThingsBoard queue service: Add the following lines to the yml file. Don't forget to replace 'YOUR_PROJECT_ID', 'YOUR_SERVICE_ACCOUNT' with your real Pub/Sub project id, and service account (it is whole data from json file): |
Azure Service Bus ConfigurationTo access Azure Service Bus, you first need to create an Azure account. To work with Service Bus service you will need to create a Service Bus Namespace using this instruction. Create Shared Access Signature using this instruction. Create docker compose file for ThingsBoard queue service: Add the following lines to the yml file. Don't forget to replace 'YOUR_NAMESPACE_NAME' with your real Service Bus namespace name, and 'YOUR_SAS_KEY_NAME', 'YOUR_SAS_KEY' with your real Service Bus credentials. Note: 'YOUR_SAS_KEY_NAME' it is 'SAS Policy', 'YOUR_SAS_KEY' it is 'SAS Policy Primary Key': |
For installing RabbitMQ use this instruction. Create docker compose file for ThingsBoard queue service: Add the following lines to the yml file. Don't forget to replace 'YOUR_USERNAME' and 'YOUR_PASSWORD' with your real user credentials, 'localhost' and '5672' with your real RabbitMQ host and port: |
Confluent Cloud ConfigurationTo access Confluent Cloud you should first create an account, then create a Kafka cluster and get your API Key. Create docker compose file for ThingsBoard queue service: Add the following line to the yml file. Don't forget to replace 'CLUSTER_API_KEY', 'CLUSTER_API_SECRET' and 'localhost:9092' with your real Confluent Cloud bootstrap servers: |
Where:
8080:9090
- connect local port 8080 to exposed internal HTTP port 90901883:1883
- connect local port 1883 to exposed internal MQTT port 18835683:5683
- connect local port 5683 to exposed internal COAP port 5683~/.mytb-data:/data
- mounts the host's dir~/.mytb-data
to ThingsBoard DataBase data directory~/.mytb-logs:/var/log/thingsboard
- mounts the host's dir~/.mytb-logs
to ThingsBoard logs directorymytb
- friendly local name of this machinerestart: always
- automatically start ThingsBoard in case of system reboot and restart in case of failure.image: thingsboard/tb-postgres
- docker image, can be alsothingsboard/tb-cassandra
orthingsboard/tb
Before starting Docker container run following commands to create a directory for storing data and logs and then change its owner to docker container user,to be able to change user, chown command is used, which requires sudo permissions (command will request password for a sudo access):
NOTE: Replace directory ~/.mytb-data
and ~/.mytb-logs
with directories you're planning to use in docker-compose.yml
.
Set the terminal in the directory which contains the docker-compose.yml
file and execute the following command to up this docker compose directly:
After executing this command you can open http://{your-host-ip}:8080
in your browser (for ex. Why is chrome mac 10gb library files online. http://localhost:8080
). You should see ThingsBoard login page. Use the following default credentials:
- System Administrator: [email protected] / sysadmin
- Tenant Administrator: [email protected] / tenant
- Customer User: [email protected] / customer
You can always change passwords for each account in account profile page.
Detaching, stop and start commands
You can detach from session terminal with Ctrl-p
Ctrl-q
- the container will keep running in the background.
In case of any issues you can examine service logs for errors.For example to see ThingsBoard node logs execute the following command:
To stop the container:
To start the container:
Upgrading
In order to update to the latest image, execute the following commands:
NOTE: if you use different database change image name in all commands from thingsboard/tb-postgres
to thingsboard/tb-cassandra
or thingsboard/tb
correspondingly.
NOTE: replace host's directory ~/.mytb-data
with directory used during container creation.
NOTE: if you have used one database and want to try another one, then remove the current docker container using docker-compose rm
command and use different directory for ~/.mytb-data
in docker-compose.yml
.
Troubleshooting
DNS issues
Note If you observe errors related to DNS issues, for example
You may configure your system to use Google public DNS servers. See corresponding Linux and Mac OS instructions.
Next steps
Getting started guides - These guides provide quick overview of main ThingsBoard features. Designed to be completed in 15-30 minutes.
Connect your device - Learn how to connect devices based on your connectivity technology or solution.
Data visualization - These guides contain instructions how to configure complex ThingsBoard dashboards.
Data processing & actions - Learn how to use ThingsBoard Rule Engine.
IoT Data analytics - Learn how to use rule engine to perform basic analytics tasks.
Hardware samples - Learn how to connect various hardware platforms to ThingsBoard.
Advanced features - Learn about advanced ThingsBoard features.
Contribution and Development - Learn about contribution and development in ThingsBoard.
Is this what you see when accessing files that were created from within your Docker container?
The user of the container (root in the worst case) is completely different than the one on the host. The file permissions and ownership are all wrong.
One frequent solution, is to 'chown' your shared folder again and again. It's tedious and there is a better way: read on to learn learn how to build, configure and run your Docker containers correctly, so you don't have to fight permission errors and access your files easily.
First, let's look at a 'quick fix' which gets tedious quickly, before introducing better alternatives you want to use instead.
The 'chown' method
Taking ownership of the files from your shared folder can be done with chown
. Here is a simple example of creating a new file with wrong permissions:
NOTE: if you're using something like docker on mac, you won't run into those permission issues, as the file sharing is done through NFS and your local files will have the right user.
We work on the shared
folder, and create a file newfile
from within a temporary container. As the container ran with the 'root' user by default, we won't be able to use those files from the host. One way to fix them temporarily, is to take ownership of them again and again and again:
If you want to write shared data from within your Docker container and use it from your host regularly, this can get tedious really fast. In addition, this approach can break the dockerized program for future runs, especially if the container's user does not have root permissions.
You can do better.
Set the Docker user when running your container
You can run the ubuntu image with an explicit user id and group id.
The difference is ‘–user '$(id -u):$(id -g)'' - they tell the container to run with the current user id and group id which are obtained dynamically through bash command substitution by running the 'id -u' and 'id -g' and passing on their values.
This can be good enough already. The problem here is, that the user and group don't really exist in the container. This approach works for the terminal command, but the session looks broken and you'll see some ugly error messages like:
How To Build A Docker Image For Linux On Mac High Sierra
Prerequisites
Running
Depending on the database used there are three type of ThingsBoard single instance docker images:
thingsboard/tb-postgres - single instance of ThingsBoard with PostgreSQL database.
Recommended option for small servers with at least 1GB of RAM and minimum load (few messages per second). 2-4GB is recommended.
thingsboard/tb-cassandra - single instance of ThingsBoard with Cassandra database.
The most performant and recommended option but requires at least 4GB of RAM. 8GB is recommended.
thingsboard/tb - single instance of ThingsBoard with embedded HSQLDB database.
Note: Not recommended for any evaluation or production usage and is used only for development purposes and automatic tests.
In this instruction thingsboard/tb-postgres
image will be used. You can choose any other images with different databases (see above).
Choose ThingsBoard queue service
ThingsBoard is able to use various messaging systems/brokers for storing the messages and communication between ThingsBoard services. How to choose the right queue implementation?
In Memory queue implementation is built-in and default. It is useful for development(PoC) environments and is not suitable for production deployments or any sort of cluster deployments.
Kafka is recommended for production deployments. This queue is used on the most of ThingsBoard production environments now. It is useful for both on-prem and private cloud deployments. It is also useful if you like to stay independent from your cloud provider.However, some providers also have managed services for Kafka. See AWS MSK for example.
RabbitMQ is recommended if you don't have much load and you already have experience with this messaging system.
AWS SQS is a fully managed message queuing service from AWS. Useful if you plan to deploy ThingsBoard on AWS.
Google Pub/Sub is a fully managed message queuing service from Google. Useful if you plan to deploy ThingsBoard on Google Cloud.
Azure Service Bus is a fully managed message queuing service from Azure. Useful if you plan to deploy ThingsBoard on Azure.
Confluent Cloud is a fully managed streaming platform based on Kafka. Useful for a cloud agnostic deployments.
See corresponding architecture page and rule engine page for more details.
How To Build A Docker Image For Linux On Mac Catalina
ThingsBoard includes In Memory Queue service and use it by default without extra settings. Create docker compose file for ThingsBoard queue service: Add the following lines to the yml file: |
Apache Kafka is an open-source stream-processing software platform. Create docker compose file for ThingsBoard queue service: Add the following lines to the yml file. |
AWS SQS ConfigurationTo access AWS SQS service, you first need to create an AWS account. To work with AWS SQS service you will need to create your next credentials using this instruction:
Create docker compose file for ThingsBoard queue service: Add the following lines to the yml file. Don't forget to replace 'YOUR_KEY', 'YOUR_SECRET' with your real AWS SQS IAM user credentials and 'YOUR_REGION' with your real AWS SQS account region: |
Google Pub/Sub ConfigurationTo access Pub/Sub service, you first need to create an Google cloud account. To work with Pub/Sub service you will need to create a project using this instruction. Create service account credentials with the role 'Editor' or 'Admin' using this instruction,and save json file with your service account credentials step 9 here. Create docker compose file for ThingsBoard queue service: Add the following lines to the yml file. Don't forget to replace 'YOUR_PROJECT_ID', 'YOUR_SERVICE_ACCOUNT' with your real Pub/Sub project id, and service account (it is whole data from json file): |
Azure Service Bus ConfigurationTo access Azure Service Bus, you first need to create an Azure account. To work with Service Bus service you will need to create a Service Bus Namespace using this instruction. Create Shared Access Signature using this instruction. Create docker compose file for ThingsBoard queue service: Add the following lines to the yml file. Don't forget to replace 'YOUR_NAMESPACE_NAME' with your real Service Bus namespace name, and 'YOUR_SAS_KEY_NAME', 'YOUR_SAS_KEY' with your real Service Bus credentials. Note: 'YOUR_SAS_KEY_NAME' it is 'SAS Policy', 'YOUR_SAS_KEY' it is 'SAS Policy Primary Key': |
For installing RabbitMQ use this instruction. Create docker compose file for ThingsBoard queue service: Add the following lines to the yml file. Don't forget to replace 'YOUR_USERNAME' and 'YOUR_PASSWORD' with your real user credentials, 'localhost' and '5672' with your real RabbitMQ host and port: |
Confluent Cloud ConfigurationTo access Confluent Cloud you should first create an account, then create a Kafka cluster and get your API Key. Create docker compose file for ThingsBoard queue service: Add the following line to the yml file. Don't forget to replace 'CLUSTER_API_KEY', 'CLUSTER_API_SECRET' and 'localhost:9092' with your real Confluent Cloud bootstrap servers: |
Where:
8080:9090
- connect local port 8080 to exposed internal HTTP port 90901883:1883
- connect local port 1883 to exposed internal MQTT port 18835683:5683
- connect local port 5683 to exposed internal COAP port 5683~/.mytb-data:/data
- mounts the host's dir~/.mytb-data
to ThingsBoard DataBase data directory~/.mytb-logs:/var/log/thingsboard
- mounts the host's dir~/.mytb-logs
to ThingsBoard logs directorymytb
- friendly local name of this machinerestart: always
- automatically start ThingsBoard in case of system reboot and restart in case of failure.image: thingsboard/tb-postgres
- docker image, can be alsothingsboard/tb-cassandra
orthingsboard/tb
Before starting Docker container run following commands to create a directory for storing data and logs and then change its owner to docker container user,to be able to change user, chown command is used, which requires sudo permissions (command will request password for a sudo access):
NOTE: Replace directory ~/.mytb-data
and ~/.mytb-logs
with directories you're planning to use in docker-compose.yml
.
Set the terminal in the directory which contains the docker-compose.yml
file and execute the following command to up this docker compose directly:
After executing this command you can open http://{your-host-ip}:8080
in your browser (for ex. Why is chrome mac 10gb library files online. http://localhost:8080
). You should see ThingsBoard login page. Use the following default credentials:
- System Administrator: [email protected] / sysadmin
- Tenant Administrator: [email protected] / tenant
- Customer User: [email protected] / customer
You can always change passwords for each account in account profile page.
Detaching, stop and start commands
You can detach from session terminal with Ctrl-p
Ctrl-q
- the container will keep running in the background.
In case of any issues you can examine service logs for errors.For example to see ThingsBoard node logs execute the following command:
To stop the container:
To start the container:
Upgrading
In order to update to the latest image, execute the following commands:
NOTE: if you use different database change image name in all commands from thingsboard/tb-postgres
to thingsboard/tb-cassandra
or thingsboard/tb
correspondingly.
NOTE: replace host's directory ~/.mytb-data
with directory used during container creation.
NOTE: if you have used one database and want to try another one, then remove the current docker container using docker-compose rm
command and use different directory for ~/.mytb-data
in docker-compose.yml
.
Troubleshooting
DNS issues
Note If you observe errors related to DNS issues, for example
You may configure your system to use Google public DNS servers. See corresponding Linux and Mac OS instructions.
Next steps
Getting started guides - These guides provide quick overview of main ThingsBoard features. Designed to be completed in 15-30 minutes.
Connect your device - Learn how to connect devices based on your connectivity technology or solution.
Data visualization - These guides contain instructions how to configure complex ThingsBoard dashboards.
Data processing & actions - Learn how to use ThingsBoard Rule Engine.
IoT Data analytics - Learn how to use rule engine to perform basic analytics tasks.
Hardware samples - Learn how to connect various hardware platforms to ThingsBoard.
Advanced features - Learn about advanced ThingsBoard features.
Contribution and Development - Learn about contribution and development in ThingsBoard.
Is this what you see when accessing files that were created from within your Docker container?
The user of the container (root in the worst case) is completely different than the one on the host. The file permissions and ownership are all wrong.
One frequent solution, is to 'chown' your shared folder again and again. It's tedious and there is a better way: read on to learn learn how to build, configure and run your Docker containers correctly, so you don't have to fight permission errors and access your files easily.
First, let's look at a 'quick fix' which gets tedious quickly, before introducing better alternatives you want to use instead.
The 'chown' method
Taking ownership of the files from your shared folder can be done with chown
. Here is a simple example of creating a new file with wrong permissions:
NOTE: if you're using something like docker on mac, you won't run into those permission issues, as the file sharing is done through NFS and your local files will have the right user.
We work on the shared
folder, and create a file newfile
from within a temporary container. As the container ran with the 'root' user by default, we won't be able to use those files from the host. One way to fix them temporarily, is to take ownership of them again and again and again:
If you want to write shared data from within your Docker container and use it from your host regularly, this can get tedious really fast. In addition, this approach can break the dockerized program for future runs, especially if the container's user does not have root permissions.
You can do better.
Set the Docker user when running your container
You can run the ubuntu image with an explicit user id and group id.
The difference is ‘–user '$(id -u):$(id -g)'' - they tell the container to run with the current user id and group id which are obtained dynamically through bash command substitution by running the 'id -u' and 'id -g' and passing on their values.
This can be good enough already. The problem here is, that the user and group don't really exist in the container. This approach works for the terminal command, but the session looks broken and you'll see some ugly error messages like:
How To Build A Docker Image For Linux On Mac High Sierra
While bash works, some apps might refuse to run if those configs look fishy.
Build the right image
Now it gets more interesting. Here is how you can build, configure and run your Docker containers correctly, so you don't have to fight permission errors and access your files easily.
As you should create a non-root user in your Dockerfile in any case, this is a nice thing to do. While we're at it, we might as well set the user id and group id explicitly.
Here is a minimal Dockerfile which expects to receive build-time arguments, and creates a new user called 'user':
How To Build A Docker Image For Linux On Mac Os
(check out https://stackoverflow.com/questions/27701930/add-user-to-docker-container for more info on adduser)
We can use this Dockerfile, to build a fresh image with the host uid and gid. This image, needs to be built specifically for each machine it will run on to make sure everything is in order.
Then, we can run use this image for our command. The user id and group id are correct without having to specify them when running the container.
No need to use 'chown', and no annoying permission errors anymore!
In Conclusion
In this article, we have looked at a few methods how to write files with correct permissions from Docker containers for your local host.
Instead of using chown over and over, you can either build a correctly configured image, or specify fitting user and group ids when running your Docker containers.
I hope these instructions have helped you to see what options you have so you won't have problems to work on files which were generated from within your Docker containers in the future.