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

@ -4,3 +4,4 @@ CASSANDRA_DATA_DIR=/home/docker/cassandra_volume
SKIP_SCHEMA_CREATION=false SKIP_SCHEMA_CREATION=false
SKIP_SYSTEM_DATA=true SKIP_SYSTEM_DATA=true
SKIP_DEMO_DATA=true SKIP_DEMO_DATA=true
CASSANDRA_URL=cassandra

View File

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

View File

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

View File

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

View File

@ -16,12 +16,12 @@
FROM cassandra:3.9 FROM cassandra:3.9
ADD install_schema.sh /root/install_schema.sh ADD install-schema.sh /root/install-schema.sh
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y nmap && 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 schema.cql /root/schema.cql
ADD demo-data.cql /root/demo-data.cql ADD demo-data.cql /root/demo-data.cql

View File

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

View File

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

View File

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

View File

@ -16,9 +16,9 @@
FROM openjdk:8-jre 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 ADD thingsboard.deb /root/thingsboard.deb
RUN chmod +x /root/run_thingsboard.sh RUN chmod +x /root/run-application.sh
WORKDIR /root WORKDIR /root

View File

@ -21,12 +21,12 @@ dpkg -i /root/thingsboard.deb
reachable=0 reachable=0
while [ $reachable -eq 0 ]; while [ $reachable -eq 0 ];
do 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 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 ]; if [ "$?" -ne 0 ];
then then
echo "thingsboard-db-schema container completed!" echo "tb-cassandra-schema container completed!"
reachable=1 reachable=1
fi fi
done done

View File

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

View File

@ -55,7 +55,7 @@ RUN set -x \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
#Copy configuration generator script to bin #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 # Create a user for the zookeeper process and configure file system ownership
# for nessecary directories and symlink the distribution as a user executable # for nessecary directories and symlink the distribution as a user executable

View File

@ -15,7 +15,7 @@
# limitations under the License. # 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 # is health. The $? variable will be set to 0 if server responds that it is
# healthy, or 1 if the server fails to respond. # healthy, or 1 if the server fails to respond.

View File

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