forked from thingsboard/thingsboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create single instance docker builds. Move MSA docker configuration t…
…o the root.
- Loading branch information
Showing
68 changed files
with
1,606 additions
and
1,529 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
# cassandra environment variables | ||
CASSANDRA_DATA_DIR=/home/docker/cassandra_volume | ||
|
||
# postgres environment variables | ||
POSTGRES_DATA_DIR=/home/docker/postgres_volume | ||
POSTGRES_DB=thingsboard | ||
DOCKER_REPO=thingsboard | ||
|
||
# hsqldb environment variables | ||
HSQLDB_DATA_DIR=/home/docker/hsqldb_volume | ||
JS_EXECUTOR_DOCKER_NAME=tb-js-executor | ||
TB_NODE_DOCKER_NAME=tb-node | ||
WEB_UI_DOCKER_NAME=tb-web-ui | ||
MQTT_TRANSPORT_DOCKER_NAME=tb-mqtt-transport | ||
HTTP_TRANSPORT_DOCKER_NAME=tb-http-transport | ||
COAP_TRANSPORT_DOCKER_NAME=tb-coap-transport | ||
|
||
# environment variables for schema init and insert system and demo data | ||
ADD_SCHEMA_AND_SYSTEM_DATA=false | ||
ADD_DEMO_DATA=false | ||
TB_VERSION=latest | ||
|
||
# Database used by ThingsBoard, can be either local (local HSQLDB), postgres (PostgreSQL), cassandra (Cassandra). | ||
# In case of postgres or cassandra corresponding docker service will be deployed (see docker-compose.postgres.yml, docker-compose.cassandra.yml for details). | ||
|
||
DATABASE=cassandra | ||
|
||
KAFKA_TOPICS="js.eval.requests:100:1:delete --config=retention.ms=60000 --config=segment.bytes=26214400 --config=retention.bytes=104857600,tb.transport.api.requests:30:1:delete --config=retention.ms=60000 --config=segment.bytes=26214400 --config=retention.bytes=104857600,tb.rule-engine:30:1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Docker configuration for ThingsBoard Microservices | ||
|
||
This folder containing scripts and Docker Compose configurations to run ThingsBoard in Microservices mode. | ||
|
||
## Installation | ||
|
||
Execute the following command to run DataBase installation: | ||
|
||
` | ||
$ ./docker-install-tb.sh --loadDemo | ||
` | ||
|
||
- `--loadDemo` - optional argument. Whether to load additional demo data. | ||
|
||
## Running | ||
|
||
Execute the following command to run services: | ||
|
||
` | ||
$ ./docker-start-services.sh | ||
` | ||
|
||
Execute the following command to stop services: | ||
|
||
` | ||
$ ./docker-stop-services.sh | ||
` | ||
|
||
Execute the following command to stop and completely remove deployed docker containers: | ||
|
||
` | ||
$ ./docker-remove-services.sh | ||
` | ||
|
||
Execute the following command to update particular services (pull newer docker image and rebuild container): | ||
|
||
` | ||
$ ./docker-update-service.sh [SERVICE...] | ||
` | ||
|
||
## Upgrading | ||
|
||
In case when database upgrade is needed, execute the following commands: | ||
|
||
` | ||
$ ./docker-stop-services.sh | ||
$ ./docker-upgrade-tb.sh --fromVersion=[FROM_VERSION] | ||
$ ./docker-start-services.sh | ||
` | ||
|
||
- `FROM_VERSION` - from which version upgrade should be started. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright © 2016-2018 The Thingsboard Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
function additionalComposeArgs() { | ||
source .env | ||
ADDITIONAL_COMPOSE_ARGS="" | ||
case $DATABASE in | ||
local) | ||
;; | ||
postgres) | ||
ADDITIONAL_COMPOSE_ARGS="-f docker-compose.postgres.yml" | ||
;; | ||
cassandra) | ||
ADDITIONAL_COMPOSE_ARGS="-f docker-compose.cassandra.yml" | ||
;; | ||
*) | ||
echo "Unknown DATABASE value specified: '${DATABASE}'. Should be either local, postgres or cassandra." >&2 | ||
exit 1 | ||
esac | ||
echo $ADDITIONAL_COMPOSE_ARGS | ||
} | ||
|
||
function additionalStartupServices() { | ||
source .env | ||
ADDITIONAL_STARTUP_SERVICES="" | ||
case $DATABASE in | ||
local) | ||
;; | ||
postgres) | ||
ADDITIONAL_STARTUP_SERVICES=postgres | ||
;; | ||
cassandra) | ||
ADDITIONAL_STARTUP_SERVICES=cassandra | ||
;; | ||
*) | ||
echo "Unknown DATABASE value specified: '${DATABASE}'. Should be either local, postgres or cassandra." >&2 | ||
exit 1 | ||
esac | ||
echo $ADDITIONAL_STARTUP_SERVICES | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# | ||
# Copyright © 2016-2018 The Thingsboard Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
version: '2.2' | ||
|
||
services: | ||
cassandra: | ||
restart: always | ||
image: "cassandra:3.11.3" | ||
ports: | ||
- "9042" | ||
volumes: | ||
- ./tb-node/cassandra:/var/lib/cassandra | ||
tb: | ||
environment: | ||
DATABASE_TS_TYPE: cassandra | ||
DATABASE_ENTITIES_TYPE: cassandra | ||
CASSANDRA_URL: cassandra:9042 | ||
depends_on: | ||
- kafka | ||
- cassandra |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.