-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdocker-compose_cluster.yml
66 lines (63 loc) · 1.84 KB
/
docker-compose_cluster.yml
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
services:
# Master
master-node:
image: "jwaresolutions/big-data-cluster:0.5.0"
command: bash -c "/home/big_data/spark-cmd.sh start master-node"
ports:
- target: 8080
published: 8080
protocol: tcp
mode: host
- target: 9870
published: 9870
protocol: tcp
mode: host
- target: 18080
published: 18080
protocol: tcp
mode: host
networks:
- cluster-net
volumes:
# - "./data:/home/big_data/data" # Your data
- hdfs-master-data:/home/hadoop/data/nameNode
- hdfs-master-checkpoint-data:/home/hadoop/data/namesecondary
deploy:
mode: global # Required by Docker Swarm to make published ports work with other services
endpoint_mode: dnsrr # Required to prevent java.net.ConnectException
placement:
# Set node labels using `docker node update --label-add role=master <NODE ID>` from swarm manager
constraints:
- node.labels.role==master
# Workers
worker:
image: "jwaresolutions/big-data-cluster:0.5.0"
command: bash -c "/home/big_data/spark-cmd.sh start"
depends_on:
- "master-node"
volumes:
- hdfs-worker-data:/home/hadoop/data/dataNode
deploy:
placement:
# Set node labels using `docker node update --label-add role=worker <NODE ID>` from swarm manager
constraints:
- node.labels.role==worker
# Deploy N containers for this service
replicas: 3
networks:
- cluster-net
volumes:
hdfs-master-data:
external: true
name: 'hdsf_master_data_swarm'
hdfs-master-checkpoint-data:
external: true
name: 'hdsf_master_checkpoint_data_swarm'
hdfs-worker-data:
external: true
name: 'hdsf_worker_data_swarm'
# Uses cluster-net network
networks:
cluster-net:
external: true
name: cluster_net_swarm