本地安装CDH集群——(1)保姆级CentOS7安装及配置教程
一、使用VMware Workstation Pro安装CentOS 7
1.安装并打开VMware Workstation Pro。
2.选择创建新的虚拟机。
3.选择自定义。
4.为了更好的稳定性与兼容性,选择Workstation 12.x。
5.选择稍后安装操作系统。
6.客户机操作系统选择Linux,版本选择CentOS 7 64位。
7.修改好虚拟机的名称以及路径。
8.选择适当的处理器个数与内核数量(稍后可自行更改)。
9.选择适当的内存容量。
10.选择网络类型为:使用网络地址转换(NAT)。
11.I/O控制器选择 LSI Logic。
12.磁盘类型选择SCSI(S)。
13.选择创建新虚拟磁盘。
14.分配磁盘大小并勾选将虚拟磁盘拆分成多个文件。
15.磁盘文件名不用修改,直接下一步。
16.点击自定义硬件。
17.选中声卡,将其移除。
18.选中CD/DVD 将自动检测改为使用ISO镜像文件,并选择CentOS7的镜像文件。
19.然后点击完成,完成虚拟机的设置。
20.选中刚刚新建的虚拟机,并点击开启此虚拟机。
21.进入之后选择Install CentOS 7
22.地区和语言都选择English,然后continue。
23.DATE&TIME 选择Shanghai。
24.INSTALLATION DESTINATION 选择之后,进去直接点击done,然后点击Begin Installation。
25.设置ROOTPASSWORD,完成之后点击done。
26.点击USER CREATION ,创建用户
27.等读条完毕之后,点击reboot,至此,CentOS 7 系统安装成功,接下来要做的是系统内的相关配置。
二、虚拟机的备份以及导入
1.重启之后使用root用户登入系统,然后使用shutdown -h now 命令来关闭虚拟机。
2.虚拟机关闭之后,选中虚拟机,点击文件,然后选择导出为OVF,然后选择路径,命名为XXXback。
3.等待读条完成即导出完成。
4.完成之后,选择文件–>打开,并打开刚刚备份的文件。
5.修改虚拟机名称以及路径,然后选择导入。
6.等读条完毕之后即导入成功。
三、CentOS 7内IP地址及网关设置
1.进入CentOS 7并使用root用户登入系统。
2.依次输入systemctl stop firewalld以及systemctl disable firewalld 停用并禁用防火墙,注意,此时必须是由root用户登录,否则权限不够,若非root用户登录,可使用 su XXX(用户名) 命令来切换用户。
3.使用cd /etc/sysconfig/network-scripts/ 命令来跳转至network-scripts目录,并使用ls命令来查看当前目录下的所有文件。
4.使用vi ifcfg-ens33命令来修改ifcfg-ens33文件。
5.回车之后,按i进行插入,将ONBOOT修改为yes,并插入 IPADDR=192.168.60.XXX 来设置ip地址,插入GATEWAY=192.168.60.2 来设置网关,插入NETMASK=255.255.255.0 来设置子网掩码,插入DNS1=8.8.8.8 来设置DNS。并按一下esc键,再输入:x进行保存。
6.ip地址的号段是通过 编辑–>虚拟网络编辑器中的VMnet8的DHCP中的ip地址范围来决定的。网关以及子网掩码需要与NAT设置中的网关以及子网掩码保持一致。
7.输入systemctl restrat network.service命令来重启网络服务。
8.重启完之后使用 ping www.baidu.com 命令来ping网络连接,使用ctrl+c来结束测试,如下图所示则网路连接正常。
四、Xshell 6 的安装与使用
1.安装Xshell 6 以及 Xftp 6。
2.打开Xshell 6 ,选择新建。
3.输入名称以及主机,主机要与刚刚设置的ip地址保持一致。
4.点击用户身份验证,并输入root用户名与密码。
5.选择保存并接受。
6.出现如下界面,则使用Xshell 6登入远程虚拟机成功。
五、Xftp 6的安装与使用
1.安装完Xftp 6 之后,打开软件,选择新建。
2.输入名称与主机地址,地址与ip地址保持一致,协议选择SFTP,输入root用户名与密码,点击确定。
3.选择刚刚新建的会话名称,点击连接。
4.出现如下界面则连接成功。