-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-hadoop.yml
59 lines (56 loc) · 1.24 KB
/
docker-compose-hadoop.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
version: '3.2'
services:
namenode:
image: bde2020/hadoop-namenode:2.0.0-hadoop2.7.4-java8
networks:
- network
volumes:
- namenode:/hadoop/dfs/name
environment:
- CLUSTER_NAME=test
env_file:
- ./hadoop.env
ports:
- target: 50070
published: 50070
protocol: tcp
mode: host
- target: 9000
published: 9010
protocol: tcp
mode: host
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: on-failure
# add placement constraint to allocate namenode on particular server
placement:
constraints:
- node.role == manager
datanode:
image: bde2020/hadoop-datanode:2.0.0-hadoop2.7.4-java8
networks:
network:
aliases:
- datanode
volumes:
- datanode:/hadoop/dfs/data
env_file:
- ./hadoop.env
environment:
SERVICE_PRECONDITION: "namenode:50070"
deploy:
# mode global will deploy one datanode per docker swarm node
mode: global
restart_policy:
condition: on-failure
placement:
constraints:
- node.labels.type == hs-worker
volumes:
datanode:
namenode:
networks:
network:
external: true