forked from mustafaakin/big-data-docker
-
Notifications
You must be signed in to change notification settings - Fork 2
/
rise-my-cluster.sh
executable file
·79 lines (71 loc) · 1.99 KB
/
rise-my-cluster.sh
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
73
74
75
76
77
78
79
docker network create --subnet 10.0.50.1/24 mynet
for i in {1..3}; do
docker run -d --network=mynet --name=zk$i -e MYID=$i \
-e PEERS=zk1,zk2,zk3 \
mustafaakin/zookeeper
done
for i in {1..5}; do
docker run -d --network=mynet --name=kafka$i \
-e BROKERID=$i -e ZKHOSTS=zk1,zk2,zk3 -e IFACE=eth0 \
mustafaakin/kafka
done
docker volume create --name mydata1
docker run -h namenode1 --rm \
--network=mynet \
-e NAMENODE=namenode1 \
--name=namenode1 -it \
-v mydata1:/data \
mustafaakin/hadoop namenode -format
docker run -p 50070:50070 -d -h namenode1 \
--network=mynet \
-e NAMENODE=namenode1 \
--name=namenode1 -it \
-v mydata1:/data \
mustafaakin/hadoop namenode
for i in {1..5}; do
docker volume create --name hadoopdata$i
docker run --net=mynet -d -e NAMENODE=namenode1 \
--name=datanode$i -it \
-v hadoopdata$i:/data \
mustafaakin/hadoop datanode
done
ZKHOSTS="zk1:2181,zk2:2181,zk3:2181"
HDFS="namenode1:8020"
HASTORAGEDIR="flink-ha/"
ZKROOT="/flink"
SLOTS="8"
CHECKPOINTDIR="checkpoints/"
IFACE="eth0"
for i in {1..3}; do
docker run -d -p 1808$i:8081 --net=mynet \
--name=jobmanager$i \
-e ZKHOSTS=$ZKHOSTS \
-e HDFS=$HDFS \
-e HASTORAGEDIR=$HASTORAGEDIR \
-e ZKROOT=$ZKROOT \
-e SLOTS=$SLOTS \
-e CHECKPOINTDIR=$CHECKPOINTDIR \
-e IFACE=$IFACE \
mustafaakin/flink jobmanager
done
for i in {1..8}; do
docker run -d --net=mynet \
--name=taskmanager$i \
-e ZKHOSTS=$ZKHOSTS \
-e HDFS=$HDFS \
-e HASTORAGEDIR=$HASTORAGEDIR \
-e ZKROOT=$ZKROOT \
-e SLOTS=$SLOTS \
-e CHECKPOINTDIR=$CHECKPOINTDIR \
-e IFACE=$IFACE \
mustafaakin/flink taskmanager
done
ZKHOSTS="zk1,zk2,zk3"
CLUSTERID="mydrillcluster"
for i in {1..10}; do
docker run -d --net=mynet \
--name=drill$i \
-e ZKHOSTS=$ZKHOSTS \
-e CLUSTERID=$CLUSTERID \
mustafaakin/drill
done