Linux 下 LXD 容器搭建 Hadoop 集群
$ lxc file push ~/Downloads/hadoop-2.7.3.tar.gz master/root/hadoop-2.7.3.tar.gz$ lxc exec master
-- /bin/bash
root@master#
mkdir -p /home/root/HD_data
root@master#
tar xf hadoop-2.7.3.tar.gz -C /usr/local
root@master# cd
/usr/local/hadoop-2.7.3
root@master:
/usr/local/hadoop-2.7.3# cat << EOF > etc/core-site.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>hadoop.tmp.dir</name>
<value>/home/root/HD_data</value>
</property>
<property>
<name>fs.defaultFS</name>
<value>hdfs://master:8020</value>
</property>
</configuration>
EOF
root@master:/usr/local/hadoop-2.7.3# cat << EOF > etc/yarn-site.xml
<?xml version="1.0"?>
<configuration>
<property>
<name>yarn.resourcemanager.hostname</name>
<value>master</value>
</property>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
</configuration>
EOF
root@master:/usr/local/hadoop-2.7.3# cat << EOF > etc/mapred-site.xml
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
</configuration>
EOF
root@master:/usr/local/hadoop-2.7.3# ./bin/hdfs namenode -format
root@master:/usr/local/hadoop-2.7.3# exit
页:
[1]