generated from thedatasociety/lab-template
-
Notifications
You must be signed in to change notification settings - Fork 7
/
start.hadoop
34 lines (25 loc) · 1.51 KB
/
start.hadoop
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
#loading envvars
#for auto load in binderhub:
source ~/.profile
#for manual start: run
#source $(pwd)/.bashrc
#Starting sshd server
/usr/sbin/sshd -f ~/resources/configs/ssh/sshd_config
# Adding names to know hosts. This step avoids yes/no host confirmation.
ssh -o "StrictHostKeyChecking no" $USER@localhost -p 8822 -C "exit"
ssh -o "StrictHostKeyChecking no" $USER@0.0.0.0 -p 8822 -C "exit"
# Copying configurations files to the Hadoop folder
cp ~/resources/configs/hadoop/${HADOOP_VERSION}/core-site.xml ${HADOOP_HOME}/etc/hadoop/
cp ~/resources/configs/hadoop/${HADOOP_VERSION}/hdfs-site.xml ${HADOOP_HOME}/etc/hadoop/
# Formatting the filesystem
hdfs namenode -format -force -nonInteractive >> /dev/null
start-dfs.sh && \
#Copying YARN configurations for Pseudo-Distributed Mode
cp ~/resources/configs/hadoop/${HADOOP_VERSION}/mapred-site.xml ${HADOOP_HOME}/etc/hadoop/ && \
cp ~/resources/configs/hadoop/${HADOOP_VERSION}/yarn-site.xml ${HADOOP_HOME}/etc/hadoop/ && \
start-yarn.sh && \
hdfs dfs -mkdir /user/ && \
hdfs dfs -mkdir /user/matheus/ && \
hdfs dfs -mkdir /user/$USER &
# echo "${USER} $(pwd) ${HADOOP_HOME} ${HADOOP_VERSION}" > startresult.txt