-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathrun-for-linux.sh
More file actions
72 lines (62 loc) · 2.82 KB
/
run-for-linux.sh
File metadata and controls
72 lines (62 loc) · 2.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env bash
read -r -p "Are you sure to install mysql? [Y/N] " input
case $input in
[yY][eE][sS]|[yY])
echo "Installing mysql..."
# deploy mysql
docker run -d --name cudgx_db -e MYSQL_ROOT_PASSWORD=mtQ8chN2 -e MYSQL_DATABASE=cudgx -e MYSQL_USER=gf -e MYSQL_PASSWORD=db@galaxy-future.com -p 3336:3306 -v $(pwd)/init/mysql:/docker-entrypoint-initdb.d yobasystems/alpine-mariadb:10.5.11
;;
[nN][oO]|[nN])
echo "Skip mysql install, please check conf/config.yml mysql config, and import init/mysql/* to existing mysql for first install."
;;
*)
echo "Invalid input..."
exit 1
;;
esac
read -r -p "Are you sure to install kafka? [Y/N] " input
case $input in
[yY][eE][sS]|[yY])
echo "Installing kafka..."
# deploy kafka
docker run -d --name zookeeper --publish 2181:2181 --volume /etc/localtime:/etc/localtime wurstmeister/zookeeper
docker run -d --name kafka --publish 9092:9092 --link zookeeper --env KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 --env KAFKA_ADVERTISED_HOST_NAME=127.0.0.1 --env KAFKA_ADVERTISED_PORT=9092 --volume /etc/localtime:/etc/localtime wurstmeister/kafka
;;
[nN][oO]|[nN])
echo "Skip kafka install, please check conf/api.json kafka config."
;;
*)
echo "Invalid input..."
exit 1
;;
esac
read -r -p "Are you sure to install clickhouse? [Y/N] " input
case $input in
[yY][eE][sS]|[yY])
echo "Installing clickhouse..."
# deploy clickhouse
docker run -d --name clickhouse -p 8123:8123 -p 9000:9000 -p 9009:9009 --ulimit nofile=262144:262144 -v $(pwd)/init/clickhouse/quickstart:/docker-entrypoint-initdb.d yandex/clickhouse-server
;;
[nN][oO]|[nN])
echo "Skip clickhouse install, please check conf/api.json clickhouse config."
;;
*)
echo "Invalid input..."
exit 1
;;
esac
# init
#docker exec kafka \
#kafka-topics --bootstrap-server broker:9092 \
# --create \
# --topic monitoring_metrics_test
# deploy api
docker run -d --name cudgx_api --network host -v $(pwd)/conf/api.json:/home/tiger/api/conf/api.json galaxyfuture/cudgx-api:"${1:-latest}"
# deploy gateway
docker run -d --name cudgx_gateway --network host -v $(pwd)/conf/gateway.json:/home/tiger/gateway/conf/gateway.json galaxyfuture/cudgx-gateway:"${1:-latest}"
# deploy consumer
docker run -d --name cudgx_consumer --network host -v $(pwd)/conf/consumer.json:/home/tiger/api/conf/consumer.json galaxyfuture/cudgx-consumer:"${1:-latest}"
# deploy pi
# docker run -d --name cudgx_sample_pi --network host --env CUDGX_SERVICE_NAME=gf.cudgx.sample.pi --env CUDGX_CLUSTER_NAME=default --env CUDGX_GATEWAY_URL=http://127.0.0.1:8080 galaxyfuture/cudgx-sample-pi:"${1:-latest}"
# deploy benchmark
# docker run -d --name cudgx_sample_benchmark --network host galaxyfuture/cudgx-sample-benchmark:"${1:-latest}" --gf.cudgx.sample.benchmark.sever-address=http://10.10.10.10/pi