forked from dharmeshkakadia/Hadoop-Scripts
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathyarn_install.sh
executable file
·95 lines (75 loc) · 2.06 KB
/
yarn_install.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
!/bin/bash
tar -xvf hadoop-2.0*
mkdir $HOME/yarn
mv hadoop-*.tar.gz myTar.tar.gz
mv hadoop-2.0* yarn/hadoop
sudo mkdir /tmp
sudo rm -r /tmp
sudo chmod a+rwx /tmp
export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-amd64
export HADOOP_HOME=$HOME/yarn/hadoop
export HADOOP_MAPRED_HOME=$HOME/yarn/hadoop
export HADOOP_COMMON_HOME=$HOME/yarn/hadoop
export HADOOP_HDFS_HOME=$HOME/yarn/hadoop
export YARN_HOME=$HOME/yarn/hadoop
export HADOOP_CONF_DIR=$HOME/yarn/hadoop/etc/hadoop
mkdir -p $HOME/yarn/yarn_data/hdfs/namenode
mkdir -p $HOME/yarn/yarn_data/hdfs/datanode
#mkdir -p $HOME/yarn/tmp
cd $YARN_HOME/etc/hadoop/
# yarn-site.xml
#echo -e "<?xml version=\"1.0\"?>
echo "<configuration>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce.shuffle</value>
</property>
<property>
<name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name>
<value>org.apache.hadoop.mapred.ShuffleHandler</value>
</property>
</configuration>" > yarn-site.xml
# core-site.xml
#echo -e "<?xml version=\"1.0\"?>
echo "<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>" > core-site.xml
# hdfs-site.xml
#echo -e "<?xml version=\"1.0\"?>
echo "<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>file:/home/dharmesh/yarn/yarn_data/hdfs/namenode</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>file:/home/dharmesh/yarn/yarn_data/hdfs/datanode</value>
</property>
</configuration>" > hdfs-site.xml
# mapred-site.xml
#echo -e "<?xml version=\"1.0\"?>
echo "<configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
</configuration>" > mapred-site.xml
cd $YARN_HOME
bin/hadoop namenode -format
sbin/hadoop-daemon.sh start namenode
jps
sbin/hadoop-daemon.sh start datanode
jps
sbin/yarn-daemon.sh start resourcemanager
jps
sbin/yarn-daemon.sh start nodemanager
jps
sbin/mr-jobhistory-daemon.sh start historyserver
jps