-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjt_config.py
30 lines (26 loc) · 1.09 KB
/
jt_config.py
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
import subprocess
import os
def jt():
subprocess.getoutput("echo '192.168.43.{} master.{}' >> /etc/hosts".format(ipm, k))
subprocess.getoutput("hostnamectl set-hostname master.{}".format(k))
subprocess.getoutput("echo '<?xml version="
1.0
"?><?xml-stylesheet type="
text / xsl
" href="
configuration.xsl
"?><configuration><property><name>fs.default.name</name><value>hdfs://master.{}:9001</value></property></configuration>' > /etc/hadoop/core-site.xml".format(
k))
subprocess.getoutput("hadoop namenode -Format")
subprocess.getoutput("echo 'iptables -F' >> /etc/rc.d/rc.local")
subprocess.getoutput("echo 'hadoop-daemon.sh start jobtracker' >> /etc/rc.d/rc.local")
subprocess.getoutput("echo '<?xml version="
1.0
"?><?xml-stylesheet type="
text / xsl
" href="
configuration.xsl
"?><configuration><property><name>mapred.job.tracker</name><value>jt.{}:9002</value></property></configuration>' > /etc/hadoop/mapred-site.xml ".format(
k))
subprocess.getoutput("echo 'iptables -F' >> /etc/rc.d/rc.local")
jt()