forked from soyHenry/DS-M4-Cluster_Hadoop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start-container.sh
34 lines (28 loc) · 877 Bytes
/
start-container.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
#!/bin/bash
# Número default de nodos
N=${1:-3}
# Iniciar el contenedor de hadoop-master
sudo docker rm -f hadoop-master &> /dev/null
echo "start hadoop-master container..."
sudo docker run -itd \
--net=hadoop \
-p 50070:50070 \
-p 8088:8088 \
--name hadoop-master \
--hostname hadoop-master \
uracilo/hadoop &> /dev/null
# Inicializar el contenedor aprendiz o esclavo
i=1
while [ $i -lt $N ]
do
sudo docker rm -f hadoop-slave$i &> /dev/null
echo "start hadoop-slave$i container..."
sudo docker run -itd \
--net=hadoop \
--name hadoop-slave$i \
--hostname hadoop-slave$i \
uracilo/hadoop &> /dev/null
i=$(( $i + 1 ))
done
# Ingresar a nuestro contenedor master
sudo docker exec -it hadoop-master bash