一.安装虚拟机,最小化安装
vm设置好虚拟网络之后,先去电脑网络设置,将vm net8的属性中Ipv4协议进行更改
dns设置为先前设置的网关192.168.253.2
配置好后进行虚拟机安装
安装好后在hosts下配置映射
二.安装cdh:
设置ip地址:vi /etc/sysconfig/network-scripts/ifcfg-ens33
删除默认路由:DEFROUTE=yes
删除UUID
设置开机启动ONBOOT=yes
设置IPADDR=192.168.253.101
vi /etc/sysconfig/network-scripts/ifcfg-ens33
BOOTPROTO=static
IPADDR=192.168.253.101
GATEWAY=192.168.253.2
DNS1=192.168.253.2
DNS2=8.8.8.8
重启网卡:service network restart
ping下外网是否正常
关闭NetworkManager
systemctl stop NetworkManager
systemctl disable NetworkManager
修改主机名和映射:
hostnamectl set-hostname cdh01 etc/hosts 添加192.168.253.101 cdh01
hostnamectl set-hostname cdh02 etc/hosts 添加192.168.253.102 cdh02
hostnamectl set-hostname cdh03 etc/hosts 添加192.168.253.103 cdh03
配置时间同步服务
主节点
yum install ntpd -y
vi /etc/ntp.conf
restrict 192.168.253.0 mask 255.255.255.0 nomodify notrap
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server 127.127.1.0
fudge 127.127.1.0 stratum 1
时间同步外网
yum install ntpdate.x86_64 -y
ntpdate cn.pool.ntp.org
写入开机启动 chkconfig ntpdate on
其他节点安装yum install ntpdate.x86_64 -y
进行定时任务时间同步
配置免密登录(每个节点):
ssh-keygen -t rsa
cd .ssh
ssh-copy-id cdh01
ssh-copy-id cdh02
ssh-copy-id cdh03
设置虚拟化内存和禁用大叶内存(每个节点):
优化虚拟内存
echo ‘vm.swappiness = 0’ > /etc/sysctl.d/swappiness.conf
sysctl -p
禁用大叶内存
echo never > /sys/kernel/mm/transparent_hugepage/defrag
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo “echo never > /sys/kernel/mm/transparent_hugepage/enabled” >> /etc/rc.local
echo “echo never > /sys/kernel/mm/transparent_hugepage/defrag” >> /etc/rc.local
chmod u+x /etc/rc.local
关闭防火墙:
systemctl stop firewalld
systemctl disable firewalld
重启集群:
reboot</