Renaming + refactoring

This commit is contained in:
Volodymyr Babak 2017-05-24 16:17:23 +03:00
parent 08e5feea9c
commit 868f5d3ca1
17 changed files with 35 additions and 33 deletions

View File

@ -3,4 +3,5 @@ CASSANDRA_DATA_DIR=/home/docker/cassandra_volume
# cassandra schema container environment variables
SKIP_SCHEMA_CREATION=false
SKIP_SYSTEM_DATA=true
SKIP_DEMO_DATA=true
SKIP_DEMO_DATA=true
CASSANDRA_URL=cassandra

View File

@ -17,7 +17,7 @@
version: '2'
services:
db:
cassandra:
ports:
- "9042"
- "9160"

View File

@ -17,7 +17,7 @@
version: '2'
services:
db:
cassandra:
ports:
- "9042:9042"
- "9160:9160"

View File

@ -17,26 +17,27 @@
version: '2'
services:
thingsboard:
image: "thingsboard/application:1.2.3"
tb:
image: "thingsboard/application:k8stest"
ports:
- "8080:8080"
- "1883:1883"
- "1884:1883"
- "5683:5683/udp"
env_file:
- thingsboard.env
entrypoint: ./run_thingsboard.sh
thingsboard-db-schema:
image: "thingsboard/thingsboard-db-schema:1.2.3"
- tb.env
entrypoint: ./run-application.sh
tb-cassandra-schema:
image: "thingsboard/tb-cassandra-schema:k8stest"
environment:
- SKIP_SCHEMA_CREATION=${SKIP_SCHEMA_CREATION}
- SKIP_SYSTEM_DATA=${SKIP_SYSTEM_DATA}
- SKIP_DEMO_DATA=${SKIP_DEMO_DATA}
entrypoint: ./install_schema.sh
db:
image: "cassandra:3.9"
- CASSANDRA_URL=${CASSANDRA_URL}
entrypoint: ./install-schema.sh
cassandra:
image: "thingsboard/cassandra:k8stest"
volumes:
- "${CASSANDRA_DATA_DIR}:/var/lib/cassandra"
zk:
image: "zookeeper:3.4.9"
image: "thingsboard/zk:k8stest"
restart: always

View File

@ -16,12 +16,12 @@
FROM cassandra:3.9
ADD install_schema.sh /root/install_schema.sh
ADD install-schema.sh /root/install-schema.sh
RUN apt-get update \
&& apt-get install -y nmap
RUN chmod +x /root/install_schema.sh
RUN chmod +x /root/install-schema.sh
ADD schema.cql /root/schema.cql
ADD demo-data.cql /root/demo-data.cql

View File

@ -1,6 +1,6 @@
VERSION=k8stest
PROJECT=thingsboard
APP=thingsboard-db-schema
APP=tb-cassandra-schema
build:
cp ../../dao/src/main/resources/schema.cql .

View File

@ -17,12 +17,12 @@
apiVersion: v1
kind: Pod
metadata:
name: tb-db-schema
name: tb-cassandra-schema
spec:
containers:
- name: tb-db-schema
- name: tb-cassandra-schema
imagePullPolicy: Always
image: thingsboard/thingsboard-db-schema:k8stest
image: thingsboard/tb-cassandra-schema:k8stest
env:
- name: SKIP_SCHEMA_CREATION
value: "false"
@ -35,5 +35,5 @@ spec:
command:
- sh
- -c
- ./install_schema.sh
- ./install-schema.sh
restartPolicy: Never

View File

@ -1,6 +1,6 @@
#Thingsboard server configuration
CASSANDRA_URL=db:9042
CASSANDRA_URL=cassandra:9042
ZOOKEEPER_URL=zk:2181
MQTT_BIND_ADDRESS=0.0.0.0
MQTT_BIND_PORT=1883

View File

@ -16,9 +16,9 @@
FROM openjdk:8-jre
ADD run_thingsboard.sh /root/run_thingsboard.sh
ADD run-application.sh /root/run-application.sh
ADD thingsboard.deb /root/thingsboard.deb
RUN chmod +x /root/run_thingsboard.sh
RUN chmod +x /root/run-application.sh
WORKDIR /root

View File

@ -21,12 +21,12 @@ dpkg -i /root/thingsboard.deb
reachable=0
while [ $reachable -eq 0 ];
do
echo "thingsboard-db-schema container is still in progress. waiting until it completed..."
echo "tb-cassandra-schema container is still in progress. waiting until it completed..."
sleep 3
ping -q -c 1 thingsboard-db-schema > /dev/null 2>&1
ping -q -c 1 tb-cassandra-schema > /dev/null 2>&1
if [ "$?" -ne 0 ];
then
echo "thingsboard-db-schema container completed!"
echo "tb-cassandra-schema container completed!"
reachable=1
fi
done

View File

@ -112,7 +112,7 @@ spec:
command:
- sh
- -c
- ./run_thingsboard.sh
- ./run-application.sh
livenessProbe:
httpGet:
path: /login

View File

@ -55,7 +55,7 @@ RUN set -x \
&& rm -rf /var/lib/apt/lists/*
#Copy configuration generator script to bin
COPY zkGenConfig.sh zkOk.sh /opt/zookeeper/bin/
COPY zk-gen-config.sh zk-ok.sh /opt/zookeeper/bin/
# Create a user for the zookeeper process and configure file system ownership
# for nessecary directories and symlink the distribution as a user executable

View File

@ -15,7 +15,7 @@
# limitations under the License.
#
# zkOk.sh uses the ruok ZooKeeper four letter work to determine if the instance
# zk-ok.sh uses the ruok ZooKeeper four letter work to determine if the instance
# is health. The $? variable will be set to 0 if server responds that it is
# healthy, or 1 if the server fails to respond.

View File

@ -159,17 +159,17 @@ spec:
command:
- sh
- -c
- zkGenConfig.sh && zkServer.sh start-foreground
- zk-gen-config.sh && zkServer.sh start-foreground
readinessProbe:
exec:
command:
- "zkOk.sh"
- "zk-ok.sh"
initialDelaySeconds: 15
timeoutSeconds: 5
livenessProbe:
exec:
command:
- "zkOk.sh"
- "zk-ok.sh"
initialDelaySeconds: 15
timeoutSeconds: 5
volumeMounts: