Ubuntu 14.04 LTE下安装Hadoop 1.2.1(集群分布式模式)(4)

<configuration>
    <property>
        <name>fs.default.name</name>
        <value>hdfs://master:9000</value>
    </property>
    <property>
        <name>hadoop.tmp.dir</name>
        <value>/hadoop/hadooptmp</value>
    </property>
</configuration>
jerry@ubuntu:/opt/hadoop-1.2.1/conf$ sudo vim hdfs-site.xml
jerry@ubuntu:/opt/hadoop-1.2.1/conf$ cat hdfs-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="https://www.linuxidc.com/configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
    <property>
        <name>dfs.replication</name>
        <value>3</value>
    </property>
    <property>
        <name>dfs.name.dir</name>
        <value>/hadoop/hdfs/name</value>
    </property>
    <property>
        <name>dfs.data.dir</name>
        <value>/hadoop/hdfs/data</value>
    </property>
</configuration>
jerry@ubuntu:/opt/hadoop-1.2.1/conf$ sudo vim mapred-
jerry@ubuntu:/opt/hadoop-1.2.1/conf$ sudo vim mapred-site.xml
jerry@ubuntu:/opt/hadoop-1.2.1/conf$ cat mapred-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="https://www.linuxidc.com/configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
<property>
<name>mapred.job.tracker</name>
<value>master:9001</value>
</property>
</configuration>
jerry@ubuntu:/opt/hadoop-1.2.1/conf$ sudo vim mapred-site.xml
jerry@ubuntu:/opt/hadoop-1.2.1/conf$ cat mapred-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="https://www.linuxidc.com/configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
<property>
    <name>mapred.job.tracker</name>
    <value>master:9001</value>
</property>
<property>
    <name>mapred.system.dir</name> 
    <value>/hadoop/mapred/mapred_system</value>
</property>
<property>
    <name>mapred.local.dir</name> 
    <value>/hadoop/mapred/mapred_local</value>
</property>
</configuration>
jerry@ubuntu:/opt/hadoop-1.2.1/conf$ ls
capacity-scheduler.xml      hadoop-policy.xml      slaves
configuration.xsl          hdfs-site.xml          ssl-client.xml.example
core-site.xml              log4j.properties      ssl-server.xml.example
fair-scheduler.xml          mapred-queue-acls.xml  taskcontroller.cfg
hadoop-env.sh              mapred-site.xml        task-log4j.properties
hadoop-metrics2.properties  masters
jerry@ubuntu:/opt/hadoop-1.2.1/conf$ sudo vim masters
jerry@ubuntu:/opt/hadoop-1.2.1/conf$ sudo vim slaves
jerry@ubuntu:/opt/hadoop-1.2.1/conf$ cat masters
master
jerry@ubuntu:/opt/hadoop-1.2.1/conf$ cat slaves
master
slave1
slave2
jerry@ubuntu:/opt/hadoop-1.2.1/conf$

在master、slave1和slave2上的hadoop用户目录下创建好.ssh文件夹

jerry@slave1:~$ sudo mkdir -p /hadoop/hdfs/name
[sudo] password for jerry:
jerry@slave1:~$ sudo mkdir -p /hadoop/hdfs/data
jerry@slave1:~$ sudo mkdir -p /hadoop/mapred/mapred_system
jerry@slave1:~$ sudo mkdir -p /hadoop/mapred/mapred_local
jerry@slave1:~$ sudo mkdir -p /hadoop/hadooptmp
jerry@slave1:~$ chown -R hadoop:hadoop /hadoop/
chown: changing ownership of ‘/hadoop/mapred/mapred_local’: Operation not permitted
chown: changing ownership of ‘/hadoop/mapred/mapred_system’: Operation not permitted
chown: changing ownership of ‘/hadoop/mapred’: Operation not permitted
chown: changing ownership of ‘/hadoop/hdfs/data’: Operation not permitted
chown: changing ownership of ‘/hadoop/hdfs/name’: Operation not permitted
chown: changing ownership of ‘/hadoop/hdfs’: Operation not permitted
chown: changing ownership of ‘/hadoop/hadooptmp’: Operation not permitted
chown: changing ownership of ‘/hadoop/’: Operation not permitted
jerry@slave1:~$ sudo chown -R hadoop:hadoop /hadoop/
jerry@slave1:~$

在master上生存ssh秘钥然后拷贝到slave1和slave2上的hadoop用户主目录下的.ssh文件目录下

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/e386ef54f6ced7b3c6d250b30537cfd3.html