虚拟机centos挂在CD盘符:
    1.查看驱动名称
    dmesg | grep CD

    2.创建文件夹
    mkdir /mnt/cdrom

    3.挂在光驱
    mount -t iso9660 /dev/sr0 /mnt/cdrom
    注意:返回正确信息
    mount: block device /dev/sr0 is write-protected, mounting read-only


    问题:
    a)安装vmware-tool工具遇到的问题
    -bash: ./vmware-install.pl: /usr/bin/perl: bad interpreter: No such file or directory
    解决:安装—>yum groupinstall “Perl Support”


    1.centos 挂载window本地目录 步骤
    a)需要在本地设置共享文件夹
    b)在虚拟机的设置中,启用共享文件夹,找到相应的目录
    c) vmhgfs-fuse .host:/data /mnt/hgfs/ 进行挂载
    d) vmware-hgfsclient 查看共享目录

    挂在遇到的问题:
    出现了安装共享文件后,centos机器中没有显示共享文件夹:
    出现的错误:
    a) Error: cannot mount filesystem: No such device

    2) yum install open-vm-tools-devel -y

    3) vmhgfs-fuse .host:/data /mnt/hgfs/




    2.centos中创建用户
    创建新用户:
    a) useradd -m centos01
    b) passwd centos01 01 01


    授权:
    a) sudoers
    未找到指令
    b) whereis sudoers

    c) ls -l /etc/sudoers 查看权限

    d) 修改权限
    # chmod -v u+w /etc/sudoers

    e) 添加新增用户
    vim /etc/sudoers

    ## Allow root to run any commands anywher
    root ALL=(ALL) ALL
    linuxidc ALL=(ALL) ALL #这个是新增的用户
    f) 写权限收回
    # chmod -v u-w /etc/sudoers





    准备完全分布式主机的ssh
    1.删除所有主机上/home/centos/.ssh/
    2.在s201主机上生产密钥对
    >ssh-keygen -t rsa -P ‘’ -f ~/.ssh/id_rsa
    [注意:~/.ssh权限设置为700 ~/.ssh/authorized_keys的权限设置为644]
    3.将本地的公钥拷贝到其他主机,并放置到
    /home/centos/.ssh/authorized_keys
    scp id_rsa.pub centos@s202:/home/centos/.ssh/authorized_keys

    4. 配置完全分布式
    [core-site.xml]
    <?xml version=”1.0” encoding=”UTF-8”?>
    <?xml-stylesheet type=”text/xsl” href=”configuration.xsl”?>


    fs.defaultFS
    hdfs://s201/



    [hdfs-site.xml]
    <?xml version=”1.0” encoding=”UTF-8”?>
    <?xml-stylesheet type=”text/xsl” href=”configuration.xsl”?>


    dfs.replication
    3



    [mapred-size.xml]
    不变

    [yarn-site.xml]
    <?xml version=”1.0”?>


    yarn.resourcemanager.hostname
    s201


    yarn.nodemanager.aux-services
    mapreduce_shuffle


    [slavers]
    s202
    s203
    s204

    []

    5.分发配置
    >cd /soft/hadoop/etc
    >scp -r full centos02:s202:/soft/hadoop/etc
    scp -r full centos03:s203:/soft/hadoop/etc
    scp -r full centos03:s203:/soft/hadoop/etc
    6.删除符号连接
    cd /soft/hadoop/etc
    rm hadoop
    ssh s202 rm /soft/hadoop/etc/hadoop
    ssh s203 rm /soft/hadoop/etc/hadoop
    ssh s204 rm /soft/hadoop/etc/hadoop

    7.创建符号连接
    cd /soft/hadoop/etc

    ln -s full hadoop
    ssh s202 ln -s /soft/hadoop/etc/full /soft/hadoop/etc/hadoop
    ssh s203 ln -s /soft/hadoop/etc/full /soft/hadoop/etc/hadoop
    ssh s204 ln -s /soft/hadoop/etc/full /soft/hadoop/etc/hadoop

    8.删除临时目录文件
    cd /tmp
    rm -rf hadoop-centos
    ssh s202 rm -rf /tmp/hadoop-centos
    ssh s203 rm -rf /tmp/hadoop-centos
    ssh s204 rm -rf /tmp/hadoop-centos
    9.删除hadoop日志
    cd /soft/hadoop/logs
    rm -rf

    ssh s202 rm -rf /soft/hadoop/etc/logs/
    ssh s203 rm -rf /soft/hadoop/etc/logs/

    ssh s204 rm -rf /soft/hadoop/etc/logs/*

    10.格式化
    hadoop namenode -format
    start-dfs.sh

    start-yarn.sh

    rsync
    ———
    远程同步
    sudo yum install rsync

    将root用户实现无密登陆


    编写脚本
    1.xcall.sh


    2.xsync.sh
    rsync -lr localpath centos@s202:/


    启动单机集器的节点:
    数据节点:hadoop-daemon.sh start datanode
    启动资源管理节点:yarn-daemon.sh start resourcemanager