LVS+Keepalived实现高可用的ip负载均衡

封装rhel7.6的母盘







#母盘封装的一些操作
设置主机名
配置网卡,静态ip
配置网络仓库或者本地仓库(使用rhel7.6镜像)
设置本地dns解析
安装bash自动补齐工具,yum install -y bash-*
根据需要安装相应工具和服务即可,如lftp、http等
关闭防火墙,selinux。

清理命令不清楚,没有安装,使用yum/dnf provides */virt-sysprep 找到命令提供者

安装最小系统
[root@foundation15 html]# mkdir rhel7.6
[root@foundation15 html]# mount /isos/rhel-server-7.6-x86_64-dvd.iso /var/www/html/rhel7.6/
[root@foundation15 html]# firewall-cmd --add-service=http
success
[root@foundation15 html]# firewall-cmd --reload
success
[root@foundation15 html]# cd /var/lib/libvirt/images/

配置内容
原始server1 软件仓库 
[root@localhost ~]# hostnamectl set-hostname server1
[root@localhost ~]# cd /etc/yum.repos.d
[root@localhost yum.repos.d]# vi westos.repo
[dvd]
name=dvd
baseurl=http://172.25.15.250/rhel7.6/
gpgcheck=0
[root@localhost network-scripts]# systemctl disable --now NetworkManager

==ip==
[root@localhost yum.repos.d]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# vi ifcfg-eth0
OOTPROTO=static
NAME=eth0
DEVICE=eth0
ONBOOT=yes
IPADDR=172.25.15.1
PREFIX=24
GATEWAY=172.25.15.250
DNS1=114.114.114.114
[root@localhost network-scripts]# systemctl restart network

下载工具 解析 火墙
[root@localhost ~]# yum install -y bash-* lftp vim
[root@server1 ~]# vim /etc/hosts
172.25.15.250 foundation15.ilt.example.com
172.25.15.1 server1
172.25.15.2 server2
172.25.15.3 server3
172.25.15.4 server4
172.25.15.5 server5
172.25.15.6 server6
[root@server1 ~]# systemctl disable --now firewalld
[root@server1 ~]# vim /etc/sysconfig/selinux 
SELINUX=disabled
[root@server1 ~]# reboot

压缩虚拟机
[root@foundation15 images]# dnf install -y libguestfs-tools
[root@foundation15 images]# virt-sysprep -d rhel7.6-demo      ##清理虚拟机临时信息
[root@foundation15 images]# virt-sparsify --compress rhel7.6-demo.qcow2 demo.qcow2 ##压缩虚拟机
[root@foundation15 images]# du -sh demo.qcow2
568M	demo.qcow2
[root@foundation15 images]# rm -fr rhel7.6-demo.qcow2
[root@foundation15 images]# mv  demo.qcow2 rhel7.6-demo.qcow2

建立实验的三个虚拟机
快照server1 2 3
[root@foundation15 images]# qemu-img create -f qcow2 -b rhe
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值