VMware workstation

新建虚拟机

使用iso镜像,在安装时选择立即分配磁盘空间,参数配置如下图所示。
Ubuntu(master-slave)搭建

安装openssh-server 开启远程访问

  1. sudo apt install openssh-server 安装
  2. sudo apt update 更新安装库
  3. ifconfig 查看IP地址,如下所示:
    Ubuntu(master-slave)搭建

克隆虚拟机

克隆之前,应该让hadoop-master生成私钥,再克隆

ssh-****** 一路回车
Ubuntu(master-slave)搭建
Ubuntu(master-slave)搭建

![在这里插入图片描述](https://img-blog.csdnimg.cn/20190226152034753.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MzY4MjQxMQ==,size_16,color_FFFFFF,t_70
克隆结束后,对生成的主机生成新的mac地址
Ubuntu(master-slave)搭建

MobaXterm

修改主机名字,免密登录,下载相关工具

  1. 新建session,由于上一步克隆虚拟机之后master的IP地址可能改变,因此再ifconfig查看ip地址
    Ubuntu(master-slave)搭建
  2. 为它们更改名字,方便查看,右键 rename

Ubuntu(master-slave)搭建

  1. 安装vim
    sudo apt install vim 之后更新 sudo apt update
  2. 切换到超级用户 sudo su -, 修改主机名字
    echo master > /etc/hostname echo slave1 > /etc/hostname
  3. 查看修改的主机名字,重启后有效
    cat /etc/hostname
    Ubuntu(master-slave)搭建

6.域名访问 节点
sudo vi /etc/hosts

Ubuntu(master-slave)搭建
7.免秘钥登录
ssh-copy-id slave1
Ubuntu(master-slave)搭建
8. 将master上的/etc/hosts 文件拷贝到slave1上,拷贝的位置默认是在 slave1节点的 /home/hadoop/
Ubuntu(master-slave)搭建
9. 登陆slave1,使用超级权限将hosts文件覆盖/etc/hosts,
sudo cp /home/hadoop/hosts /etc/hosts
10. 右键创建目录

Ubuntu(master-slave)搭建
Ubuntu(master-slave)搭建
Ubuntu(master-slave)搭建
Ubuntu(master-slave)搭建
上述免密登录配置的有些问题,具体内容请参照https://blog.csdn.net/uekaikai/article/details/78819851

相关文章: